How to convert JSON to YAML
- Paste JSON into the left panel, drag a
.jsonfile onto it, click upload (up to 5 MB) or use Load from URL. - YAML appears on the right as you type. Choose 2 Spaces, 3 Spaces or 4 Spaces from the indent dropdown. Tab falls back to 2 spaces because YAML does not allow tabs for indentation.
- If the input is not valid JSON, the error bar shows the line and column. Click Fix to repair trailing commas, comments or single quotes, then Undo fix if needed.
- Click Copy or Download .yaml.
What the output looks like
Input:
{
"orderId": 1042,
"customer": { "name": "Maya Patel", "vip": true },
"items": [
{ "sku": "A-100", "qty": 2, "price": 4.5 },
{ "sku": "B-220", "qty": 1, "price": 12 }
],
"shippedAt": "2026-06-23T14:30:00Z",
"notes": null
}
Output with 2-space indent:
orderId: 1042
customer:
name: Maya Patel
vip: true
items:
- sku: A-100
qty: 2
price: 4.5
- sku: B-220
qty: 1
price: 12
shippedAt: '2026-06-23T14:30:00Z'
notes: null
shippedAt is quoted because an unquoted timestamp would be parsed as a date. Maya Patel and A-100 cannot be mistaken for anything else, so they stay plain.
Limits and notes
- Files up to 5 MB. Everything runs in your browser; nothing is sent to a server.
- Quoting: strings such as
'true','123','3.14','null','~','yes','on','NO','0x1f', dates, timestamps and the empty string are single-quoted. Keys get the same treatment, so a key namednoryis written as'n'because older YAML 1.1 parsers read it as a boolean. - Multi-line strings become
|-block literals. Lines are never wrapped. - Key order is preserved. JSON
nullis written asnull. - Numbers are written as JSON prints them. Integers above 2^53 are already rounded by the JSON parser, so keep large IDs as strings in your source.
- Need to go the other way? Use YAML to JSON. To decide which format a project should use, read JSON vs YAML. If you are converting a package manifest, package.json explained covers what each field means, and comments in JSON explains why they are missing in the first place.