JSON ↔ YAML Converter
Convert between JSON and YAML in both directions, with validation.
Paste JSON or YAML, then pick a direction. Ctrl/⌘ + Enter repeats the last direction.
What this tool does
Paste JSON on the left and press "JSON → YAML" to get clean, indented YAML; paste YAML and press "YAML → JSON" to get pretty-printed JSON. The converter uses a full YAML 1.2 parser, so it understands block and flow styles, multi-line strings, anchors and aliases, and reports the exact line and column of any syntax error. Choose 2 or 4 spaces of indentation, and turn on "Sort keys" to order object keys alphabetically at every level, which makes two files easy to compare.
Things to know
- Comments cannot survive the round trip, because JSON has no comment syntax. Converting YAML to JSON removes them.
- YAML 1.2 rules apply: yes, no, on and off stay strings, and only true and false become booleans. Older YAML 1.1 tools treat them differently.
- A YAML file with several documents separated by --- is converted to a JSON array with one element per document.
- Anchors (&name) and aliases (*name) are resolved, so the JSON contains the repeated value in full.
- Dates and timestamps are kept as strings rather than converted to JavaScript Date objects.
- Key order is preserved unless "Sort keys" is on.
Privacy
The conversion runs in your browser. Nothing you paste is uploaded or stored, so configuration files with secrets are safe to convert here.