JSON to YAML
Convert JSON into readable YAML for a config file, with optional key sorting.
Runs in your browser — nothing you type is sent anywhere
YAML uses indentation for structure, so tabs are never used — only spaces. Long values are left on one line rather than wrapped, which keeps the output safe to paste anywhere.
YAML
The result appears here as you type. Nothing is sent anywhere — the work happens in this page.
About the JSON to YAML
YAML and JSON describe the same shapes — objects, lists, strings, numbers — so converting between them loses nothing. What changes is readability. JSON is unambiguous and painful to edit by hand; YAML drops the braces and quotes and is what almost every configuration format has settled on, from Docker Compose to GitHub Actions to Kubernetes.
The conversion here keeps unicode as unicode rather than escaping it into backslash sequences, so a name with an accent stays readable in the output instead of turning into a row of code points. Long values are left on a single line rather than wrapped, because YAML's line-folding rules are subtle and a wrapped value pasted into the wrong place changes meaning.
Sorting keys alphabetically is offered because it makes two versions of a config comparable in a diff. Object key order carries no meaning in either format, so sorting produces an equivalent document — while arrays are always left in their original order, since the position of an item in a list genuinely is data.
Everything runs in your browser. Configuration files are exactly the kind of thing that contains connection strings and keys, which is precisely what should not be pasted into a site that round-trips it through a server.
How to use the JSON to YAML
Paste your JSON
Any valid JSON — an object, an array, or a single value. Errors are reported with the line and column.
Pick the indent
Two spaces is the common convention for YAML. Four is used by some house styles. Tabs are never used, because YAML forbids them.
Sort keys if you need a clean diff
Sorting makes two versions of the same config comparable. Arrays keep their original order either way.
Copy or download
Copy the YAML to your clipboard, or download it as a .yaml file ready to drop into a project.
Frequently asked questions
Does converting to YAML lose anything?
Why does YAML not allow tabs?
Should I sort the keys?
Are my accented characters going to be escaped?
Is my config uploaded anywhere?
You may also need
YAML to JSON
Convert YAML into JSON, with indentation errors reported by line.
JSON Formatter
Format, validate and minify JSON — with the exact line and column of any error.
JSON to CSV
Turn an array of JSON objects into a spreadsheet-ready CSV, nested fields included.
JSON Validator
Find out exactly where your JSON breaks — and what is most likely causing it.