YAML to JSON
input.yaml
output.json
The JSON appears here.
or drop a .yaml file into the left pane
What converts cleanly
Mappings become objects, sequences become arrays, and scalars keep their type. Anchors and aliases are resolved during parsing, so a YAML file that reuses a block through&defaults and *defaults produces JSON with the value expanded in both places:
defaults: &defaults
retries: 3
staging:
<<: *defaults
host: stage.example.com
{
"defaults": { "retries": 3 },
"staging": { "retries": 3, "host": "stage.example.com" }
}What cannot survive the trip
- Comments. JSON has no syntax for them. This is the main reason to keep the YAML file rather than converting it permanently.
- Key order intent. Order is preserved in the output text, but JSON objects are formally unordered, so nothing downstream is obliged to respect it.
- Typed tags. Custom tags such as
!!timestampor application tags collapse to their string form, since JSON has only six types.
Reading the errors
YAML failures are almost always structural rather than typographical: a key indented one space too far, a list item that lines up with its parent, or a tab where spaces belong. When parsing fails, the status bar reports the line and column the parser stopped at, which is where the indentation stopped agreeing with the block above it.
Next steps
Once converted, the tree viewer is the fastest way to check that a deeply nested config came across the way you expected, andJSON to YAML converts back.
Common questions
What happens to my comments?
They are dropped. JSON has no comment syntax, so there is nowhere to put them. If the comments matter, keep the YAML as the source of truth and treat the JSON as a build artefact rather than a replacement.
My file has several documents separated by ---. Does that work?
Yes. A multi-document stream becomes a JSON array with one element per document, because JSON has no equivalent of a document separator. A single document converts to its value directly, not to a one-element array.
Why does it complain about tabs?
YAML forbids tabs as indentation — this is in the specification, not a limitation here. Editors that insert tabs are the most common cause of an otherwise valid-looking file failing to parse. Convert the leading tabs to spaces and it will load.
Are dates and timestamps preserved?
They become strings. JSON has no date type, so an unquoted YAML timestamp is emitted as its text form rather than as an object. Numbers, booleans, and null map across exactly.
The rest of the toolkit
Same engine, same privacy — every page runs entirely in your browser.
JSON formatter
Indent JSON with 2 spaces, 4 spaces, or tabs, then copy or download the result.
JSON viewer
Expand, collapse, and search a JSON tree; copy any value or its path.
JSON validator
Find syntax errors with exact line, column, and a suggested fix.
JSON minifier
Strip whitespace and see the byte savings before and after.
JSON beautifier
Turn minified or broken JSON into clean, highlighted output.
JSON pretty print
Readable indentation with optional deep key sorting.
JSON to CSV
Flatten an array of objects into spreadsheet rows, quoted correctly.
CSV to JSON
Parse CSV — quotes, embedded commas, any delimiter — into JSON records.
JSON to YAML
Config-ready YAML with no folded strings and no anchors.
JSON to XML
Arrays repeat their tag; @keys become attributes.
XML to JSON
Entities, CDATA, and namespaces handled by the browser’s XML parser.
JSON diff
Compare two documents by path — key order and indentation are ignored.