Format
Reads your YAML and writes it back out with clean, even indentation. Fixes uneven spacing and normalises the layout without changing any of the data.
name: peartools
free: trueAftername: peartools
free: truePaste YAML to check it, then format it with clean indentation or convert it to JSON. The tool tells you right away if the YAML is valid, and points at the exact line and column when it is not. Everything runs in your browser, so your data stays on your device.
YAML is a plain text format for config files and data, used by tools like Docker Compose, Kubernetes, and GitHub Actions. It uses indentation to show structure, which makes it easy to read but easy to break with a stray space or a tab. Formatting rewrites your YAML with clean, even indentation so the structure is clear, without changing any of the data. This tool formats your YAML, checks that it is valid, and can convert it to JSON when you need it.
Reads your YAML and writes it back out with clean, even indentation. Fixes uneven spacing and normalises the layout without changing any of the data.
name: peartools
free: trueAftername: peartools
free: trueConverts your YAML into JSON, using the same keys and values. Useful when a tool or API wants JSON but your config is written in YAML.
a: 1
b:
- 2
- 3After{ "a": 1, "b": [2, 3] }Choose 2 or 4 spaces for each level. YAML uses spaces for indentation, never tabs, so both options keep the file valid.
list:
- a
- bAfterlist:
- a
- bPuts the keys of every mapping in alphabetical order, all the way down. Sequence order is left alone, since the position of items in a list has meaning.
name: pear
age: 2Afterage: 2
name: pearSome YAML is valid but does not mean what you think. The formatter shows the parsed result, which is the quickest way to catch these. Each example below was checked with this tool:
| You write | It is read as | Fix |
|---|---|---|
version: 1.10 | The number 1.1 | Quote it: version: "1.10" |
zip: 01234 | The number 1234, losing the zero | Quote it: zip: "01234" |
country: NO | The text NO in this tool, but false in older YAML 1.1 tools | Quote it to be safe: country: "NO" |
enabled: yes | The text yes here, but true in YAML 1.1 tools | Use true or false for real booleans |
time: 12:30 | The text 12:30 here, but a number (750) in some YAML 1.1 tools | Quote times and anything with a colon |
This tool follows YAML 1.2, where only true and false are booleans. Some tools still read YAML 1.1, where yes, no, on, and off are booleans too, so quoting these values keeps the file safe everywhere.
a: b: c. Put the inner key on its own indented line, or quote the value if the colon is part of the text.YAML runs the config for a lot of modern tools, and small spacing mistakes break it. Here are the most common reasons people format and check it:
If you work with other config and data formats, these tools run the same way, right in your browser: