CSV to JSON
Drop a CSV, get a JSON array of objects keyed by the header row. No type guessing, so 007 stays "007" and nothing gets rounded.
How it works
- Drop your file in the box above, or click it to pick one.
- Pick the output format and press Convert.
- Download the result. Nothing was uploaded on the way.
Is it safe?
Exports from a CRM or a shop backend are full of names and e-mail addresses. The CSV is parsed by your browser and the JSON is written right here, with no upload in between.
Want to check? Open your browser DevTools, switch to the Network tab and convert a file. Or convert a small file once, because each converter downloads its code the first time, then go offline and convert your real file.
Output, by example
This CSV:
id,name,active
007,"Bond, James",true
becomes:
[{ "id": "007", "name": "Bond, James", "active": "true" }]
Every value is a string, on purpose. CSV doesn't say what's a number, and guessing breaks things: ZIP codes lose their zeros, long IDs get rounded, "1e5" turns into 100000. You know your columns; cast them in your own code where it matters.
With "First row holds the column names" switched off, you get an array of arrays instead, header row included.
What the parser handles
- Delimiters: comma, semicolon, tab or pipe, detected from the first line.
- Quoted fields, doubled quotes inside them, and line breaks inside quotes (RFC 4180).
- Encodings: UTF-8 with or without a byte order mark, UTF-16 with one. Files that aren't valid UTF-8 are read as Windows-1252, the usual suspect for old Excel exports.
- Ragged rows: missing fields become empty strings, extra fields get keys like
column_5. - Duplicate or blank headers: a second "email" becomes
email_2, a blank onecolumn_3.
Input up to 50 MB. The JSON is pretty-printed with two spaces.
Need real numbers in the JSON?
Take a detour: convert the CSV with CSV to Excel first, which stores plain numbers as numbers and leaves leading zeros alone, then run the .xlsx through XLSX to JSON. You get numbers and booleans typed, and empty cells as null.
Questions about this format
Why is "42" a string in the JSON and not a number?
Because the converter doesn't guess types. A column of numbers can still hold an ID like 00042 that must stay text, and there's no safe way to tell from the CSV alone. Convert with Number() or your language's equivalent where you need numbers.
Can it output JSON Lines (one object per line)?
No, the output is one JSON array. Most JSON tools, jq included, can turn that into JSON Lines in one command.
Does a semicolon-separated CSV from European Excel work?
Yes. The separator is worked out from the first line, so semicolons are fine. Decimal commas stay inside the string values as they are.
Last updated: