How to use JSON to YAML
- Paste your JSON on the left.
- The YAML equivalent appears on the right as you type.
- Copy it, and quote any value that might be read as a boolean or a number.
- Indentation is two spaces per level; never replace it with tabs.
- Comments cannot survive a round trip — JSON has none, so converting YAML to JSON and back loses them permanently.
- Conversion runs in your browser; secrets in a config file are not transmitted.
YAML is a superset of JSON, which makes this safe
Every valid JSON document is already valid YAML, so the conversion is a reformatting rather than a translation — nothing needs to be approximated or dropped. Braces and brackets become indentation, quotes around keys disappear, and array elements get a leading dash. The resulting file is typically shorter and considerably easier to read and to review in a pull request, which is why configuration migrated to it.
Indentation is the syntax, so it has to be spaces
YAML uses indentation for structure, and tab characters are forbidden outright — a tab anywhere in the document is a parse error, not a style problem. Two spaces per level is the near-universal convention. Because whitespace carries meaning, a YAML file is far easier to break by accident than a JSON one: a single misaligned line changes which parent a key belongs to, and the result often parses cleanly into the wrong structure rather than failing.
The Norway problem, and other YAML surprises
YAML 1.1 treats a bare no as the boolean false, which famously turned Norway’s country code NO into false in more than one production system. Bare yes, on, off and y are booleans too. A version number written as 1.10 becomes the number 1.1, and a MAC address or a time like 22:30 can be read as a sexagesimal integer. The fix is always the same: quote any string that could be mistaken for something else. YAML 1.2 narrowed the boolean rules, but many parsers still implement 1.1.
When to keep the JSON
YAML is better to write and review; JSON is better to generate and parse. Machine-to-machine payloads, API responses and anything a program produces should stay JSON — it is unambiguous, every language parses it identically, and it has no whitespace to corrupt. Reach for YAML where a human edits the file by hand and wants comments, which JSON cannot have.
Frequently asked questions
Why convert JSON to YAML?
Is the YAML output valid?
Is YAML better than JSON?
Why did my value change when I converted it?
Can I convert YAML back to JSON?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.