JSON to YAML Converter
Convert JSON to YAML with ambiguous values quoted properly.
What you paste
Parsed in your browser — never uploadedHow this reads your output
The direction is detected from what you paste, so this converts both ways without choosing a mode. The care is in the output: any string that YAML would read as another type gets quoted. That covers yes, no, on, off, anything numeric, and version strings, all of which would otherwise change type on the way through and produce a configuration file that is subtly not what you wrote.
What the results mean
- Ambiguous strings quoted
- Values that YAML would otherwise retype. Each one would have been a silent change, which is why the count is worth a glance.
- Nesting depth
- How deep the structure goes. YAML indentation errors get harder to spot with depth, so deeply nested configuration is worth restructuring.
- Keys
- Total keys across the structure, a rough measure of how much configuration is involved.
Common problems and fixes
- A country code or a version number changed meaning
- YAML retyped it. The code NO becomes the boolean false, and the version 1.10 becomes the number 1.1. Quoting fixes both, which this converter does automatically in that direction. The rule to remember: anything that looks like a number or a boolean but is really an identifier must be quoted.
- A converted file will not load
- Check for tabs, which YAML forbids for indentation and rejects rather than interpreting. Then check depth, since a single misaligned line changes which parent a key belongs to without any syntax error. Both are why editors need a YAML mode configured for spaces.
Frequently asked questions
Is every JSON document valid YAML?
Since YAML 1.2, yes, because it is formally a superset of JSON. The reverse does not hold: YAML has comments, anchors, multiple documents and several scalar styles that JSON cannot express at all.
Which format should I use for configuration?
YAML where humans edit it, because comments alone justify it. JSON where machines generate and consume it, since it has one obvious way to write anything and no indentation to get wrong. Most trouble comes from using YAML for machine-generated files, where the readability buys nothing and the whitespace sensitivity costs.
What is the Norway problem?
A YAML list of country codes loses Norway, because NO is read as the boolean false. It is the memorable example of a general problem: YAML 1.1 treats yes, no, on and off as booleans, and many parsers still do. Quote anything that is an identifier rather than a value.
Put this on your own site
Free to embed, no attribution required beyond the source link the frame carries itself. It runs entirely in your visitor's browser, sets no cookies and loads no third-party script.
<iframe src="https://runthetests.com/embed/json-to-yaml/" width="100%" height="720" style="border:1px solid #e5e5e5;border-radius:8px" title="JSON to YAML Converter" loading="lazy"></iframe>
Preview it at https://runthetests.com/embed/json-to-yaml/. Embedded pages are marked noindex, so yours stays the canonical copy — not this one.