CSV to JSON converter — and JSON back to CSV, from text or a file

Paste CSV or drop a CSV, TSV or Excel file to get a JSON array with one object per row, where numbers and true/false are detected without damaging ZIP codes or long IDs. Switch direction to turn JSON back into CSV.

Live demo · real result from this tool

Drop your file here

or paste with Ctrl+V · nothing is uploaded

Or paste CSV / TSV in the box below. Excel files (.xlsx) use their first sheet.

Convert
Leading-zero values (02134) and integers beyond 2⁵³ stay as text.

Loading the tool…

Processed on your device — nothing is uploaded.

How to use the CSV to JSON converter

  1. Choose the direction under Convert: CSV → JSON (default) or JSON → CSV.
  2. Paste into Input (CSV or JSON), or drop a file above it: CSV, TSV, TXT, XLSX, XLS or ODS, and also JSON for the reverse direction.
  3. Leave Delimiter on Detect automatically, or pick comma, semicolon, tab or pipe. Keep First row is a header ticked if row 1 holds column names.
  4. For CSV → JSON, set Detect numbers and true/false, Empty cells become null (otherwise empty strings) and JSON indentation. For JSON → CSV, choose Flatten nested objects to dot.paths.
  5. Copy or download the result. A table preview of up to 1,000 rows appears below it.

What it does and when to use it

Use CSV → JSON to feed a spreadsheet export into an API, a test fixture or a database import. With a header row you get objects keyed by column name; without one, an array of arrays. JSON → CSV makes API results easy to open in a spreadsheet.

Related tools: JSON to CSV, CSV to Markdown table for docs, and the CSV cleaner to fix messy data first.

How it works

Everything runs in your browser. Text is parsed with papaparse, which handles quoted fields and line breaks inside quotes. Dropped spreadsheets are read with SheetJS, and a CSV that is not valid UTF-8 is read as Windows-1252, with a note. Files over 4 MB are processed in a background worker so the page stays responsive.

A cell becomes a number only if it is a plain integer, decimal or exponent number such as 1.5e3: no leading zeros, no thousands commas, and either a safe JavaScript integer or a decimal with at most 15 significant digits. Exactly true or false become booleans. Everything else stays text, and parser problems such as an unclosed quote are listed with their row.

Worked examples

These are the tool’s own outputs.

The sample. Three US cities give objects like this one, where the empty notes cell is null:

    "zip": "02134",
    "city": "Boston",
    "population": 675647,
    "active": true,
    "notes": null

The next row has "zip": 94105, a number.

Semicolons and a decimal comma, minified. sku;qty;price data gives [{"sku":"A-01","qty":3,"price":"4,50"},{"sku":"B-02","qty":12,"price":19.99}].

A repeated header and a huge number. name,name,score with Asha,Rao,9007199254740993 gives "name_2":"Rao", and the score, beyond 2⁵³, stays a string.

JSON → CSV with flattening. An object with a nested user (a name and a tags array) and one with an extra key become:

id,user.name,user.tags,extra
1,Ann,"[""a"",""b""]",
2,,,true

Limits and tips

  • Only the first sheet of a workbook is read.
  • Dates stay text, exactly as written or displayed.

Frequently asked questions

Why did 02134 stay a string while 94105 became a number?
Each cell is judged on its own. A leading zero would be lost in a JSON number, so 02134 stays text; 94105 has none, so it converts. For ZIP codes, phone numbers and IDs, untick Detect numbers and true/false so the whole column stays text.
Can I upload an Excel file?
Yes. Drop or choose an .xlsx, .xls or .ods file and the first sheet is read, with cells as Excel displays them. A note tells you when the workbook has more sheets. The file is read on your device and never uploaded.
How does JSON to CSV handle nested data?
With Flatten nested objects to dot.paths ticked, a user object holding a name becomes a user.name column. Arrays are written as JSON text in one cell, and every key found in any object gets a column.
My European CSV with decimal commas shows 4,50 as text. Why?
Only numbers written with a dot convert, because 4,50 is ambiguous. Detect finds the semicolon delimiter, but decimal commas stay text.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close