YAML Formatter and Validator
Format, validate and minify YAML in your browser. Get precise error line numbers, normalise indentation, or collapse to compact flow style. Private.
About the YAML Formatter and Validator
This YAML formatter parses your document, checks it for errors and re-emits it with clean, consistent indentation. Paste a Kubernetes manifest, a CI config or an app settings file, pick 2 or 4 spaces, and get tidy YAML you can copy or download. If something is wrong, the validator points to the offending line with a clear message.
The parser handles the YAML features config files actually use: block mappings and sequences, nested structures, flow style ([1, 2] and {a: 1}), single and double quoted scalars, comments, and literal (|) and folded (>) block scalars. It catches the classic mistakes — tab indentation, duplicate keys, bad nesting and unclosed quotes — and tells you exactly where they are.
A Minify option collapses the structure into compact single-line flow style, handy for embedding YAML in logs or comparisons. Everything runs locally in your browser, so private infrastructure configs never leave your machine.
How to Use the YAML Formatter and Validator
- 1Paste your YAML into the input box.
- 2Choose 2-space or 4-space indentation.
- 3Click Format to normalise it, Minify for flow style, or Validate to check syntax.
- 4Fix any reported line, then copy or download the result.
Frequently Asked Questions
What YAML mistakes does the validator catch?
It flags tab characters used for indentation (YAML requires spaces), duplicate keys in the same mapping, inconsistent or over-deep indentation, and unclosed quotes — reporting the line number for each so you can jump straight to the problem.
Does formatting keep my comments?
Reformatting reads the data structure and re-emits it, so inline comments are not preserved in the output. If you need to keep comments, use the Validate action to check syntax without rewriting the file.
What does Minify do to YAML?
It collapses the document into compact flow style on a single line, like {server: {host: localhost, ports: [8080, 8443]}}. This is valid YAML (and JSON-compatible) that's convenient for one-line logging or quick diffs.
Are anchors and multi-document files supported?
This in-browser parser covers the common configuration subset — mappings, sequences, scalars, flow style and block scalars. Anchors (&), aliases (*), custom tags and multi-document streams separated by --- are not supported and should be handled by a full YAML library.
Is my YAML uploaded anywhere?
No. Parsing, validation and formatting all run in your browser, so secrets, hostnames and infrastructure details in your configs stay entirely on your device.