YAML Formatter
Clean up and normalize YAML.
YAML Formatter at a glance
YAML Formatter is a free online developer tool you can use right now to clean up and normalize YAML โ no account, no install and no usage limit. It runs entirely inside your browser, so whatever you enter stays on your own device.
- Price
- Free โ no trial, no paid tier, no watermark
- Sign-up
- Not required
- Where it runs
- In your browser โ nothing is uploaded to a server
- Works on
- Chrome, Safari, Firefox and Edge โ desktop, tablet and phone
- Category
- Developer Tools
Normalizes indentation (tabs โ 2 spaces), trims trailing spaces and collapses blank lines.
About YAML Formatter
Paste YAML and get back consistently indented, normalised output, with syntax errors reported rather than silently accepted.
YAML uses indentation to express structure, which makes it readable and makes it fragile. Tabs are not permitted for indentation at all โ the specification forbids them โ and a single tab that a previous editor inserted will fail to parse with a message that rarely points at the real problem. Inconsistent indentation between sibling keys does the same. These two account for most YAML errors people encounter in CI pipelines and Kubernetes manifests.
The other classic trap is implicit typing. Unquoted yes, no, on, off and true are all parsed as booleans, so a country code of NO becomes false. A version number like 1.20 becomes the number 1.2, losing the trailing zero. A MAC address or a time like 22:30 can be read as a sexagesimal number. The fix is always the same: quote any value whose exact string form matters.
This is worth checking before committing anything that a pipeline will consume. A YAML error in a CI configuration or a Kubernetes manifest usually surfaces as a failed run several minutes later, with an error message describing where the parser gave up rather than where the mistake actually is.
How to use YAML Formatter
- Paste your YAML into the box.
- It is parsed, checked and re-indented consistently.
- Copy the normalised result, or correct any error that is reported.
Frequently asked questions
Why does my YAML fail with an indentation error?
Most often a tab character. YAML forbids tabs for indentation entirely, and one inserted by an editor is invisible. Inconsistent indentation between sibling keys causes the same failure. Configure your editor to insert spaces in .yml and .yaml files.
Why did my value NO turn into false?
YAML's implicit typing reads unquoted yes, no, on, off, true and false as booleans, so the country code NO becomes false. Quote any value whose string form matters โ "NO" stays a string.
Why did my version number 1.20 become 1.2?
Because unquoted it is parsed as a number, and trailing zeros are not significant in numbers. Quote it as "1.20" to keep the exact string.
What is the difference between YAML and JSON here?
YAML is a superset of JSON, so valid JSON is valid YAML. YAML adds indentation-based structure, comments and multi-line strings, which is why it is preferred for configuration that humans edit.