CSV → JSON
CSV Input
Loading editor…
JSON Output
Loading editor…

CSV to JSON Converter

Paste any CSV data and get a clean JSON array instantly. The first row is treated as the header — each subsequent row becomes a JSON object. Numbers and booleans are detected automatically.

Real-time
JSON output updates as you type or paste.
Dynamic typing
Numbers, booleans, and nulls are converted automatically.
Download
Save the result as a .json file instantly.
Client-side
No data is uploaded. Everything runs in your browser.

How CSV to JSON Conversion Works

CSV is a flat, tabular format — rows and columns with no concept of nesting or types. The first row becomes the keys of each JSON object; every subsequent row becomes one object in the output array.

id,name,active
1,Alice,true
2,Bob,false
[
  { "id": 1, "name": "Alice", "active": true },
  { "id": 2, "name": "Bob",   "active": false }
]

Values are typed automatically — "true"/"false" become booleans, numeric strings become numbers, empty cells become null.

Automatic Type Detection

Dynamic typing converts string values from your CSV into the correct JSON types, so downstream code doesn't need to cast them manually.

CSV valueJSON outputRule
4242Numeric string → number
3.143.14Decimal string → number
true / falsetrue / falseCase-insensitive boolean
null / empty cellnullNull / missing value
"hello""hello"Everything else → string

An API that expects age: 30 will reject age: "30". Without typed output you'd need a post-processing step; with it, the JSON is ready to use directly.

When to Convert CSV to JSON

CSV suits flat, tabular data — spreadsheet exports, database dumps, simple reporting. Every BI tool and spreadsheet application reads it natively.

JSON is the better format when passing data to a REST API or JavaScript frontend, when types (numbers, booleans, nulls) need to be unambiguous, or when records have optional fields. Missing keys in JSON are cleaner than empty CSV columns.

A common workflow: export from a database or Google Sheets as CSV, convert it to JSON here, then feed it into a script or API call without writing a parser.

Common Pitfalls

Field values that contain a comma must be wrapped in double quotes in the CSV — e.g. "Smith, John". RFC 4180 quoting is handled correctly, but malformed source files can produce unexpected splits.

If some rows have more or fewer columns than the header, missing values become null and extra values are discarded. Unexpected nulls in the output usually point to inconsistent column counts in the source.

Column names become JSON keys as-is, including spaces and special characters. "First Name" becomes the key "First Name". If you need clean identifiers for JavaScript access, rename headers to camelCase before converting.

Frequently Asked Questions

Does the CSV need a header row?

Yes — the first row is used as the key names for each JSON object. If your CSV has no header row, the first row of data will be used as keys, which is rarely what you want. Add a header row before converting.

Are numbers and booleans converted automatically?

Yes. Dynamic typing is enabled by default — numeric strings become numbers, 'true'/'false' become booleans, and empty values become null. This means the JSON output is ready to use in APIs or scripts without manual type casting.

What delimiters are supported?

The tool auto-detects the delimiter. Comma (,) is the default, but tab-separated (TSV) and semicolon-delimited files are detected and handled automatically.

How are quoted fields handled?

Standard RFC 4180 quoting is supported. Fields that contain commas, newlines, or double quotes can be wrapped in double quotes. A literal double quote inside a quoted field is represented as two consecutive double quotes ("").

What happens to empty cells?

Empty cells are converted to null in the JSON output. This preserves the distinction between a missing value and an empty string, which matters for most APIs and databases.

Can I convert a CSV exported from Excel or Google Sheets?

Yes. Both Excel (.csv export) and Google Sheets (File → Download → CSV) produce standard comma-separated files that this tool handles correctly, including quoted fields and UTF-8 characters.

Is my CSV data uploaded anywhere?

No. All conversion happens locally in your browser using PapaParse. Your data never leaves your device — this is safe to use with sensitive or confidential CSV files.