JSON to YAML Converter
Developer Tools · Added 18 August 2026
Turn a JSON payload into readable YAML for a config file, or a YAML config back into JSON for an API. Strings YAML would otherwise misinterpret are quoted automatically, multi-line text becomes a literal block rather than an escaped one-liner, and anything the converter cannot handle is reported with a line number instead of being guessed at.
How to use the json to yaml converter
- 1Choose the direction: JSON to YAML, or YAML to JSON.
- 2Paste your document into the input box.
- 3Pick the indentation — two spaces is the near-universal convention for YAML.
- 4Press Convert. Parse errors are reported with the line they occur on.
- 5Copy or download the result, or convert it back to check the round trip.
Examples
A service config
- Input
- { "name": "checkout", "replicas": 3, "env": [{ "name": "LOG_LEVEL", "value": "info" }] }
- Result
- name: checkout / replicas: 3 / env: with a nested sequence, all in block style
The Norway problem
- Input
- { "country": "NO", "enabled": "yes" }
- Result
- country: 'NO' and enabled: 'yes' — both quoted, because an unquoted YAML 1.1 reader turns them into booleans
YAML back to JSON
- Input
- A Kubernetes-style manifest with nested maps and sequences
- Result
- The equivalent JSON, ready to send to an API or diff against another version
About the json to yaml converter
Two formats for two audiences
JSON is a wire format. It is unambiguous, trivially machine-parseable and has exactly one way to write most things — which is why every API speaks it and why nobody enjoys editing it by hand. No comments, mandatory quotes, and a stray trailing comma breaks the file.
YAML is an editing format. It exists because humans maintain configuration files, and it optimises for that: comments, no quotes where none are needed, indentation instead of brackets. The cost is ambiguity — YAML has several ways to write the same thing and several ways for a plain value to be read as something you did not intend.
Where YAML surprises people
Beyond the Norway problem, three things catch people out. Tabs are not valid indentation and produce an error that rarely says so clearly. A version number like 1.10 is a float, and 1.10 equals 1.1 — which is why image tags should always be quoted. And a colon inside an unquoted value ends the key, so a URL or a time can break a line in ways that look fine until they do not.
All three are handled here by quoting on output and by reporting a line number on input. The general lesson holds outside this tool: when a YAML value could be read as something other than a string, quote it.
Round-tripping
Converting JSON to YAML and back should return the document you started with, and that is a genuinely useful check — the 'convert the result back' button exists for it. A value that changes across the round trip has been misread by one direction or the other, and you would rather find that here than in a deployment.
The one thing that does not survive a round trip through JSON is a YAML comment, because JSON has nowhere to put it. If comments matter, edit the YAML rather than regenerating it.
Frequently asked questions
What is the Norway problem?
Which parts of YAML are supported?
Why reject anchors instead of handling them?
Why does my multi-line string come out with a pipe character?
Does YAML preserve the order of keys?
Can I paste a real production config?
Related tools
JSON Formatter
Developer Tools
Pretty-print, minify and inspect JSON with precise error positions.
CSV to JSON Converter
Developer Tools
Convert CSV to JSON or JSON back to CSV, with proper quoted-field handling.
JSON Validator
Developer Tools
Check JSON validity and get a structural summary — depth, key count and type breakdown.