How to Convert JSON to YAML

By Ramanathan Aug 11, 2026 2 min read JSON to YAML Converter

JSON and YAML describe the same shapes — objects, arrays, and scalars — so converting from JSON to YAML is mostly a matter of style. YAML trades JSON's brackets and quotes for indentation, which is why it's popular for config files people edit by hand.

They model the same data

Every JSON value maps directly to YAML. This JSON:

{
  "name": "DevUtilsNow",
  "active": true,
  "features": ["fast", "private", "free"]
}

becomes this YAML:

name: DevUtilsNow
active: true
features:
  - fast
  - private
  - free

Objects become mappings (key: value), arrays become sequences (- item), and nesting is shown by indentation instead of { } and [ ].

Why some strings get quoted

The one thing to watch is scalars that could be mistaken for another type. In YAML, 123 is a number, true is a boolean, and null is null. So if your JSON has the string "123" or "true", a good converter writes it in quotes so it stays a string when the YAML is parsed back:

zip: "123"
enabled: "true"

Strings containing a colon-space (a: b), a leading #, or leading/trailing spaces are quoted for the same reason. Plain, unambiguous strings are left unquoted for readability.

Block style vs flow style

YAML supports a compact "flow" style ([fast, free]) that looks like JSON, and the indented "block" style shown above. Block style is what most config files use because it's the easiest to read and diff, so that's what this converter produces.

The other direction

Need to go back? See How to Convert YAML to JSON, and for choosing between formats generally, JSON vs XML vs YAML vs CSV.

Try it

Paste JSON and get clean, block-style YAML instantly — everything runs in your browser, nothing uploaded.

About the author

Ramanathan · Software Engineer & Solutions Architect

I'm a Software Engineer and Solutions Architect with 20+ years of experience building enterprise applications across BFSI, Healthcare, Retail, Manufacturing, and Industrial Automation. I've spent those two decades living in JSON, tokens, regexes, and config files — so I built the fast, private, no-login developer tools I always wanted to reach for myself.

Last updated: Aug 11, 2026