How do I convert JSON to YAML?
Paste your JSON, keep the mode on JSON to YAML, and the tool prints the same data as YAML with two-space indentation. Switch the mode to convert YAML back into JSON. Both directions run entirely in your browser and nothing is uploaded.
Convert JSON to YAML and back, in your browser
JSON and YAML store the same kind of data, nested keys and values, lists and simple types, but they look very different. JSON uses braces, brackets, quotes and commas, which computers love and people find fiddly. YAML uses indentation and dashes, which reads more like a tidy outline. This tool moves your data between the two: paste JSON and get clean YAML, or paste YAML and get valid JSON. Pick the direction with the buttons, and the output updates as you type.
Everything happens inside your browser once the page has loaded. Your data is parsed and rewritten on your own device, nothing is uploaded to a server, and closing the tab clears it. That makes it safe for config files, API payloads and anything else you would rather not paste into a random website.
What each format is good at
JSON is the language of web APIs. It is strict, unambiguous and supported everywhere, which is exactly why machines exchange it. YAML is the language of configuration: Docker Compose files, GitHub Actions workflows, Kubernetes manifests and countless app settings. It allows comments and needs no closing brackets, so a human editing it by hand makes fewer mistakes. Converting between them lets you take an API response and drop it into a config file, or take a hand-written config and feed it to something that only speaks JSON.
Common YAML gotchas
YAML is friendly to read but has a few traps worth knowing. Indentation is the structure, so every level must use the same number of spaces, and tabs are not allowed at all: a stray tab is the single most common reason a YAML file refuses to load. Getting the spacing wrong changes the meaning rather than just the layout.
The famous one is the Norway problem. In older YAML tools an unquoted no was read as the boolean false, so a list of country codes that included Norway (NO) quietly lost a value. Words like yes, on and off had the same issue. This converter follows the modern YAML 1.2 rules, where only true and false are booleans and no stays the text "no". The safe habit either way is to quote any value you want treated as a string, especially version numbers, country codes and anything that looks like a number but is not.
One more difference to expect: YAML supports comments and JSON does not. When you convert YAML to JSON any comments are dropped, because there is nowhere to put them. Key order, on the other hand, is preserved in both directions, so the output follows the shape of your input.
How the conversion works
Going from JSON to YAML, the tool first parses your text with the browser's built-in JSON reader, which rejects anything that is not valid JSON, then serialises the resulting object as block-style YAML with two-space indentation and no line wrapping. Going the other way, it parses your YAML into an object and prints it as JSON with two-space indentation. If either input is malformed you get a plain-English message pointing at the likely cause, a trailing comma or missing quote in JSON, or inconsistent indentation in YAML, and the output stays empty until you fix it.
How we work it out
JSON to YAML parses your text with JSON.parse and serialises the object with js-yaml (two-space indent, no line wrapping). YAML to JSON parses with js-yaml and prints the object with JSON.stringify at two-space indent. Invalid input shows a clear parse error and nothing leaves your device.
Frequently asked questions
Is my data uploaded anywhere?
No. The conversion runs as JavaScript on your own device once the page has loaded. Your JSON or YAML is parsed and rewritten in the browser, nothing is sent to a server, and closing the tab removes everything.
What YAML features are supported?
The converter handles the common YAML you meet in config files: mappings, sequences, strings, numbers, booleans, null and nested structures. It reads standard YAML and writes clean block-style YAML with two-space indentation, which is what most tools expect.
Why did my unquoted no or off turn into a string?
This converter follows the modern YAML 1.2 rules, where only true and false are booleans. Older YAML 1.1 tools treat words like no, off and yes as booleans, the source of the well known Norway problem. Quote any value you want kept as text to avoid surprises either way.
Does the order of my keys stay the same?
Yes. Both JSON and YAML keep keys in the order you wrote them, so the output follows your input. Comments are the exception: YAML comments are dropped because JSON has no way to store them.
What happens if my input is invalid?
The tool shows a plain-English error and leaves the output empty. A common cause is a trailing comma or a missing quote in JSON, or inconsistent indentation in YAML, since YAML uses spaces, never tabs, to show structure.