JSON to YAML and CSV converter

Convert between JSON, YAML and CSV in your browser: detects the format and separator, resolves YAML anchors and flattens nested objects for CSV.

Waiting for input

Paste JSON, YAML or CSV data and pick the format to convert it to.

How it works

How it works

Paste your data and pick the format to convert it to. The tool detects on its own whether the input is JSON (starts with { or [ and is valid), CSV (the first line has commas, semicolons or tabs, and there are rows with the same number of columns) or YAML. You can also set the format by hand. The result updates as you type, ready to copy or download.

YAML is read in full, version 1.2: anchors and aliases (&base, *base), merge keys (<<), block text and several documents separated by ---, which become a list. If there is an error you get its line and column.

CSV

When reading CSV, quoted fields holding separators, line breaks and doubled quotes are respected. With “First row is the header” you get a list of objects; without it, a list of rows. Writing CSV needs a list of objects: the columns are every key that appears, nested objects are flattened as address.city and lists go into the cell as JSON. Keep in mind CSV does not store types: reading it back, everything is text unless you turn on “Detect numbers and booleans”.

FAQ

Why do numbers come out quoted when converting CSV to JSON?

CSV does not store types: everything is text. Turn on “Detect numbers and booleans” to turn 42 into a number and true into a boolean. Numbers with leading zeros, such as 007, stay as text.

What happens to nested objects when exporting to CSV?

They are flattened with dots: {"address": {"city": "Vigo"}} gives the column address.city. Lists go into the cell as JSON. Reading the CSV back does not rebuild the nesting.

↑ ↓ to move, Enter to open, Esc to close

Keyboard shortcuts

Ctrl K/
Search tools
c
Copy the main result
1 … 9
Switch tab
?
Show this help