JSON to YAML Converter
Convert JSON to YAML online for free: paste JSON or upload a .json file and get live YAML with 2 or 4 space indent, alphabetical key sorting, block or flow style, exact parse errors, copy and .yaml download. 100% in your browser, no signup.
Conversion options
Your YAML will appear here.
How does JSON become YAML?
Every JSON object becomes a YAML mapping and every array becomes a dash list, with nested values indented under their keys. Strings stay bare when they are safe, and js-yaml quotes the ones YAML would misread: yes, no, on, off, 123 and a: b all get quotes, so a string stays a string and a number stays a number when the file is read back. Block style is the readable default, one key per line, while flow style writes the whole value on one line with braces and brackets, which is handy for short values pasted into a script or a chat message.
Quoting rule: a value is quoted only when YAML would read it as something else. yes and on look like booleans to old YAML 1.1 parsers, 123 looks like a number, and a: b looks like a nested mapping, so all four are quoted. Plain words like my-app or Ada need no quotes and stay bare.
🔒 Privacy: parsing and conversion run locally in your browser. Your JSON is never uploaded, stored or seen by anyone else.
More developer tools
How this calculator works
JSON is the data format of APIs, scripts and logs, while YAML is the config format of Kubernetes manifests, Docker Compose files and GitHub Actions workflows. Moving data between the two by hand is slow and error-prone: one missed indent changes the structure, and a bare word like yes can change meaning entirely. This converter does it instantly and live: paste JSON or upload a .json file and readable YAML appears as you type, ready to paste into a manifest. Everything runs in your browser, so your data never leaves your device.
Three options control the output. Pick 2-space or 4-space indent to match the style your project already uses. Turn on alphabetical key sorting when you want stable, diff-friendly output, for example when the same config is generated on different machines and the diff should show real changes only. Pick block style for the readable one-key-per-line layout, or flow style when a short value belongs on a single line inside a script or a chat message. When the JSON is broken, the error names the exact line and column plus what went wrong, so a missing comma or an unclosed bracket is a one-minute fix. Copy the YAML or download it as a .yaml file, and the counts panel shows keys, lines and characters live.
One quoting rule is worth knowing before you convert. YAML reads bare words by their shape, so yes and on look like booleans to older parsers, 123 looks like a number, and a: b looks like a nested mapping. This converter quotes exactly those values, and only those, so every string round-trips as a string and every number as a number. Plain words need no quotes and stay bare. If you need the reverse direction, the YAML to JSON Converter takes YAML back to JSON with the same exact error reporting, and the JSON Formatter cleans up messy JSON before you convert it.
