Developer Tools

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.

Frequently asked questions

How do I convert JSON to YAML online?
Paste your JSON into the input box, or upload a .json file. The YAML appears live as you type, with the indent, key sorting and style you pick. Copy the result or download it as a .yaml file. Nothing is uploaded: conversion runs in your browser.
What is the difference between block and flow style YAML?
Block style writes one key per line with indentation, which is the readable default for config files. Flow style writes the whole value on one line with braces and brackets, like {"name": "my-app"}, which is handy for short values pasted into a script or a message. Both hold exactly the same data.
Why are some of my strings quoted in the YAML output?
A value is quoted only when YAML would read it as something else. The words yes, no, on and off look like booleans to older YAML 1.1 parsers, 123 looks like a number, and a: b looks like a nested mapping, so all of them get quotes. Plain words like my-app need no quotes and stay bare, and every quoted value reads back as the same string.
What does the sort keys option do?
It writes object keys in alphabetical order, at every level of nesting, so the same data always produces the same file. That makes diffs clean when a config is generated on different machines or checked into version control, because only real changes show up instead of reordered keys.
What if my JSON has an error?
The tool shows the exact line and column of the first problem, plus the parser message, for example a missing comma or an unclosed bracket. Fix that spot and the YAML appears immediately. Common causes are trailing commas, single quotes around strings, and unquoted keys, none of which are valid JSON.
Is my JSON uploaded anywhere?
No. Parsing and conversion run locally in your browser with js-yaml. Your data is never uploaded, stored or seen by anyone else, which makes the tool safe for config files that contain internal hostnames or credentials, though you should still avoid pasting live secrets anywhere you do not have to.
Disclaimer: Results are estimates for planning purposes only and are not financial advice. Actual loan terms, taxes and investment returns vary. Consult a qualified professional before making financial decisions.