Skip to content
/>codemaxxed.com

CSV to JSON

Convert CSV or TSV into JSON objects, JSON Lines, keyed objects, column arrays, Markdown tables or SQL INSERT statements, and turn JSON back into CSV. RFC 4180 quoting, delimiter detection, optional type detection, nested keys from dotted headers, a data preview and a per-column summary.

Runs locally. Nothing is uploaded.

CSV

JSON

Output appears here as you type.

Ready

How this converter works

CSV looks trivial until a value contains a comma. The parser follows RFC 4180: fields wrapped in double quotes may contain the delimiter, line breaks and quotes written twice (""). It is lenient where real files are messy — spaces around a quoted field are ignored, a quote in the middle of an unquoted value is literal, and CRLF, LF and old Mac CR line endings all work. Problems are reported with line numbers: unclosed quotes, text after a closing quote, rows with the wrong number of cells, duplicate or missing headers.

The delimiter is detected by checking the first lines for the candidate (comma, tab, semicolon or pipe) that splits every row the same way, so a semicolon file with decimal commas is read correctly. An Excel sep=; first line is honoured, and you can force any delimiter, including multi-character ones.

Objects mode uses the first row as keys; JSON Lines writes one object per line for streaming and bulk loads; Keyed builds a lookup object from one column; Columns gives one array per column for charting. With Nest dotted headers, address.city becomes a nested object and tags.0, tags.1 become an array. Markdown, SQL INSERT and CSV/TSV outputs reuse the same parsed table, and JSON → CSV goes the other way, flattening nested objects into dotted headers.

Values stay strings unless you turn on Detect types. Then numbers, true/false and null become JSON values — but only when that is lossless: 007, +1555 and integers beyond 2^53 stay strings so ZIP codes, phone numbers and long IDs survive. Every conversion also shows a preview of the first rows and a column summary with the detected type, empty count and distinct values.

Frequently asked

Why are numbers coming out as strings?

CSV has no type system — every cell is text, and guessing breaks ZIP codes, phone numbers and IDs. Turn on Detect types to convert numbers, booleans and null; values with leading zeros and integers too large for JavaScript stay strings.

Does it handle Excel exports?

Yes. Quoted fields, escaped quotes, line breaks inside cells, a UTF-8 BOM and the sep= hint line are all handled, and semicolon-delimited exports from European locales are detected automatically.

My file has no header row. What now?

Turn off First row is header and columns are named column_1, column_2 and so on — or use Rows mode for a plain array of arrays.

How do I get nested JSON from a flat CSV?

Name the columns with dots (address.city, address.zip, tags.0) and turn on Nest dotted headers. JSON → CSV does the reverse, so the two round-trip.

Can it convert JSON back to CSV?

Yes — pick JSON → CSV. It accepts an array of objects, a single object, an API response that wraps the array (like {"data": [...]}) or JSON Lines, and quotes fields only where CSV needs it.

Is my data uploaded anywhere?

No. Parsing runs entirely in your browser, so large exports and private data never leave your machine.