JSON to YAML Converter
Get YAML that is valid and readable, with quoting handled correctly.
About this tool
Convert JSON to YAML in your browser. Objects become mappings, arrays become lists, and the output is valid YAML 1.2 with indentation you choose.
Strings that would change meaning in YAML — true, 123, - item — are quoted automatically, so "true" comes back as the string you wrote, not a boolean. This is the single most common bug in JSON→YAML converters, and it is handled per the YAML 1.2 core schema rules.
Integers larger than 2⁵³−1 are written as quoted strings, because every YAML-to-JSON consumer that reads them as a number would round them. The notes under the output say when this happened.
How to use it
- Paste your JSON, or drop a
.jsonfile onto the input pane. - Pick the indentation — 2 spaces is the convention; 4 is there for configs that use it.
- Copy or download the YAML. Anything the converter decided on your behalf is stated in the notes.
Worked example
A value that reads true or 123 in JSON is quoted in the YAML so it round-trips as the string it is; a plain value stays plain. The sample converts with host and port bare and the list indented under server.
Quoting done right
Frequently asked questions
Is JSON to YAML lossless?
Why are some strings quoted and others not?
Oslo means the same thing quoted or not, so it stays bare for readability. But true, 123, null or - item would change meaning if left bare, so they are quoted. That rule set is the core of YAML 1.2.