JSON to YAML Converter
Convert JSON to YAML and YAML to JSON in your browser. Big integers stay exact, and dates and key order stay as written. Copy or download the result.
Loading tool…
How it works
Pick a direction
JSON to YAML or YAML to JSON. Swap sends the result back as input.
Paste or open a file
Paste, open a file up to 5 MB, or drop one on the box. It is read in this tab and never uploaded.
Copy or download
Check the notes for anything that changed, then copy or download the result.
Why are "NO" and "yes" quoted?
YAML 1.1 reads yes, no, on and off as booleans, 012 as octal, 1:30 as a number and 2026-11-12 as a date, and PyYAML does too. The 1.1 spec also lists y and n as booleans. YAML 1.2 reads the words, 1:30 and the date as text, and 012 as 12. Strings like these get quotes, so both read them back as text. "Read as YAML 1.1" applies the 1.1 rules when converting YAML to JSON; dates stay text either way.
What can JSON not hold?
Anchors and aliases: each alias is written out in full. .inf and .nan: JSON has no such numbers, so they become null. Tags like !Ref: dropped, the value kept. Null, list and map keys: written as text. Each of these is listed with its line. Comments are dropped.
Are big numbers kept?
Yes: 12345678901234567890 stays 12345678901234567890 both ways, and 1.10 stays 1.10. JavaScript's JSON.parse rounds integers past 2^53 - 1. Other forms, like 0x1F in YAML or 1e5 in JSON, keep their value and are listed in the notes. Key order is kept too, including keys like "10" that a JavaScript object would move first.
What about several YAML documents?
A file with --- between documents becomes a JSON array, one item per document; empty documents are skipped. Back the other way, "Array as YAML documents" writes each item of a top-level array as its own document.
Why is my YAML rejected?
The usual causes: a tab used for indentation (YAML indents with spaces), the same key twice in one mapping, or a line indented differently from its siblings. The error shows the line and column. JSON is checked strictly: no comments, no trailing commas, keys in double quotes.
Need data from a website, not a file?
Browser Use agents open pages in a real browser, including dynamic ones, and return structured data.