About the YAML Formatter & Validator
This formatter parses YAML with the widely used js-yaml library and re-serializes it with consistent indentation, catching structural errors along the way. It suits anyone maintaining Kubernetes manifests, CI pipelines or application configuration written in YAML.
How to use it
- 01Paste your YAML document into the input panel.
- 02Choose an indent width for the output.
- 03Review any parse errors shown below.
- 04Copy or download the normalized YAML.
Features
- Full YAML 1.2-compatible parsing via js-yaml
- Configurable indent width
- Human-readable parse error messages including line context
- Copy and download as a .yaml file
Practical examples
Normalizing a Kubernetes manifest
Paste an inconsistently indented deployment manifest to reformat it with uniform two-space indentation before committing.
Limitations
- Re-serializing YAML can change formatting details such as quoting style, comments and anchor names, since comments are not preserved by the parser.
- Only a single YAML document per input is supported; multi-document streams separated by --- are not split individually.
Privacy
All parsing and formatting happens locally in your browser using the js-yaml library; nothing is sent to a server.
Read the full privacy policy for how the site as a whole handles data.
Frequently asked questions
Are comments preserved?
No, the underlying parser discards comments when building the data structure, so re-serialized output will not include them.
Does it support YAML anchors and aliases?
Yes, anchors and aliases are resolved during parsing, but the output represents the expanded data rather than reusing anchors.
What happens with multi-document YAML?
Only the first document is parsed; split multi-document files before using this tool if needed.