📊 CSV ↔ JSON Converter

Convert CSV to JSON and JSON to CSV instantly. Supports headers, custom delimiters, and nested JSON flattening. Free online CSV ↔ JSON converter — no signup needed.

How to Use

1

Choose direction

Select CSV → JSON to convert a spreadsheet to data, or JSON → CSV to export JSON as a table.

2

Paste your data

Paste CSV (with header row) or valid JSON array into the input area. The table preview updates live.

3

Copy or download

Click Copy or Download to save the output. Use the table preview to verify your data looks correct.

Frequently Asked Questions

How does CSV to JSON conversion work? +
The first row of the CSV becomes the keys of each JSON object. Each subsequent row becomes one object in the JSON array. Values are trimmed of whitespace. Numbers and booleans are kept as strings unless you enable type inference.
How are commas inside values handled? +
Values containing commas must be enclosed in double quotes in CSV format: "New York, NY". This tool correctly parses quoted fields including escaped double quotes (two consecutive double quotes represent one literal quote).
Can I convert nested JSON to CSV? +
JSON→CSV works with flat arrays of objects. Nested objects are serialized as JSON strings within their cell. For deeply nested structures, flatten your JSON first using the JSON Formatter tool.
What does the table preview show? +
After conversion, a table preview renders the data as an HTML table so you can visually inspect rows and columns before downloading. This helps catch misaligned columns or parsing errors.
Is there a file size limit? +
There is no hard limit, but processing very large files (over 5MB) in the browser may be slow. Everything runs client-side — your data never leaves your device.


Complete Guide: CSV to JSON Converter

CSV (Comma-Separated Values) and JSON (JavaScript Object Notation) are two of the most common data interchange formats. CSV is the lingua franca of spreadsheets — exported by Excel, Google Sheets, and virtually every database tool. JSON is the native format for web APIs and JavaScript applications. Converting between them is a daily task for developers, data analysts, and anyone building data pipelines.

The RFC 4180 CSV Specification

Despite its name and simplicity, CSV has surprising edge cases defined by RFC 4180:

name,age,city
"Smith, John",42,"New York"
"O'Brien, ""Mike""",35,London

Header Row Handling

When a header row is present, converters produce an array of objects, where each row becomes an object keyed by column names:

[
  { "name": "Smith, John", "age": "42", "city": "New York" },
  { "name": "O'Brien, \"Mike\"", "age": "35", "city": "London" }
]

Without headers, or when using the column-array format, the output is an array of arrays:

[["Smith, John", "42", "New York"], ["O'Brien, \"Mike\"", "35", "London"]]

The BOM Character and Excel UTF-8 Issues

Microsoft Excel adds a UTF-8 BOM (Byte Order Mark, EF BB BF in hex, \uFEFF in Unicode) to the beginning of CSV files exported as "CSV UTF-8." This causes the first column header to appear as name instead of name in parsers that don't strip it. Always check for and remove the BOM before processing Excel-sourced CSV files.

Output Format Options

Two primary JSON output structures are useful in different contexts:

/* Column arrays format */
{
  "name": ["Smith, John", "O'Brien"],
  "age": ["42", "35"],
  "city": ["New York", "London"]
}

Handling Nulls and Empty Cells

CSV has no native null type. Conventions vary: empty string, the literal text NULL, N/A, or - are all used. During conversion, decide whether empty CSV fields become JSON null, an empty string "", or are omitted entirely from the object. Be consistent — mixed null conventions break downstream type checking.

Streaming Large Files

For files exceeding a few hundred megabytes, browser-based conversion is impractical. Use a streaming approach in Node.js:

const { parse } = require('csv-parse');
const fs = require('fs');

fs.createReadStream('large.csv')
  .pipe(parse({ columns: true, bom: true }))
  .on('data', (row) => console.log(JSON.stringify(row)))
  .on('end', () => console.log('Done'));

Python's pandas is another popular alternative: df = pd.read_csv('file.csv'); df.to_json('out.json', orient='records').

🧰 50+ Tools