JSON to YAML
Paste JSON or open a file to get YAML. JSON errors show their line and column, and every number is written exactly as you typed it.
Paste or type JSON, or open or drop a file of up to 25 MB. It stays on this page: nothing is sent anywhere or saved.
Paste JSON above to see it as YAML.
Everything happens on this page, on your device: your JSON is never sent anywhere or saved.
Turn JSON into readable YAML
YAML holds the same data as JSON with less punctuation, which is why config files, build pipelines and deployment tools use it. This page checks your JSON strictly, then writes it as YAML 1.2 with the yaml library, ready to paste into a config file.
How to use it
- Paste or type JSON, or open or drop a file of up to 25 MB.
- Read the line under the options: what was converted, or the first JSON error with its line and column.
- Choose the indent, the quotes and whether to sort keys.
- Copy the YAML, or download it as a .yaml file.
How JSON becomes YAML
- Objects become mappings, one key and value per line, and arrays become lists, one item per line after a dash.
- Empty objects and arrays are written as {} and [], and true, false and null stay as they are.
- Text with line breaks becomes a block (|) that keeps them exactly. Long text stays on one line, never folded.
- Anything YAML can’t show plainly, such as a control character, goes in double quotes with escapes.
What the options do
- Indent: 2 or 4 spaces for each level. YAML never indents with tabs.
- Only where needed: text a YAML reader would take for something else gets quotes, such as "true", "123" and "2026-10-21", and so do the YAML 1.1 words "yes", "no", "on" and "off", which older readers turn into true or false.
- On every string: every text value and every key in double quotes.
- Sort keys: every object’s keys in character-code order, so capitals come before lowercase letters. Arrays keep their order.
Exact numbers
Every number is written exactly as it appears in your JSON. 12345678901234567890 stays whole, where converters that read JSON with JavaScript round it to 12345678901234567000, and 1.10 stays 1.10 rather than becoming 1.1.
Good to know
- Repeated keys: a key that appears twice in the same object is refused with its line, because YAML doesn’t allow it, though JSON does.
- Depth: JSON nested more than 500 levels deep is refused.
- Checking the result: YAML to JSON converts back, so you can paste the YAML there and see it read as the same data.
- Only tidying JSON? The JSON Formatter checks and lays out JSON without converting it; this page turns it into YAML.