YAML Formatter & Validator
Pretty-print, validate and re-indent YAML — multi-document files supported.
Quick answer: Pretty-print, validate and re-indent YAML — multi-document files supported.
Last updated
Frequently asked questions
- Which YAML version do you support?
- YAML 1.2 via js-yaml, plus YAML 1.1 quirks where they don't conflict (e.g. boolean shorthand). Anchors and aliases are preserved.
- Will my comments survive formatting?
- No — js-yaml drops comments because YAML's spec doesn't model them as part of the data structure. If you need to preserve comments, use a desktop tool like prettier-plugin-yaml.
- How do you handle multi-document files?
- Each document is parsed and re-emitted separately, with <code>---</code> separators between them. The structure of each document is fully preserved.
- Are my files uploaded?
- No — js-yaml runs entirely in your browser.
- Why does it re-quote some of my strings?
- Strings that contain special characters (colons, leading dashes, version-like numbers) need quoting per the YAML spec — js-yaml adds quotes only where necessary to keep the file valid.