JSON to CSV Converter, YAML & TSV
Convert JSON↔CSV, JSON↔YAML/TOML and CSV↔TSV
Convert JSON↔CSV, JSON↔YAML/TOML and CSV↔TSV
Everything is converted in your browser — nothing is uploaded to a server. Nested objects are flattened/restored with dot notation, and numbers, true/false, and null are inferred automatically.
Loading…
Working…
0.0
It hasn't frozen — the result will appear when the calculation finishes.
About JSON to CSV Converter, YAML & TSV
This converter moves data between tabular and configuration formats. The JSON ↔ CSV tab flattens an array of objects into a table or rebuilds the objects from one. The CSV ↔ TSV tab swaps comma-separated for tab-separated text. The JSON ↔ YAML ↔ TOML tab converts between the three common config formats. In every case you paste text, get the converted text immediately, and copy it out.
The syntax is rarely the hard part. The trouble is the moment a value changes without anyone noticing: a ZIP code loses its leading zero, Excel shows a CSV full of mojibake, a YAML country list turns Norway into false. This page covers the rules of each format and how the tool handles those spots.
CSV has fewer rules than you think (RFC 4180)
The closest thing to a CSV specification is RFC 4180 from 2005, and it is short. Records are separated by line breaks (CRLF). Fields are separated by commas. A field that contains a comma, a double quote or a line break is wrapped in double quotes, and a double quote inside such a field is written twice (""). The RFC itself says it documents a format in common use rather than defining a standard, which is why programs still disagree on the details.
When writing CSV, this tool quotes only the fields that need it and ends lines with CRLF. When reading, it accepts both CRLF and LF, and treats line breaks inside quotes as part of the field. In the CSV → JSON direction and the CSV ↔ TSV tab it also warns if a quote is never closed or if a row has a different number of columns than the header. The delimiter can be comma, semicolon or tab; left on Auto-detect, the tool picks it from the header line when reading CSV, so semicolon-separated files from European Excel installations work as they are.
Why Excel garbles UTF-8 CSV: the BOM
Nearly every CSV produced on the web today is UTF-8. English text survives almost any encoding mix-up because ASCII is the same in all of them, so the problem goes unnoticed until someone opens a file with accented names, Korean or Japanese in Excel. When you double-click a CSV, Excel for Windows assumes UTF-8 only if the file starts with a byte order mark (the bytes EF BB BF). Without it, Excel reads the file in the system's legacy code page: Windows-1252 in the US and Western Europe, Shift_JIS (CP932) in Japan, CP949 in Korea. "José" becomes "José" and Japanese turns into unreadable symbols.
Microsoft's own support article gives the two fixes: save the CSV as UTF-8 with a BOM, or open it through Data → From Text/CSV and set File Origin to "65001: Unicode (UTF-8)". Download the JSON → CSV result with the ".csv (UTF-8 BOM, for Excel)" button and the file carries a BOM, so Excel opens it correctly on double-click. Copied text and the plain "Download .csv" have no BOM; if you paste the result into a text editor and save it, choose "UTF-8 with BOM" when Excel users will open it.
Going the other way, a file Excel saved as "CSV UTF-8" starts with a BOM. When converting CSV to JSON the tool strips that BOM, so the invisible character does not end up glued to the first column name.
JSON ↔ CSV: nesting, arrays and types
CSV is a flat grid, so nested objects need to be flattened. The tool turns {"addr": {"city": "Seoul"}} into a column named addr.city and, going back, splits column names on dots to rebuild the nesting. Arrays are not expanded into columns; they are stored in a single cell as JSON text such as ["a","b"]. When objects have different keys, the header is the union of all keys and missing values are left blank. One side effect: a key that genuinely contains a dot will come back nested.
CSV has no types; every cell is a string. Converting CSV to JSON, the tool infers them. Numeric-looking cells become numbers, exactly true or false become booleans, and empty cells or the word null become null. A number with a leading zero, like 04524, stays a string, because it is almost always a ZIP code, account number or ID. Excel is notorious for doing the opposite and turning it into 4524. Other edge cases: 1e3 is read as scientific notation and becomes 1000, uppercase TRUE stays a string, and because CSV cannot distinguish an empty string from a missing value, "" becomes null after a round trip.
CSV ↔ TSV: tabs have no quoting rules
Tab-separated values are what you get when you copy cells out of Excel or Google Sheets. They are convenient because commas in addresses or amounts need no quoting, but there is no standard way to represent a tab or a line break inside a field. When a CSV cell contains one, this tool writes it in TSV as \t or \n (and a literal backslash as \\), keeping each record on one line, and turns those back into real characters when converting TSV to CSV. The only catch: if a hand-written TSV contains the two characters \n, they will be read as a line break.
YAML: the Norway problem, 1.1 and 1.2
YAML 1.1 treated yes, no, on, off, y and n (in several capitalizations) as booleans. The classic result is a list of country codes where Norway, written as NO without quotes, silently becomes false. YAML 1.1 also read 22:30 as a base-60 number, 1350. YAML 1.2, published in 2009, cut the core schema's booleans down to true and false and dropped base-60 numbers. Many widely used libraries, PyYAML among them, still default to 1.1 behaviour, so the problem is alive in real configs.
This tool's YAML parser follows the 1.2 behaviour: NO, yes and 22:30 all stay strings. When writing YAML from JSON, it quotes any string that a 1.1 parser might misread ("NO", "yes", "on") as well as number-like strings ("3.10"), so the output means the same thing whichever parser reads it.
Other details worth knowing. An unquoted 3.10 is a number and becomes 3.1, the classic way Python 3.10 turns into 3.1 in CI configs. 012 becomes 12. Anchors and aliases (&, *), merge keys (<<) and block scalars (| and >) are not supported and produce an error rather than a wrong result. TOML has no null, so a JSON null becomes an empty string "" in TOML; that conversion loses information.
Worked examples
JSON → CSV with commas, quotes, nesting and arrays
- Input
[{"id":1,"name":"Kim, Minjun","addr":{"city":"Seoul","zip":"04524"},"tags":["a","b"],"note":"He said \"hi\""},{"id":2,"name":"Lee","addr":{"city":"Busan"},"note":null}]- Output
id,name,addr.city,addr.zip,tags,note 1,"Kim, Minjun",Seoul,04524,"[""a"",""b""]","He said ""hi""" 2,Lee,Busan,,,
Only fields containing a comma or quote are wrapped, and inner quotes are doubled. The array lands in one cell as JSON. Row two has no zip or tags, and its null note is an empty cell.
CSV → JSON type inference
- Input
id,zip,phone,flag,addr.city 1,04524,010-1234-5678,true,Seoul 2,1e3,,TRUE,Busan- Output
[{"id":1,"zip":"04524","phone":"010-1234-5678","flag":true,"addr":{"city":"Seoul"}}, {"id":2,"zip":1000,"phone":null,"flag":"TRUE","addr":{"city":"Busan"}}]
04524 keeps its zero as a string, but 1e3 becomes the number 1000. The empty phone becomes null; only lowercase true becomes a boolean. Note that zip and flag end up with different types in different rows.
YAML → JSON: values a 1.1 parser would change
- Input
country: NO answer: yes version: 3.10 time: 22:30 zip: 012- Output
{"country": "NO", "answer": "yes", "version": 3.1, "time": "22:30", "zip": 12}
Under YAML 1.1, country and answer would be false and true, and time would be 1350. Here they stay strings. version and zip are still numbers, so quote them if you need "3.10" and "012".
JSON → YAML: defensive quoting
- Input
{"country":"NO","answer":"yes","v":"3.10","n":null,"s":"a: b"}- Output
country: "NO" answer: "yes" v: "3.10" n: null s: "a: b"
Strings that YAML could read as another type, or as a nested mapping ("a: b"), are quoted. Everything else stays plain.
How to use it
- Pick a tab: JSON ↔ CSV, CSV ↔ TSV, or JSON ↔ YAML ↔ TOML.
- Choose the direction and paste your input.
- Check any warnings (unclosed quote, ragged rows, unsupported YAML syntax), then copy the result.
Frequently asked questions
Why does my CSV look garbled in Excel?
The file is UTF-8 without a BOM, so Excel read it with the Windows legacy code page. From this tool, use the .csv (UTF-8 BOM, for Excel) download. For an existing file, save it as UTF-8 with BOM, or import via Data → From Text/CSV and choose 65001 (UTF-8).
Where did the leading zeros in my ZIP codes go?
Usually Excel removed them when opening the file. This tool keeps leading-zero numbers as strings. In Excel, import the column as Text.
Can nested JSON become CSV?
Objects flatten into dot-notation columns like addr.city. Arrays stay in one cell as JSON text.
Is yes/no a boolean in YAML?
In YAML 1.1, yes; in 1.2, no. This tool reads YAML the 1.2 way and quotes such strings when writing, so both versions read them as strings.
Does it support semicolon-separated CSV?
Yes. Auto-detect picks semicolon, comma or tab from the header line, or you can choose the delimiter yourself. When writing CSV, pick Semicolon to produce a file that European-locale Excel splits into columns.
Sources
- RFC 4180 — Common Format and MIME Type for CSV Files
- Microsoft Support — Opening CSV UTF-8 files correctly in Excel
- YAML 1.2.2 specification
- YAML 1.1 boolean type
- TOML v1.0.0
Last reviewed: