How do you convert JSON, CSV and YAML into each other?
Paste JSON, CSV, TSV or YAML and get the same data in another format, nested data included.
What you enter stays on your device while you use this tool. Opening a shared link sends the settings in its address to HowToolbox to prepare the page.
YAML
2 records, 3 columns
Paste JSON, CSV, TSV or YAML and get the same data in another format, nested data included.
How to use
- Choose the format your text is in (From) and the one you want (To).
- Paste the text, type it or open a file. A problem is marked at its line and column.
- Copy the converted text or save it as a file. Swap turns the result into the source to convert it back.
How it works
JSON, YAML, CSV and TSV can all hold the same records, written differently. JSON and YAML are trees: objects with named fields, lists, numbers, true and false, and null. CSV and TSV are tables: one record per line, fields separated by a comma or a tab, and the first line usually names the columns. The converter reads your text into records, then writes the same records in the other format.
A tree does not fit a table by itself, so nested fields become columns named by their path. In {"name":"Ada","born":{"year":1815}} the year sits inside born, so it becomes the column born.year, and a list such as tags becomes tags.0, tags.1 and so on. Reading such a table back rebuilds the nesting from the dotted names.
CSV follows RFC 4180: a field with a comma, a quote or a line break is wrapped in double quotes, and a quote inside it is doubled. YAML is read as YAML 1.2 for data that JSON can also hold; anchors, aliases, tags and several documents in one file are not supported. Very large numbers and unusual dates keep only the precision a standard number has.
Worked example
What does {"name":"Ada","born":{"year":1815}} look like as YAML?
- Each field of the object becomes a line with its name, a colon and its value: name: Ada.
- The nested object born becomes an indented block under its name, with year: 1815 inside it.
Three lines: name: Ada, then born:, then an indented year: 1815.
Sources
- IETF RFC 4180: Common Format and MIME Type for CSV FilesUsed for: definitions
- YAML Language Development Team: YAML Ain't Markup Language 1.2.2Used for: definitions
Frequently asked questions
Why does my CSV have columns like born.year?
The record had a field inside a field: year inside born. A table has no room for nesting, so the column is named by the path. Turn off "Nested data as dotted columns" to keep the inner part as JSON text in one column instead.
Is my data uploaded anywhere?
No. The conversion runs in your browser, and the text is not put into the page address unless you choose to share it.
Why is a YAML file refused?
It probably uses a YAML feature that has no JSON equivalent, such as anchors (&a), aliases (*a), tags (!!) or several documents separated by ---. The error line shows where it starts.
Which separator should I pick for Excel?
Excel set to a language that writes decimals with a comma expects a semicolon between fields. Choose Semicolon when writing CSV for such a spreadsheet, or choose TSV, which uses tabs.
How large a file can I convert?
A few megabytes of text convert in a moment. The work happens on your device, so very large files depend on its memory; the editor tells you when a file is longer than it accepts.





