CSV to JSON Converter
With a header row, the CSV text "name,age" then "Ada,36" becomes [{"name":"Ada","age":36}]. Each row turns into an object keyed by the header names. The tool also converts JSON back to CSV.
How to use
- Pick CSV to JSON or JSON to CSV, then paste your data into the input box. An example is loaded to show the format.
- Choose the delimiter that your file uses: comma, semicolon, tab or pipe. Many European exports use a semicolon.
- For CSV to JSON, leave First row is header on to get a list of objects, or turn it off to get a list of arrays. Tick Convert numbers and true/false to write 36 as a number instead of "36".
- Copy the result. If the input cannot be parsed, the message says what is wrong and where.
How it works
The CSV reader follows RFC 4180. A field wrapped in double quotes may contain commas and line breaks, and a double quote inside it is written as two double quotes. Rows can end with LF, CRLF or CR, a leading byte order mark is ignored, and blank lines are skipped.
With a header row, the first row gives the keys. Empty headers become column_N and repeated headers get a numeric suffix (name, name_2), so no value is overwritten. If a row is shorter than the header, missing cells become empty strings. If a row is longer, the extra cells are added under column_N keys. The status line counts such rows.
Type conversion is optional and conservative. Only plain numbers (42, -3.5, 1e3) and the words true and false are converted. Values with leading zeros such as 02134, signs such as +5, and integers too large to be exact stay as text.
JSON to CSV accepts an array of objects, an array of arrays, an array of plain values or a single object. For objects, the columns are the union of all keys in the order they first appear. Missing keys become empty cells, null becomes an empty cell, and nested objects and arrays are written as JSON text inside the cell. A cell is quoted only when it contains the delimiter, a double quote or a line break.
How a CSV maps to JSON
| CSV cell | Text mode | Convert types on |
|---|---|---|
| 36 | "36" | 36 |
| -3.5 | "-3.5" | -3.5 |
| true | "true" | true |
| 02134 | "02134" | "02134" |
| "" | "" | |
| "a,b" | "a,b" | "a,b" |
FAQ
Why do my numbers appear as strings in the JSON?
CSV has no types, so every cell is text. Tick Convert numbers and true/false to turn plain numbers and booleans into JSON numbers and booleans. Leading-zero values such as zip codes are deliberately kept as text.
Can a cell contain a comma or a line break?
Yes, as long as the cell is wrapped in double quotes, for example "Smith, John". Quotes inside a cell are doubled: "He said ""hi""". The tool reads and writes both.
My file uses semicolons or tabs. What should I do?
Choose the matching delimiter from the list. Spreadsheet exports in many European locales use semicolons because the comma is the decimal mark there. A tab-separated file is often called TSV.
What JSON can be converted to CSV?
A list of objects works best, such as [{"a":1},{"a":2}]. A list of lists and a list of plain values also work. Nested objects are kept as JSON text in one cell, because CSV is flat.
Does the output use CRLF line endings?
The output uses a plain line feed, which every spreadsheet and editor opens correctly. The reader accepts LF, CRLF and CR.
Is my data uploaded?
No. The conversion runs entirely in your browser, so private spreadsheets stay on your device.