csv→json

CSV to JSON

Paste rows or drop a file, and get JSON objects, arrays, or JSONL.

By opening this website or using its tools, you agree to our Terms and Privacy Policy.

paste rows, or drop a .csv file

Number conversion leaves anything with a leading zero, and anything longer than 15 digits, as a string — zip codes, phone numbers, and account numbers survive a round trip rather than being silently reformatted. Duplicate and blank column names are given distinct keys, since a JSON object cannot hold two fields of the same name.

Network activity during processing
0 bytes uploaded

Your file never leaves your browser during processing

How it works

To convert CSV to JSON, paste your rows into this page or drop a .csv file in — the first row becomes the object keys, each following row becomes an object, and the JSON appears immediately without anything being uploaded.

The conversion runs as you type. Rows are parsed with a full RFC 4180 reader, so quoted fields containing commas, escaped double quotes, and line breaks inside a cell all come through intact rather than splitting the row — the failure that catches out anything doing this with a split on commas.

Three output shapes are offered because they answer different needs. An array of objects is what an API or a JavaScript program usually wants. An array of arrays keeps the raw grid, header row and all, which is right when the column names are not valid keys or when position matters more than naming. JSONL — one object per line — is what log pipelines, BigQuery, and bulk database loaders read, and it is not valid JSON as a whole document, which is why it is a separate choice rather than a formatting option.

Type conversion is on by default and is deliberately conservative. A field reading 12 becomes the number 12 and true becomes a boolean, but anything with a leading zero stays a string, so zip codes and phone numbers are not quietly renumbered. So does anything longer than fifteen digits, past which a JavaScript number loses precision and would come back altered. Empty fields become null rather than empty strings, since that is what "no value" means in JSON.

Column names get the same care: blank headers become column1, column2, and duplicates are suffixed, because a JSON object cannot hold two fields of the same name and the second would silently overwrite the first. If a file arrives with an encoding other than UTF-8, which CSVs exported from Excel frequently do, it is detected on load and the encoding used is named under the output.

FAQ

How do I convert a CSV with a header row to JSON objects?

Leave “First row is a header” ticked, which is the default. Each remaining row becomes an object whose keys are the header names.

Why is my zip code a string instead of a number?

Because 01234 is not the number 1234. Any value with a leading zero, and anything over fifteen digits, is kept as a string so the round trip does not change it. Untick type conversion to keep every field as a string.

What is JSONL and when do I want it?

One JSON object per line, with no wrapping array. It is what streaming and bulk-import tools read — BigQuery, Elasticsearch, and most log pipelines — because each line can be handled without parsing the whole file.

Does it handle commas and line breaks inside quoted fields?

Yes. Quoted fields are parsed properly, including doubled quotes as an escape and newlines inside a cell.

Is there a file size limit?

None imposed by us, since nothing is uploaded. Your device’s memory is the practical ceiling, and very large files will make the live preview feel slow because it re-converts as you change settings.

Related tools