JSON to YAML converter
Paste JSON to get block-style YAML, or switch the direction and paste YAML to get JSON. The reader covers the YAML used in configuration files; features it does not support are reported by line instead of being guessed.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Pick JSON → YAML or YAML → JSON.
- Paste your text on the left. The result appears on the right.
- Choose the indent for the output and copy it.
Example
{"name":"Ada","tags":["a","b"],"meta":{"x":1}}
becomes
name: Ada
tags:
- a
- b
meta:
x: 1
An empty object is written {} and an empty list []. Multi-line strings are written in double quotes with \n, which every YAML parser reads back exactly.
Common YAML mistakes
| Problem |
Wrong |
Right |
| Tabs for indentation |
a tab before a key |
spaces only |
| Missing space after colon |
key:value |
key: value |
| Repeated key |
a: 1 and a: 2 |
one a |
| Unquoted special text |
msg: a: b |
msg: "a: b" |
Tips
Quote values that must stay text, such as version numbers ("1.10") and postal codes with leading zeros ("02134"). Without quotes, YAML reads 1.10 as the number 1.1.
Frequently asked questions
Which YAML features can be converted to JSON?
Block mappings and sequences, nesting by indentation, plain, single-quoted and double-quoted scalars, one-line flow collections like [1, 2] and {a: 1}, | and > block scalars, comments, and a leading ---. Anchors (&), aliases (*), tags (!), merge keys (<<), several documents in one file, and scalars that continue over lines are not supported and are reported with a line number.
How are plain values typed?
By the YAML 1.2 core rules: null, ~ and an empty value are null; true and false are booleans; whole numbers, decimals and exponents are numbers; everything else is text. So yes, no and on are text, and a date like 2026-11-03 stays a string.
Why does the YAML output have quotes around some strings?
A string is quoted whenever plain YAML would read it as something else: true, null, yes, numbers, dates, text with a colon followed by a space or with a leading special character such as - or #. That keeps the round trip lossless.
Are comments kept when converting YAML to JSON?
No. JSON has no comments, so they are dropped. Converting JSON to YAML cannot add them either.
Can YAML always be turned back into the same JSON?
For anything this tool writes, yes. YAML written by hand can contain features JSON lacks (comments, anchors, several documents), which is why those are either dropped or refused.