YAML Formatter & Converter
Paste YAML — get formatted output. Or convert YAML ↔ JSON in either direction. All in-browser.
- Runs in browser
- No signup
- No tracking
How to use YAML Formatter & Converter
Paste YAML or JSON into the input pane.
Click Format YAML, YAML → JSON, or JSON → YAML.
Pick indent width.
Copy or download.
When to use it
Cleaning up a hand-edited Kubernetes manifest.
Converting an OpenAPI spec from JSON to YAML for readability.
Importing a docker-compose.yml into a JSON-based config.
Validating syntax before applying a CI config.
What it fixes
YAML's whitespace pitfalls (tabs vs spaces, indent inconsistencies).
Online converters that lose comments or rearrange keys.
Pasting cluster secrets into a server-side validator.
About YAML Formatter & Converter
YAML's whitespace-sensitive syntax makes manual formatting brittle. This tool re-emits parsed YAML through js-yaml's serializer for consistent indentation and key ordering.
The converter handles both directions losslessly for standard data — strings, numbers, bools, null, arrays, objects. Tags, anchors, and multi-doc streams are preserved on the YAML side.
References: YAML 1.2 spec · js-yaml (GitHub)
Frequently asked
Is my YAML sent to a server?
No. js-yaml runs in your browser. Your data never leaves the page.
Can it convert in both directions?
Yes. YAML → JSON and JSON → YAML, both lossless for standard scalars and structures.
Does it validate YAML?
Format mode parses the input — invalid YAML produces an error with line and column info.
What YAML version is supported?
YAML 1.2 via js-yaml. Aliases, anchors, multi-document streams all parse correctly.