CSV to JSON Converter
Convert CSV files into clean JSON arrays — free, private and running entirely in your browser
CSV to JSON turns a delimited paste or a .csv / .tsv / .txt file into a JSON array of objects, or into NDJSON (one object per line). Header row and Infer types start on. Comma is the default delimiter; Semicolon, Tab, Pipe, and a one-character Custom option sit on the toolbar. Files are read with text() in this tab — nothing is uploaded.
Last updated: 15 October 2026
Guide, examples, and FAQ
About CSV to JSON
What it does
Quoted fields, doubled quotes, and newlines inside quotes are respected. With Header row on, the first line becomes keys; duplicates become name_2, name_3, …. Infer types maps true / false / null and plain numbers to JSON types, while leading-zero or 15+-digit values stay text. Array downloads data.json; NDJSON downloads data.ndjson.
Who it is for
For seeding fixtures from a spreadsheet export, wiring a CSV report into an API body, or producing line-delimited JSON for a streaming importer.
When to use it
Use it when the source is already text-delimited. An .xlsx file is not opened here — export CSV first.
Key features
Delimiter presets
Comma, Semicolon, Tab, Pipe, or Custom (exactly one character). A .tsv open switches the preset to Tab.
Header row
On (default), row one is keys. Off, keys are col1, col2, …. Empty headers become column, then column_2.
Infer types
On by default. true / false / null and plain decimals become JSON types; 007-style or very long digit strings stay text. Off keeps every cell as a string.
Array or NDJSON
Array is a pretty-printed JSON array. NDJSON is one stringify(row) per line with no outer brackets.
How to use CSV to JSON
- 1Paste CSV, drop a .csv / .tsv / .txt file, or use Open file. Other extensions are rejected.
- 2Pick Comma, Semicolon, Tab, Pipe, or a one-character Custom delimiter. Leave Header row on unless there is no header.
- 3Leave Infer types on for numbers and booleans, or switch it off when IDs and codes must stay strings.
- 4Choose Array for a JSON array, or NDJSON for one object per line.
- 5Copy the JSON, or Download data.json / data.ndjson. Status shows the row count and any warnings.
Example
Before
id,name,active 1,Ada,true 2,Grace,false 007,Bond,true
After
[
{ "id": 1, "name": "Ada", "active": true },
{ "id": 2, "name": "Grace", "active": false },
{ "id": "007", "name": "Bond", "active": true }
]With Infer types on, 1 and 2 become numbers and true/false become booleans, while 007 stays "007". NDJSON mode emits three lines instead of one array.
Supported formats
- Input
- .csv, .tsv, or .txt; comma / semicolon / tab / pipe / custom delimiter
- Output
- JSON array (data.json) or NDJSON (data.ndjson)
Common problems and fixes
Delimiter must be one character
Custom is empty or longer than one character. Enter a single separator, or pick a preset.
Unclosed quote near row N
A field started with " and never closed. Fix quotes, or escape inner ones as "".
Duplicate header was renamed
The second column became key_2. Rename headers in the CSV if you need exact keys.
Open a .csv, .tsv, or .txt file
The chooser rejected another extension. Save or export as one of those text types.
Benefits
Leading zeros survive
Infer types will not Number() values like 007 or very long digit strings, so product codes are not shortened.
Quoted commas stay in one field
"Ada, Lovelace" is one value. Doubled quotes inside quotes become a single quote character.
Common use cases
API fixture from Sheets
Export a sheet as CSV, leave Header row and Infer types on, then download data.json for a fixture folder.
NDJSON for a line importer
Switch to NDJSON so each row is one JSON object per line for streaming readers.
European semicolon export
Pick Semicolon when Excel writes name;city;score instead of commas.
IDs that must stay text
Turn Infer types off before converting SKUs or padded numeric IDs that must never become numbers.
Tips & best practices
- If columns look shifted, try Semicolon or Tab before editing the file.
- Duplicate headers are renamed automatically; the warning lists keys like name_2.
- Rows with extra cells still convert; extras are dropped and counted in a warning.
Common mistakes to avoid
- Leaving Comma selected on a semicolon export — each line becomes one field.
- Expecting .xlsx to open here. Export CSV first.
- Assuming Infer types always keeps strings — turn it off when every cell must be text.
- Using a multi-character Custom delimiter. Only one character is accepted.
Frequently asked questions
Which delimiters can I use?
Comma, Semicolon, Tab, Pipe, or a Custom single character. Opening a .tsv selects Tab. Custom must be exactly one character.
What does Header row do?
On (default), the first line becomes object keys. Off, keys are col1, col2, … and every line is data. Empty headers become column (then column_2).
How does Infer types work?
When on, true / false / null and plain decimals become JSON types. Leading-zero or 15+-digit values stay strings. Off keeps every cell as a string.
Are quoted fields and commas inside quotes supported?
Yes. Quotes start quoted mode; "" is one quote; newlines inside quotes stay in the field. Unclosed quotes warn with a row number.
Is there a row or file-size limit?
No fixed row cap. Very large pastes are limited by browser memory. Nothing is uploaded.
What encoding is used when I open a file?
Open file and drag-and-drop use the browser text() API (typically UTF-8). There is no encoding menu — re-save as UTF-8 if characters look wrong.
What is the difference between Array and NDJSON?
Array is one pretty-printed JSON array (data.json). NDJSON is one object per line with no wrapping array (data.ndjson).
Why did 007 stay a string while 7 became a number?
Infer types keeps leading-zero digit strings as text so codes are not corrupted. Plain 7 becomes a number.
When another tool fits better
- CSV Viewer. Sort, filter, or inspect the table before converting. It does not replace this page’s NDJSON or Infer types controls.
- JSON Formatter. Validate, minify, or tree-browse the result. Come back here if the source is still CSV.
- JSON to Markdown. You already have an array of objects and need a Markdown table — not a CSV conversion step.
Conclusion
Match the delimiter to the export, decide on headers and type inference, then copy Array JSON or NDJSON. Conversion stays in this browser.
Ready to try CSV to JSON?
Scroll back up to start now, or continue with another free developer tool.