Skip to content
ToolBoxGenie

CSV to JSON Converter

Developer Tools · Added 18 August 2026

Paste a CSV export and get JSON, or paste JSON and get a CSV you can open in a spreadsheet. The parser follows RFC 4180 rather than splitting on commas, so quoted fields containing commas, quotes or line breaks survive intact — which is where most online converters mangle an address column.

Direction

Parsed in your browser — the file never leaves your machine.

How to use the csv to json converter

  1. 1Choose the direction: CSV to JSON, or JSON to CSV.
  2. 2Paste your data. The delimiter is detected automatically, or set it yourself.
  3. 3Decide whether the first row is a header and whether numbers and true/false should be converted from text.
  4. 4Press Convert. Warnings appear for ragged rows and duplicate column names.
  5. 5Copy the result, download it as a file, or send it back the other way to check the round trip.

Examples

A CSV with a comma inside a field

Input
id,name,city\n1,Ada,"London, UK"
Result
[{ "id": 1, "name": "Ada", "city": "London, UK" }]

The quoted comma stays part of the value instead of splitting the row.

Nested JSON to CSV

Input
[{ "id": 1, "user": { "name": "Ada", "email": "ada@example.com" } }]
Result
id,user.name,user.email — nested objects become dotted column names

A semicolon-delimited European export

Input
id;name;amount\n1;Ada;1234,50
Result
Semicolon detected automatically; "1234,50" stays a string because the comma is a decimal mark

About the csv to json converter

CSV is not as simple as it looks

The format has no official specification older than RFC 4180 from 2005, and that document describes common practice rather than mandating it. In the wild you will meet comma, semicolon and tab delimiters, three kinds of line ending, optional quoting, doubled quotes inside quoted fields, byte-order marks, and header rows that are sometimes absent.

Splitting a line on commas handles none of that. It works on the sample file and breaks on the real one, usually at the row containing an address or a company name with a comma in it — and it breaks silently, shifting every subsequent column by one.

The conversions that need a decision

CSV has exactly one type: text. JSON has strings, numbers, booleans, null and nested structures. Going from CSV to JSON therefore requires guessing, and every guess has a case where it is wrong. '007' is a number to a naive parser and an agent number to a human; 'TRUE' is a boolean in one column and a string in another.

The rules used here are conservative and stated on the page: a value becomes a number only when it round-trips cleanly, which excludes leading zeros and leading plus signs, and an empty cell becomes null rather than an empty string. Where that is not what you want, the switch to turn it off is right there.

Going back the other way

JSON to CSV is flattening a tree into a rectangle, and something always has to give. Nested objects become dotted columns, which is lossless and readable. Arrays do not, so they are written as JSON text inside a cell — ugly but reversible, which beats a column layout that breaks on the first row with an extra item.

Columns are collected as the union of every row's keys in first-seen order, so a record missing a field still lines up under the right heading instead of shifting everything left. Values are quoted only when they need it: when they contain the delimiter, a quote, a line break, or leading and trailing spaces that a trimming parser would otherwise eat.

Frequently asked questions

Why did my postcode lose its leading zero?
It should not have — that case is handled deliberately. Type conversion only turns a value into a number when it has no leading zero, no leading plus and no surrounding space, precisely because postcodes, phone numbers and product codes look numeric but are identifiers. If you want everything kept as text regardless, turn off 'Convert numbers and true/false'.
What happens if a row has more or fewer fields than the header?
Missing values become null and extra ones are dropped, and the row numbers are reported in a warning rather than silently accepted. A ragged row almost always means an unescaped quote or a stray delimiter earlier in the file, so the warning is usually pointing at a real problem worth fixing at the source.
How are duplicate column names handled?
A JSON object cannot hold the same key twice, so the second and later occurrences are numbered — name, name_2, name_3 — and listed in a warning. Silently overwriting would lose data without telling you, which is the worse failure.
What does flattening do to nested objects?
It turns { user: { name: 'Ada' } } into a column called user.name. Arrays are left whole and written as JSON inside the cell, because spreading them across numbered columns breaks the moment one row has more items than another. Turn flattening off and the whole nested object goes into one cell as JSON.
Which line endings should I choose for Excel?
CRLF. Excel on Windows expects it, and a file with plain LF endings can open with every row in a single cell. Numbers, Google Sheets and everything on macOS or Linux handle either. If the file is going into a script rather than a spreadsheet, LF is the safer default.
Is my data uploaded anywhere?
No. The parsing and serialising both happen in your browser, and the page makes no network request with your content. That is the reason this tool exists in a form you can use on a real customer export rather than a made-up sample.