How to use this JSON to YAML converter
Paste your JSON into the box and press “Convert to YAML”. Objects become YAML mappings — key, colon, value — with each nesting level indented two spaces. Arrays become dash-marked lists, and an array of objects uses the familiar layout where the first key of each object rides on the dash line. The result is the style of YAML you see in Kubernetes manifests and CI configuration, ready to copy into a file or download with a .yaml extension.
The detail that makes or breaks a converter like this is quoting. YAML happily interprets bare words: yes, no, on and off become booleans in some parsers, a postcode like 90210 becomes a number, and a string containing a colon and a space can be misread as a nested key. This converter checks every string and adds quotes only where leaving them off would change the value's meaning — so the string "true" stays a string, a URL keeps its colon, and plain words like London stay clean and unquoted, the way a person would write them.
Edge cases are handled deliberately rather than hopefully. Nulls come out as the word null, empty objects and arrays as {} and [], so their types survive. Strings with line breaks are written in double-quoted style with visible escapes, preserving every character exactly. And if the input JSON is broken, you get the parser's error instead of half-finished YAML.
Example: a profile in YAML
This JSON:
converts to:
The braces and commas disappear, the array turns into a readable list, and the boolean stays a boolean. Feed that YAML to any standard parser and you get the original structure back — which is the whole point of a conversion you can trust in a config file that a pipeline will read at 3 a.m.
Why YAML exists alongside JSON
JSON won the job of machines talking to machines: it is strict, unambiguous and trivial to parse. But it is miserable to edit by hand — every key quoted, every line comma-terminated, one stray character and the whole file is rejected with a message about a position number. YAML trades a little of that strictness for human comfort: no braces, no quotes in the common case, comments allowed, structure shown by indentation. That is why the files people are expected to type — deployment manifests, automation pipelines, application settings — are so often YAML, while the data those same systems exchange over the wire is JSON. Converting between the two is a daily chore in modern development, and it is exactly the kind of chore a small, careful tool should take off your hands.
Two YAML traps this converter avoids for you
The first trap is the so-called Norway problem: the country code NO, written bare in YAML 1.1, parses as the boolean false — as do yes, on and a handful of other innocent words. The second is the silent type change: a version string like 1.20 becomes the number 1.2, and a leading-zero identifier loses its zero. Both traps spring from YAML's generous plain-scalar rules, and both are avoided the same way — by quoting the strings that would otherwise be reinterpreted. That is why the quoting check in this converter is conservative in a specific direction: it would rather quote one string too many than let a single value change type on its way into your configuration. A quoted string still reads perfectly well to a human, and every YAML parser on earth reads it back as exactly the string you started with — the safest property a converted file can have.
Frequently asked questions
Why do some strings come out quoted in the YAML?
YAML reads plain text generously — too generously. An unquoted true becomes a boolean, 123 becomes a number, and a value containing “: ” can be misread as another key. This converter quotes exactly the strings that would change meaning if left bare — words like yes, no, on and off included — and leaves everything else plain and readable.
How are JSON arrays written in YAML?
As block sequences: a dash and a space at the current indentation, one item per line. An array of objects puts the first key of each object on the dash line and the remaining keys beneath it, which is the style used by Kubernetes manifests, CI pipelines and most hand-written YAML.
Does the YAML output use tabs or spaces?
Spaces — two per level. YAML forbids tabs for indentation outright, so any converter that emitted them would produce files strict parsers reject. The two-space indent matches the convention of most YAML tooling.
What happens to null values?
A JSON null is written as the YAML word null, which every YAML parser reads back as a null — not as the string “null” and not as an empty value. Empty objects and arrays are written as {} and [] so their type survives the round trip too.
Can I convert the YAML back to JSON later?
Yes. The output sticks to the JSON-compatible subset of YAML — plain mappings, sequences and scalars — so any standard YAML parser reads it, and converting it back gives you the same structure you started with, key order included.
Where is YAML actually used?
Wherever humans edit configuration by hand: Kubernetes manifests, GitHub Actions and GitLab CI pipelines, Docker Compose files, Ansible playbooks, OpenAPI descriptions and the front matter of static-site posts. JSON is what machines exchange; YAML is what people are expected to read and type.
Why does my multi-line string look different in YAML?
A string containing line breaks is written in YAML's double-quoted style with the breaks shown as \n escapes. That is less pretty than a literal block, but it guarantees the exact characters survive, including trailing spaces that a block style would make invisible and fragile.
Is my JSON uploaded to a server?
No. Parsing and emitting both happen in JavaScript inside your browser. Config files often contain hostnames, paths and other details you would rather keep local — here they stay local, and the tool works offline once loaded.
What if my JSON is invalid?
The converter stops and shows the parser's error rather than emitting partial YAML. Run the text through the JSON Validator on this site to get the exact line of the problem, fix it, and convert again.