YAML Formatter
Validate and tidy YAML, in your browser.
Paste YAML to validate and tidy it
Paste YAML on the left and click Format. Invalid YAML is flagged with the parser error; valid YAML is re-indented cleanly — all in your browser, nothing uploaded.
Runs entirely in your browserFormat and validate YAML, locally
Paste YAML and this tool parses it, reports any syntax error with a clear message, and re-serializes it into clean, consistently-indented YAML. You can choose a 2- or 4-space indent and optionally sort mapping keys alphabetically to make configs easier to diff and review. Because YAML is whitespace-sensitive and often holds deployment and secret-adjacent config, it all runs in your browser and is never uploaded to any server.
Common questions
What does formatting do to my YAML?
It parses your YAML into data and re-emits it with consistent indentation and spacing. Anchors and aliases are resolved, comments are not preserved (YAML parsers drop comments), and the result is canonical, tidy YAML.
How does validation work?
If the YAML cannot be parsed, the tool shows the parser's error message — usually with the line and column — so you can find the problem. Valid YAML is reformatted instead.
Can it sort keys?
Yes. Turn on Sort keys to emit mapping keys in alphabetical order, which makes configuration files easier to compare and review. Leave it off to keep the original key order.
Are comments kept?
No. Like virtually all YAML libraries, the parser discards comments when it reads the document, so the reformatted output contains only the data. Keep a copy of the original if the comments matter.
Is my YAML uploaded anywhere?
No. It is parsed and formatted entirely in your browser tab using the js-yaml library loaded on your device. Nothing is sent to a server, so it works offline and your config stays private.