How to use the JSON to YAML Converter
- Paste JSON into the input; it's validated as you type.
- Choose 2- or 4-space indentation to match your project.
- Optionally switch on Quote all strings for maximum safety.
- Copy the YAML or download it as data.yaml.
Features
- Automatic quoting of ambiguous strings (booleans, null, numbers, dates, times, special characters)
- Multi-line strings become readable block scalars
- Arrays of objects use the compact “- key: value” layout
- Empty objects and arrays are written as {} and []
- 2- or 4-space indentation
Why quoting matters
YAML tries to guess types. The unquoted word no becomes the boolean false in many parsers (the famous Norway problem, since NO is Norway's country code), 007 becomes the number 7, 12:30 becomes a sexagesimal number in YAML 1.1 and 2024-01-01 becomes a date. A converter that writes strings bare can silently change your data.
This converter checks every string against those rules and quotes the risky ones, leaving ordinary text unquoted for readability. If you'd rather not think about it, Quote all strings produces YAML that is always unambiguous.
What YAML can't express from JSON
JSON and YAML are close cousins; every JSON document is valid YAML 1.2. The output here uses the block style most people write by hand. NaN and Infinity aren't valid JSON, so they can't appear; very long numbers are written as-is. Key order is preserved.