JSON to YAML
Convert JSON to YAML. Paste JSON on the left; the YAML output builds on the right as you type.
{ "name": "vayce", "tools": 224, "categories": ["images", "text-and-data"], "active": true }
becomes
name: vayce
tools: 224
categories:
- images
- text-and-data
active: true
JSON’s {} and [] map to YAML’s block-style mappings and sequences. Since every JSON document is already valid YAML by the spec, this direction never fails on well-formed input; the only real choice is indentation.
Indentation
YAML’s structure comes entirely from indentation, so the Indent control (2 or 4 spaces) changes how nested keys and array items line up. There’s no tab option: YAML explicitly disallows tabs for indentation, unlike JSON or XML where a Tab option exists.
Comments and key order
JSON has no comments, so there’s nothing to preserve on this side of the conversion, unlike YAML to JSON where existing YAML comments get dropped. Key order in the output follows the key order in the source JSON object; nothing gets alphabetized unless you convert through the JSON formatter’s Sort keys option first.
Chained conversions
Because this converter always passes through a JSON value internally, converting JSON to YAML and then swapping to YAML to XML on the same page produces the same XML you’d get from converting the original JSON to XML directly. Use whichever pair matches the page you landed on; the result doesn’t depend on which detour you took.