CSV ⇄ JSON converter
Convert CSV to JSON and back. Choose the delimiter (comma, tab or semicolon) and whether the first row is a header; commas and line breaks inside quoted fields are read correctly. The parsed table is shown alongside the output.
Input
Tab-separated is what you get pasting straight out of a spreadsheet. Semicolon is what Excel writes in locales that use a comma for the decimal point.
Turn it off to read the CSV as an array of arrays, or to write CSV with no header row — for raw data that never had column names.
Turns "123" into a number, "true" into a boolean and an empty cell into null. Values that would not survive the trip — leading-zero codes, long IDs — are kept as strings.
Output
Related tools
All tools- Word & character countCharacters, words, lines and reading time, counted as you type.
- Full-width / half-width converterConvert Japanese text between full-width and half-width, one character class at a time.
- Line toolsRemove duplicate and blank lines, sort, trim and number a list — in one pass.
- JSON formatter & validatorPretty-print, minify, sort keys — and point at the exact line that broke.
Highlights
- Quoted commas and line breaks are handled
- Splitting on newlines and commas falls apart on a value like "Tokyo, Minato" and on a notes column containing a line break. This walks the input character by character per RFC 4180, so a delimiter or a newline inside quotes stays part of the value. Columns going out of step is usually noticed after the import, which is the expensive time to find out.
- You can see how it was split
- The wrong delimiter still produces perfectly valid JSON — one enormous key per row — and nothing about the output says so. The parsed table is on screen so the split can be checked before the data goes anywhere, and each row carries its number, so a warning about column counts points at a row you can actually find.
- Codes are not turned into numbers
- With typing enabled, leading-zero postcodes and long IDs are left as strings. Anything that would not print back as the same characters is not converted. The test is not the shape of the value but the round trip itself: convert to a number, back to a string, and compare.
How to use it
Choose a direction
The switch at the top selects CSV → JSON or JSON → CSV. "Insert sample" fills in an example containing a quoted comma and a quoted line break if you just want to try it.
Paste, then match the delimiter
Paste the data and set the delimiter (comma, tab or semicolon) and whether the first row is a header. The parsed table updates as you go, so you can confirm the split is right.
Take the result
Copy the output or save it as a file. "Move the result into the input" flips the direction and puts the result back in the box, so you can check that it round-trips.
What makes CSV awkward
- There is barely a specification
- RFC 4180 exists, but it was written to describe what tools already did rather than to standardise them. Delimiters, line endings, quoting and character encoding all vary between programs, so a file described as "a CSV" is not a known format until you have looked inside it. Showing the parsed table is how this page lets you look. Offering three delimiters is the same admission: which one a file uses is not knowable until it has been read.
- The delimiter is often not a comma
- In locales that use a comma for the decimal point, Excel writes semicolon-separated files. Copying cells out of a spreadsheet usually gives you tabs. If everything lands in one column, the delimiter setting is the first thing to check. Tab-separated files (TSV) are the sturdier format of the three, since a tab almost never appears inside a value — worth choosing outright when the file only has to travel inside one team.
- Mojibake in Excel is usually the BOM
- Excel reads UTF-8 CSV without a byte-order mark as if it were in a legacy encoding, which mangles anything non-ASCII. The BOM is a three-byte marker at the start of the file saying "this is UTF-8"; the save option adds it. In the other direction, a BOM shows up as an invisible character on the first header name — this page strips it automatically. It is not required in UTF-8 and is not recommended by the standard, so leave it off unless Excel is going to open the file.
- What JSON can hold and a table cannot
- JSON nests: objects inside objects, arrays of arrays. A cell holds one value. Nested values are written into the cell as JSON text here, and the page says when that has happened. Flattening into a.b.c column names is the other approach, but it cannot always be reversed, so it is not used. If you want a real table, reshape the JSON into a flat form before converting: which fields deserve columns is a decision a person makes better than a guess does.
Questions
- Can it read a CSV with line breaks inside a cell?
- Yes. Inside quotes, a line break is part of the value, and the preview table shows it wrapped inside that cell. An unquoted line break is a row separator, which is what the file itself is saying.
- It says some rows have a different number of columns
- That warning means a row does not match the width of row 1. An unclosed quote, or a delimiter inside an unquoted value, is the usual cause. Look at the preview table to see where the row actually broke. Conversion still runs; missing fields are treated as empty.
- How large a file can it take?
- Tens of thousands of rows are fine. Because it re-parses as you type, past a few megabytes typing starts to feel sluggish. The preview shows the first 20 rows; copy and save always use everything.
- Can it open an .xlsx file?
- No — .xlsx is a compressed format of its own. Save as "CSV UTF-8" from Excel, or select the sheet, copy it, and paste it here as tab-separated.
- Is the data uploaded?
- No. Parsing and conversion happen entirely in the page and are gone when you close the tab, so files that cannot leave the building are fine to use here.