CSV to JSON

Turn a spreadsheet export into a JSON array, one object per row, keyed by the header row.

or drop it here · files stay on your device
We count formats and sizes. Filenames stay private unless you opt in.

Downloads a small public example. Your own files are not used.

Infer numbers and booleans
Pretty-print the output
Processed on this device
  • Runs on your device
  • No sign-up or watermark
  • No fixed file size cap

The short answer

To convert CSV to JSON, choose a .csv file whose first row holds the column names and run the converter. Each later row becomes an object, and numbers and true or false can be turned into real JSON types. Parsing happens in your browser, so the file is never uploaded.

A worked example

See a real input and result

This synthetic sample produced 1 output file from 1 input file. These are synthetic demonstration files, not someone’s documents.

Input sample

Actual output

Input count
1
Output count
1
Rows
3
Columns
3
Input bytes
64
Downloadable output bytes
197

Settings used: types: true · pretty: true

This synthetic sample only; results depend on the input.

Ran through this tool on . Use “Try sample files” above to run it yourself.

How to convert a CSV file to JSON

  1. STEP 1

    Choose the CSV file

    Pick a .csv file with a header row and at least one data row. It is read on your device.

  2. STEP 2

    Choose type handling

    Leave Infer numbers and booleans on for amounts and flags, or turn it off to keep every cell as a string.

  3. STEP 3

    Pick the layout

    Pretty-print the output gives indented, readable JSON; switch it off for a single compact line.

  4. STEP 4

    Copy or download

    The report shows rows and columns. Copy the JSON from the preview or save it as a .json file.

How CSV becomes JSON

A CSV file is rows of comma-separated cells, usually with a header row naming each column. The JSON equivalent is an array of objects: each row becomes {"header": "cell", ...}. Quoted cells may contain commas, doubled quotes and even line breaks, so a proper parser matters more than splitting on commas.

The awkward part is types. CSV has none, so 42 and "42" look the same. Inferring types is convenient for amounts and flags, but it is wrong for codes that only look like numbers: postcodes, phone numbers and IDs with leading zeros.

What survives, and what does not

The parser supports common CSV quoting: quoted fields, "" for a literal quote, and line breaks inside quotes. The first row supplies the keys. With type inference on, a cell that is exactly true or false becomes a boolean, a plain decimal number becomes a number, and an empty cell becomes null. Rows that are entirely empty are skipped.

What you keep

Quoted cells with commas, doubled quotes and line breaks

The header row as object keys, in column order

Numbers and booleans as real JSON types when inference is on

What you lose

Leading zeros when inference is on: 007 becomes 7, so turn it off for postcodes, phone numbers and IDs

Columns with a repeated header name collapse into one key, keeping the last

Cells beyond the header width are dropped

Large integers may lose precision with inference on; turn it off for long IDs as well as values with leading zeros

Only commas are understood as separators; semicolon or tab-separated files will come out as one column

Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.

CSV to JSON at a glance

InputCSV, comma-separated, UTF-8
OutputJSON array of objects
ParsingRFC 4180 quoting, embedded line breaks
Type inferenceOptional: numbers, true/false, empty as null
BatchOne file at a time
Runs onYour device, in the browser

If something goes wrong

Postcodes or phone numbers lost their leading zero

Turn off Infer numbers and booleans. Every cell is then kept as text exactly as written.

Everything ended up in one key

The file is probably separated by semicolons or tabs, common in European Excel exports. Save it again as comma-separated CSV and convert it once more.

Accented letters look wrong

The file is read as UTF-8. Re-export from your spreadsheet as CSV UTF-8 rather than an older Windows encoding.

CSV to JSON questions

How do I convert CSV to JSON with headers as keys?

That is the default. The first row is read as the keys, and every row after it becomes an object using those names.

How do I keep leading zeros when converting CSV to JSON?

Switch off Infer numbers and booleans. With it off, 00123 stays the string "00123" instead of becoming the number 123.

Can I convert an Excel file to JSON?

Export the sheet from Excel as CSV UTF-8 first, then convert that CSV here. This tool reads comma-separated text, not .xlsx.

Does it handle commas inside quoted fields?

Yes. Quoted cells may contain commas, doubled quotes and line breaks, and they come through as single values.

Is my CSV uploaded?

No. Customer lists and exports are parsed in your browser tab and never sent to a server, by the converter.

One of 153 file tools and planned additions. Built and tested by Arin Prajapati, last checked against the code on . canonical: https://damnfiles.com/csv-to-json
Analytics preferences

Help us understand which tools and file types people use. File contents always stay on your device.

Filename sharing is optional and off by default. Names can contain personal information. Changes apply to future events; disabling sharing does not delete earlier records.

Read our privacy policy