CSV to JSON
Convert CSV to JSON objects, arrays, or NDJSON. Turn off type inference to keep ZIP codes and identifiers as strings.
Your text stays in this page. Usage analytics are enabled. Privacy details.
Enter text to get started.
How to use CSV to JSON
- Paste your CSV. Check Delimiter and First row is header; if auto-detection splits columns incorrectly, select the delimiter used by your file.
- Choose Objects, Arrays, or NDJSON under Output shape. Objects and Arrays wrap records in one JSON array; NDJSON writes one record per line. With First row is header off, records are arrays.
- Turn off Infer numbers and booleans to keep ZIP codes, IDs, and exact decimal text as strings. This applies to the whole table, including counts and booleans. Choose Empty cells → null only if the destination expects null values.
- Review the output and any row-length warnings against the source. For very large input, select Run. Then select Copy or Download; conversion cannot restore leading zeros already removed by a spreadsheet.
Input and output examples
Keep ZIP codes as strings by disabling type inference
Input
name,zip
Avery,00123
Morgan,00456Output
[
{
"name": "Avery",
"zip": "00123"
},
{
"name": "Morgan",
"zip": "00456"
}
]Create one JSON object per line with NDJSON
Input
name,score
Avery,18
Morgan,23Output
{"name":"Avery","score":18}
{"name":"Morgan","score":23}Common tasks and settings
Prepare postal data for an import
For a postal directory or customer import, paste the CSV and enable First row is header if the first line contains column names. Choose Objects and turn off Infer numbers and booleans for the whole table: ZIP codes such as 00123, IDs, and large integers stay strings, as do ordinary counts and booleans. Select the delimiter if auto-detection gives unexpected columns. Check records against the source before importing; conversion cannot restore leading zeros a spreadsheet already removed.
Choose how inventory data represents missing values
Before converting an inventory export, check how the receiving application represents an unknown value. With Empty cells → null off, an empty CSV cell becomes an empty string; with it on, the cell becomes null. A short row also needs attention: in object output, missing cells are omitted when this option is off and filled with null when on. Review row-length warnings against the source and confirm whether the destination expects empty strings, nulls, or absent fields.
Create records for an NDJSON script
For a script that reads one record at a time, select NDJSON. Keep First row is header on to produce one object per line, or turn it off for one array per line. Each record is compact regardless of the indentation setting. A newline inside a quoted CSV field becomes an escaped character inside its JSON value, preserving one output line per record. Check that the consuming script expects this shape before copying or downloading the result.
Comparing two CSV exports? Use CSV Diff to match records by ID and inspect changed cells before converting.
Missing leading zeros or changed IDs? Follow the CSV, Excel and JSON troubleshooting guide to check the source and choose the right field types.
How this tool works
Quoted delimiters, multiline fields, doubled quotes, and a UTF-8 BOM are supported. Ragged rows produce warnings; extra columns receive positional names. Numbers outside the safe integer range are kept as strings and flagged. Disable type inference for ZIP codes, other identifiers, or exact decimal text.
Input and output stay in the current page. Refreshing or closing the page clears them. For very large inputs, use Run to start processing; a task that takes too long is stopped so you can change the input.
Frequently asked questions
How do I keep leading zeros in ZIP codes or identifiers?
Turn off Infer numbers and booleans. Values such as 00123 then stay strings instead of becoming the number 123. Empty cells have a separate null option.
Can CSV fields contain commas, quotes, or line breaks?
Yes. Quoted fields can contain delimiters and line breaks, and doubled quotes represent a quote inside a field. You can auto-detect a delimiter or choose one explicitly.
What is the difference between JSON arrays and NDJSON output?
Objects and Arrays output wrap all records in a JSON array. NDJSON writes each record as a separate JSON value on its own line. With First row is header enabled, NDJSON records are objects; without it, records are arrays.