Skip to content
TinySolve

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

  1. Paste your JSON

    Any valid JSON — an object, an array, or a single value. Errors are reported with the line and column.

  2. 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.

  3. Sort keys if you need a clean diff

    Sorting makes two versions of the same config comparable. Arrays keep their original order either way.

  4. 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?
No. YAML is a superset of JSON in terms of what it can express, so every JSON document has an exact YAML equivalent. Converting back gives you the original structure unchanged.
Why does YAML not allow tabs?
Because indentation defines structure, and a tab renders as a different width in different editors — the same file would then describe different nesting depending on who opened it. The specification forbids tabs for indentation entirely, so this tool only ever emits spaces.
Should I sort the keys?
It helps when you are comparing two versions of a config, because it removes noise from keys having moved. Object key order means nothing in JSON or YAML, so sorting is always safe. Arrays are never reordered, since their order is real data.
Are my accented characters going to be escaped?
No. Unicode is written through as-is rather than escaped into code points, so names and non-Latin text stay readable in the output.
Is my config uploaded anywhere?
No. The conversion runs entirely in your browser. That matters here because configuration files routinely hold connection strings, hostnames and keys.