Convert YAML to JSON and JSON to YAML, with line-numbered errors
YAML Formatter and Validator
Find the indentation slip in a config file and get back consistently indented YAML.
Loading tool…
How to use yaml formatter and validator
Paste YAML or open a .yaml or .yml file.
Read the error with its line and column if there is one, and fix it.
Choose 2 or 4 spaces, key sorting and block style for long text.
Copy or download the formatted YAML, or switch to the JSON view.
What this tool does
- Explains common mistakes in plain words: tabs used for indentation, duplicate keys, a colon inside an unquoted value, unclosed quotes and brackets.
- Normalises mixed indentation and flow style into clean block YAML.
- Counts keys, list items and nesting depth.
- Handles several documents separated by ---.
How the result is verified
The formatted YAML is read back and compared with the original data value for value; if anything differed you would see a warning instead of the tick.
Frequently asked questions
Why does it say tabs are not allowed?
YAML forbids tab characters for indentation. Replace the tab at the start of the reported line with spaces; tabs inside values are fine.
Will formatting change my data?
No values change. Layout, quoting style and key order (if you sort) can change, and comments are removed, which the page tells you when your input has them.
Is my data uploaded to a server?
No. Everything you drop, paste or type is processed by code running in this browser tab. You can check it yourself: open your browser's developer tools, watch the Network panel, and use the tool. No request carries your data.
Related tools
Readable YAML from JSON, with ambiguous values quoted safely
Beautify or minify JSON with your choice of indentation
Pretty print or minify XML, checked by re-parsing
Readable SQL with clauses, joins and subqueries laid out