Format YAML Online

Instantly beautify and validate YAML. 100% client-side — your data never leaves your browser.

Rules:Smart QuotesConverts curly quotes (“” ‘’) to straight quotes. Always active.Non-Breaking SpacesReplaces non-breaking spaces (U+00A0) with regular spaces. Always active.Line EndingsNormalizes CRLF → LF and trims trailing whitespace per line. Always active.Removes invisible zero-width characters (U+200B, U+200C, U+200D) that silently break string comparisons.Strips the Byte Order Mark (U+FEFF) that causes “invalid character” errors in parsers and editors.Removes soft hyphens (U+00AD) from PDFs that show as garbled characters in code editors.Converts mixed tabs/spaces to a consistent indent width. Click to pick a size.Collapses all line breaks into one continuous paragraph. Great for reflowing PDF or email text.Control blank line density. Click to pick Keep 1 or Remove all.Text never leaves your browser
0 characters

Fix Indentation

YAML is whitespace-sensitive — one wrong indent breaks the whole file. Our formatter normalizes inconsistent indentation and catches structural errors.

100% Private

All formatting happens in your browser. No server, no logs. Your CI configs, Kubernetes manifests, and secrets never leave your device.

Validate Structure

Catch YAML parse errors before they break your CI pipeline or deployment. The formatter reports the exact error and line number.

How to Format YAML Online

  1. Paste your YAML into the text area above, or drag and drop a .yaml or .yml file. The tool auto-detects YAML and switches to Format YAML mode automatically.
  2. Choose indentation. Select 2-space (the standard for Kubernetes, Docker Compose, GitHub Actions) or 4-space indentation from the options bar.
  3. Copy the result. Click “Copy Clean Text” or press Ctrl+K to copy the formatted YAML to your clipboard. You can also download it as a .yaml file.

What is YAML Formatting?

YAML (YAML Ain't Markup Language) is a human-friendly data serialization format used extensively in DevOps and cloud infrastructure — Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Helm charts, Ansible playbooks, and countless application configs. Unlike JSON or XML, YAML uses whitespace indentation to define structure, which means a single wrong space can break an entire config file.

Formatting a YAML file normalizes its indentation, fixes inconsistent spacing (mixed tabs and spaces), and makes the document's structure consistent and readable. It also validates that the YAML parses correctly, catching structural errors before they cause CI failures or silent misconfigurations.

Common YAML Formats We Handle

The formatter works with any valid YAML, including:

FormatCommon Use
KubernetesPod, Deployment, Service, ConfigMap manifests
Docker ComposeMulti-container application definitions
GitHub ActionsCI/CD workflow files
HelmKubernetes chart values and templates
AnsibleInfrastructure automation playbooks

Why YAML Indentation Matters

2-space indentation is the dominant convention in the YAML ecosystem. Kubernetes, Docker Compose, GitHub Actions, and most YAML linters default to or recommend 2 spaces. It balances readability with keeping deeply nested configs manageable in width.

4-space indentation is sometimes used in projects that follow Python-style conventions or where YAML is authored alongside Python code. It makes nesting more visually distinct but can push deeply nested structures off screen on smaller displays.

Tabs are technically invalid in YAML — the spec forbids using tabs for indentation. If your YAML contains tabs, the formatter will report a parse error. Always use spaces.

Frequently Asked Questions

Is my YAML data sent to a server?

No. Unformat.online processes all YAML entirely in your browser using the yaml library. Your data never leaves your device — including any secrets, API keys, or environment variables in your config files. Verify by opening the Network tab in DevTools.

What's the maximum YAML size I can format?

There is no hard limit. The tool handles large YAML files directly in the browser. For very large files, formatting may take a moment depending on your device.

Can I drop a YAML file instead of pasting?

Yes. Drag and drop any .yaml or .yml file onto the text area and it will be loaded and formatted automatically. This works for large Kubernetes manifests or Helm chart values files where copying is impractical.