YAML to JSON Guide: Indentation as Structure
Learn how YAML nesting becomes JSON nesting, and which features this subset covers.
What is the YAML to JSON Converter?
This converter handles the common YAML subset: nested maps by indentation, lists of scalars, quoted strings, numbers, booleans and null values. It is not a full YAML parser, so anchors, multi-line block scalars, flow collections and lists of maps with complex nesting are outside its scope and may be reported as unsupported. Indentation must use spaces, and nesting is read from relative indent depth, so inconsistent indentation will produce an error rather than a guessed result.
How to use it
- Paste your YAML into the box.
- Click Convert to JSON.
- Copy the JSON result.
Worked example
For the sample, the result is JSON with name Ava, age 28 as a number, tags as an array of dev and js, and address as a nested object with city Leeds.
Why convert YAML to JSON?
Because JSON is easier for many programs to read, while YAML is easier for people to write. Converting lets each side use its preferred format.
Frequently asked questions
What YAML features are supported?
Nested maps, lists of scalars, quoted strings, numbers, booleans and null values. Advanced features are outside this subset.
Why does indentation matter so much?
Because YAML uses indentation to show nesting, so a line at the wrong depth belongs to the wrong parent. This converter errors rather than guessing.