CSV to JSON Converter

Convert CSV to JSON and back. Handles quoted fields, custom delimiters and type detection.

Convert CSV to JSON or JSON back to CSV in your browser. It handles the details that break naive converters: quoted fields containing commas, embedded line breaks, escaped quotes, semicolon and tab delimiters, and automatic detection of numbers and booleans. Nothing is uploaded, so a customer export or a finance extract stays on your machine.

Direction
CSV input
JSON output

How CSV to JSON Converter works

CSV looks trivial until you meet real data. The format has no official specification beyond RFC 4180, and a field can legally contain the delimiter itself, a line break, or a double quote — as long as the field is quoted and internal quotes are doubled. A converter written with `split(',')` gets all three wrong, which is why a name like "Hopper, Grace" so often ends up splitting into two columns. This tool implements a proper character-by-character parser that tracks quote state, so those cases come through intact.

Delimiters are the next trap. Comma is standard in English-language locales, but Excel in most of Europe writes semicolons, because comma is the decimal separator there. Tab-separated files are common from databases, and pipe-separated files turn up in older enterprise exports. Rather than making you guess, the tool counts candidate delimiters in the first line and picks the most likely one — with a manual override when the guess is wrong.

Type detection is a genuine judgement call. JSON distinguishes the number 42 from the string "42", CSV does not, and which one you want depends on the column. The rule used here is conservative: clean integers and decimals become numbers, `true`/`false` become booleans, empty cells become null, and anything else stays a string. Crucially, values with leading zeros — `007`, postcodes, phone numbers, account IDs — deliberately stay strings, because converting them to numbers destroys the leading zero and silently corrupts the data. That is the single most common way automated CSV imports go wrong.

Going the other way, nested JSON objects are flattened using dot notation (`address.city`), matching the behaviour of our JSON Converter, and the header row is the union of every key seen across all rows, so records with missing fields still line up under the right columns.

How to use CSV to JSON Converter

1

Pick a direction

CSV → JSON to turn a spreadsheet export into structured data, or JSON → CSV to get an API response into Excel or Sheets.

2

Paste or open a file

Paste the rows directly, or open a .csv, .tsv or .json file. The delimiter is detected automatically.

3

Adjust and export

Toggle whether the first row is a header and whether to convert numbers and booleans, then copy or download the result.

Frequently Asked Questions

Does it handle commas inside quoted fields?
+
Yes. The parser tracks quote state character by character, so a field like "Hopper, Grace" stays a single value. Embedded line breaks and doubled quotes ("") are handled the same way.
What delimiters are supported?
+
Comma, semicolon, tab and pipe, with automatic detection based on the first line. You can override the guess manually — useful for European Excel exports, which use semicolons.
Why did my ID "007" stay a string instead of becoming a number?
+
That is deliberate. Converting it would produce 7 and silently destroy the leading zero. Values with leading zeros — IDs, postcodes, phone numbers — are always kept as text.
What if my CSV has no header row?
+
Untick "First row is a header" and columns are named column_1, column_2 and so on, with every row treated as data.
How does JSON to CSV handle nested objects?
+
They are flattened with dot notation, so {"address":{"city":"Pune"}} becomes a column named address.city. Arrays are written as their JSON text inside a single cell.
What happens if rows have different fields?
+
The header is the union of every key found across all records, in first-seen order. Rows missing a field get an empty cell rather than shifting columns out of alignment.
Is my data uploaded?
+
No. Everything is parsed and converted in your browser, so customer exports, finance extracts and anything else confidential never leave your device.
Can I get the result into Excel directly?
+
Yes — download the CSV and open it in Excel or Google Sheets. If you want a real .xlsx file with formatting, use our JSON to Excel tool instead.

Related tools