How to convert
Pick a direction
“YAML → JSON” or the reverse. Opening a .json file picks the direction for you.
Paste or open a file
The result appears at once; if the YAML has an error you get the line, column and reason.
Copy or download
Copy the result or download it as .json or .yaml.
YAML 1.1 vs 1.2
Older tools such as PyYAML read YAML 1.1, newer ones 1.2, and they differ on values like:
| Value | YAML 1.2 | YAML 1.1 |
|---|---|---|
yes / no / on / off | text | true / false |
0777 | 777 (decimal) | 511 (octal) |
0o777 | 511 | text |
1:30 | text | 90 (base 60) |
Good to know
Safe text when writing YAML. Any text a YAML reader might take as a number or boolean, like “yes”, “0501234567” or “1e3”, is written in quotes so it stays text in every version.
Anchors and merges. Anchors &anchor, aliases *alias and merge keys << are expanded into full values in JSON.
Safe from malicious files. The number of aliases is limited, so a “Billion Laughs” file can’t freeze your page.
FAQ
What’s the difference between YAML and JSON?
Both store the same data. YAML is easier to read and write by hand (indentation instead of brackets, # comments); JSON is stricter and faster for programs. Almost any valid JSON is also valid YAML.
Why do I get an indentation error?
YAML relies on spaces: items on one level start in the same column, and tabs aren’t allowed. Check the line and column in the message.
What happens to comments?
JSON has no comments, so they are dropped when converting YAML to JSON.
My file has several documents separated by ---.
They become a JSON array, one item per document.
Is my file uploaded?
No. Conversion happens in your browser; your file never leaves your device.
