JSON ↔ YAML Converter
Convert between JSON and YAML in your browser — nothing is uploaded.
Paste JSON or YAML and convert it the other way in an instant — entirely in your browser, with nothing uploaded to a server. Free. No sign-up. Runs in your browser, nothing is uploaded.
YAML output
Your converted YAML will appear here.Conversion runs entirely in your browser with no upload, no account and no history. Paste config you would never send to a random web server.
Pick a direction, paste your text and the converted version appears as you type. Indentation can be set to 2 or 4 spaces, and if the input is broken you get the parser's message with the line and column instead of an empty pane. Download saves the result as .yaml or .json; switching the direction feeds the current output back in as the new input, so you can check a round trip in two clicks.
The same config in both formats
{
"name": "web",
"replicas": 2,
"ports": [80, 443],
"env": { "LOG_LEVEL": "info", "DEBUG": "false" }
}
name: web
replicas: 2
ports:
- 80
- 443
env:
LOG_LEVEL: info
DEBUG: 'false'
Notice DEBUG: in the JSON it is the string "false", so the YAML output quotes it. Without the quotes, YAML would read a boolean. The converter adds quotes wherever a string would otherwise be read as a number, boolean or null — '123', '1.10', '2026-01-01', 'NO'.
Values that change when YAML becomes JSON
The other direction is where surprises live, because unquoted YAML values are typed by how they look. Tested with this converter:
| In your YAML | In the JSON | Why |
|---|---|---|
version: 1.10 | 1.1 | Read as a number; the trailing zero is gone |
zip: 01234 | 1234 | Read as a number; the leading zero is gone |
mode: 0755 | 755 | Not octal here, and the zero is gone too |
msg: hello #world | "hello" | Space plus # starts a comment |
pw: abc#123 | "abc#123" | No space before #, so it stays |
empty: | null | A key with no value is null |
tilde: ~ | null | ~ is YAML's null |
country: NO | "NO" | YAML 1.2: only true and false are booleans |
time: 10:30 | "10:30" | Stays a string |
date: 2026-01-01 | "2026-01-01" | Stays a string |
The fix for the first four is the same: quote anything that is text but looks like a number, such as version strings, postcodes, phone numbers, file modes and IDs with leading zeros. Quote any string containing # as well.
YAML errors and what they mean
- "tab characters must not be used in indentation" — a tab slipped in, often from copying out of an editor that shows tabs as spaces. Replace it with spaces.
- "bad indentation of a mapping entry" — frequently an unquoted value with a colon and a space inside it.
title: Note: read thisfails;title: "Note: read this"works. - "unexpected end of the stream within a flow collection" — a
[or{was opened on one line and never closed. - "expected a single document in the stream" — the file has more than one
---document; split it.
A subtle one that produces no error: a list item indented one space too far gets glued to the previous item. If - b starts one space further right than the - a above it, the result is the single string "a - b" instead of two items. If a list comes out shorter than expected, check the indentation.
Which format for which job
- JSON when a program, API or schema demands it, or when data passes between services. It is strict, so there is little room for misreading: no comments, no trailing commas, double quotes everywhere.
- YAML when people edit the file by hand: CI pipelines, Docker Compose, Kubernetes manifests, Ansible playbooks, app settings. It allows
#comments and has far less punctuation, at the price of meaningful whitespace and the typing surprises in the table above.
A common loop is to generate data as JSON, convert it to YAML for a config your team maintains, and convert back when a tool insists on JSON. If the JSON side will not parse, the JSON Formatter shows the exact line and column of the problem; for spreadsheets, the JSON ↔ CSV Converter is the counterpart.
