CSV to JSON
Convert CSV or TSV into JSON, handling quoted fields the way a spreadsheet exports them.
Runs entirely in your browser
Loading tool...
How to use
- Paste your CSV, or a TSV copied straight out of a spreadsheet.
- The delimiter is detected from the first line; change it if the guess is wrong.
- Leave the header option on to get objects keyed by column name, or turn it off for arrays.
- Turn on type conversion if you want numbers and true/false instead of strings.
Features
- A real RFC 4180 parser: quoted commas, doubled quotes and newlines inside fields all survive.
- Comma, semicolon, tab and pipe, detected from the first line.
- Rows with the wrong number of fields are reported, not silently padded.
- Optional type conversion that leaves leading zeroes alone, so a postcode stays a postcode.
- Runs in your browser — a customer export never leaves the device.
Frequently asked questions
- Will a comma inside a quoted field break it?
- No. "Smith, John" stays one field. So does a value containing a doubled quote, and one containing a newline. Those three cases are exactly what a split-on-comma converter gets wrong, and it gets them wrong silently.
- Why did my product code 007 stay a string?
- Because turning it into 7 would destroy it. Type conversion only applies to values that are unambiguously numbers; anything with a leading zero, a plus sign or more than one decimal point is left as text. Phone numbers, postcodes and IDs survive.
- What happens to rows with too few fields?
- Missing fields become empty strings and the line is listed as ragged, so you can see it rather than discover it later. Nothing is dropped.
- Can I convert a file exported from Excel?
- Yes. CRLF line endings and semicolon-separated exports from non-English locales are both handled, and a tab-separated paste is detected automatically.
Related tools
Turn a JSON array into a spreadsheet, with columns taken from every record.
Paste from a spreadsheet or a CSV and get a Markdown table whose columns line up — or straighten one that no longer does.
Format or minify a query with a real scanner, so a keyword inside a string or a comment is left exactly as you wrote it.
Format and beautify JSON instantly.
Find JSON syntax errors and see exactly where they are.
Convert XML to JSON with the array question answered out loud rather than guessed at.