Converting a CSV export to JSON, step by step
- Paste your data into the CSV to convert box. To use a file instead, click "Load from file" or drag the file onto the box. The file is read as UTF-8 text in your browser, up to 2 MB.
- Under Delimiter, pick the character that separates your columns. Choose "Comma ( , )" for most exports and "Semicolon ( ; )" for files saved by Excel in locales that use a decimal comma. Choose "Tab" for TSV files or for cells copied straight from a spreadsheet.
- Keep First row is header on if the top line holds column names. Turn it off when the file has no header and you want plain arrays.
- Leave Pretty-print on to get JSON indented by two spaces. Turn it off to get the whole array on one line, ready to paste into a request body or an environment variable.
- Check the Table preview and the Rows and Columns counters before you copy anything. The preview shows the first 20 rows. If Columns says 1 when you expected more, the delimiter is wrong.
- Click Copy result to put the JSON on your clipboard, or "Download result" to save it as a file. The output updates as you type and whenever you change an option.
Examples of CSV input and the JSON you get
A comma-separated file with a header row and Pretty-print on:
name,age
John,30
Jane,25
[
{
"name": "John",
"age": "30"
},
{
"name": "Jane",
"age": "25"
}
]
A quoted field that contains a comma and a line break, with compact output:
name,note
"Doe, John","line1
line2"
[{"name":"Doe, John","note":"line1\nline2"}]
The line break inside the quotes stays in the value as \n, and the comma does not start a new column. A doubled quote becomes one literal quote, so "12"" pipe" turns into 12" pipe.
The same three lines give a different shape depending on the header option (Pretty-print off):
| First row is header | CSV input | JSON output |
|---|---|---|
| off | a,b / 1,2 / 3,4 |
[["a","b"],["1","2"],["3","4"]] |
| on | a,b / 1,2 / 3,4 |
[{"a":"1","b":"2"},{"a":"3","b":"4"}] |
With the header on, values that look like numbers or booleans are kept exactly as typed:
id,qty,active
1,007,true
2,,false
[{"id":"1","qty":"007","active":"true"},{"id":"2","qty":"","active":"false"}]
007 keeps its leading zeros, true stays the string "true", and an empty cell becomes "" rather than null. If your code needs real numbers, cast them after parsing, for example with Number(row.qty).
When a CSV-to-JSON conversion is useful
- Test fixtures and mock APIs: export a few rows from a database client or a spreadsheet, convert them, and paste the array into a fixture file or a mock server response.
- Seeding front-end config: a product list kept in a spreadsheet (SKU, name, price) can become a JSON file for a static site generator or a JavaScript app without writing a parser.
- Checking what an import will see: the preview and counters show how quoting and delimiters are read. That helps when a CSV import elsewhere fails and you need to know whether the file or the importer is at fault.
- Moving data between tools: many no-code platforms, HTTP clients and NoSQL databases accept JSON arrays but not CSV.
To inspect or reindent a large result, paste it into the JSON Formatter.
Limits and edge cases to know before you convert
The output is always a flat array. A header such as user.name becomes a literal key, {"user.name":"Anna"}, not a nested user object.
With the header option off, every row keeps its own length, so the arrays can differ in size: a,b / 1 / 2,3,4 gives [["a","b"],["1"],["2","3","4"]].
If the chosen delimiter doesn't occur in the file, each line becomes a single field. A comma file read with the semicolon setting gives keys like "a,b". Switch the delimiter and the result updates straight away.
If a quoted field is never closed, the tool shows an error instead of guessing where the field ends: "Invalid CSV — a quoted field is never closed. Unclosed quote opens on line 2." The line number points at the stray quote, so you know which line to fix. Windows (CRLF) and Unix line endings are both accepted.
Text pasted beyond 1,000,000 characters is cut off. For larger data, use "Load from file", which accepts files up to 2 MB.