JSON to YAML converter
This JSON to YAML converter turns a JSON document into readable block-style YAML 1.2. Developers use it to write Kubernetes manifests, CI pipelines, Docker Compose files and app config from existing JSON.
- Runs in your browser
- Free, no account needed
- Copy or download the result
Result
The short answer
The same data that JSON writes with braces and brackets can be written in YAML as indented lines. Objects become key: value lines, arrays become dash items, and strings that YAML could misread, such as yes or 3, are quoted. Multi-line text becomes a block with |.
Worked exampleThe JSON service config becomes a YAML document that starts with ---. The string "yes" stays quoted as enabled: "yes" so it is not read as a boolean, ports becomes a list with 80 and 443, and the two-line NOTE becomes a | block.
Example
{"name":"web","replicas":3,"enabled":"yes","ports":[80,443],"env":{"MODE":"production","NOTE":"line one\nline two\n"}}---
name: web
replicas: 3
enabled: "yes"
ports:
- 80
- 443
env:
MODE: production
NOTE: |
line one
line twoHow to use the json to yaml converter
- Paste your JSON into the JSON box.
- Pick an Indentation: 2 spaces or 4 spaces.
- The result updates as you type (Run also works). Use Copy result or Download to save it.
How it works
The YAML starts with the --- document marker. Objects become key: value lines and arrays become - items, in the same order as your JSON.
Strings that YAML could misread, such as yes, no, on, null, numbers, dates, empty text or text with leading or trailing spaces, are put in double quotes.
Multi-line strings become literal blocks (|), using |- or |+ when needed to keep the exact line endings.
Numbers keep their exact digits, so large integers are not rounded.
Invalid JSON is rejected with the line and column of the problem, and an object with the same key twice is rejected because YAML needs unique keys.
Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.
Questions and answers
Why are some values in quotes?
YAML reads some plain words as other types. Without quotes, yes or on can become true and 1.5 becomes a number, so the converter quotes them to keep them as text.
Which YAML version does the output follow?
The output is YAML 1.2 block style. It also quotes words such as yes and off that older YAML 1.1 parsers treat as booleans, so it reads the same in both.
Does it keep the order of my keys?
Yes. Keys appear in the same order as in your JSON, including keys that look like numbers.
Is my JSON uploaded?
No. It runs in your browser, and nothing you paste is sent to a server.
Last updated November 1, 2026. Maintained by SnowRock. How our tools work
All 220 SnowRock tools