YAML Formatter
Format and validate YAML with 2-space or 4-space indentation.
Related Tools
Convert YAML to JSON with instant syntax validation.
Convert JSON to YAML while preserving key order.
Validate YAML syntax against the YAML 1.2 spec.
Beautify and pretty-print JSON with configurable indentation.
Convert a docker-compose.yml into Kubernetes Deployment and Service manifests.
Parse YAML and inspect the resulting document structure.
Documentation
What is YAML Formatter?
YAML ("YAML Ain't Markup Language") is the format behind most CI configs, Kubernetes manifests, and application config files. This tool re-indents and validates YAML documents.
How it works
The input is parsed with js-yaml's loader, then dumped back out with a fixed indent width. Parse errors include the exact line and column from the underlying mark.
Spec
Frequently Asked Questions
What does the YAML Formatter do?▾
It parses your YAML, then re-serializes it with consistent indentation (2 or 4 spaces), catching syntax errors along the way.
Why is YAML sensitive to indentation?▾
Unlike JSON, YAML uses indentation itself to represent nesting — there are no braces or brackets, so inconsistent spacing changes the meaning of the document.
What does Minify do for YAML?▾
It re-emits the document in flow style — the JSON-like {}/[] syntax YAML also supports — producing a compact, single-block representation of the same data.
What causes a YAMLException?▾
The most common causes are mixing tabs and spaces for indentation, an unquoted string that looks like a special value (e.g. `no` parsing as boolean false), or a missing colon after a key.
Does this handle multi-document YAML files?▾
This tool formats a single YAML document. Files with multiple documents separated by --- should be split first.
Is my YAML uploaded anywhere?▾
No — parsing and formatting run entirely in your browser via js-yaml.