How to convert CSV to JSON
- Paste CSV text, or open a .csv or .tsv file exported from Excel, Google Sheets, a database or a CRM.
- Pick the JSON shape. Array of objects suits most APIs and JavaScript code. The result updates as you change options.
- Check the JSON on the right, then download it or copy it to the clipboard.
Which JSON shape should you choose?
The same three-row CSV can become JSON in several ways. This table shows what name,city with the rows Ana,Lisbon and Ben,Leeds turns into.
| Shape | Result | Use it for |
|---|---|---|
| Array of objects | [{"name":"Ana","city":"Lisbon"}, …] | APIs, JavaScript, MongoDB imports, most tools |
| Array of arrays | [["name","city"],["Ana","Lisbon"], …] | Charts and code that read by position |
| Keyed by first column | {"Ana":{"city":"Lisbon"}, …} | Lookups by ID, translation files, config maps |
| Object of columns | {"name":["Ana","Ben"],"city":[…]} | Charting libraries and data frames |
| JSON Lines | {"name":"Ana",…} on each line | BigQuery, Elasticsearch bulk loads, logs, streaming |
How values are typed
CSV has no data types: every cell is text. JSON does, so the converter decides what each cell becomes. With type detection on, cells that are plain numbers become JSON numbers, true and false become booleans, and null becomes null. Everything else stays a string.
A few values look like numbers but are not. Converting 01234 would drop the leading zero of a ZIP or postal code, and converting a 16 to 19 digit order or card-style ID would round it, because JavaScript stores numbers with only about 15 significant digits. Those stay strings. Numbers are written with their original digits, so 1.50 stays 1.50 rather than becoming 1.5. Phone numbers that start with + also stay text.
Nested JSON from flat columns
Spreadsheets are flat, but JSON is often nested. Use dots in the header to describe the structure: address.city creates an address object, and tags.0, tags.1 create a tags array. This is the same naming the JSON to CSV converter uses, so a file can go to a spreadsheet, be edited and come back as the same structure. Trailing empty array cells are dropped, so a record with one tag gets a one-item array. Cells that contain JSON text, such as ["red","blue"], become real arrays.
Common problems
Every value is in one key. The delimiter was not detected. Excel in many European regions saves CSV with semicolons; choose Semicolon. Strange characters such as é. The file is not UTF-8. Open it in the CSV viewer, which can read Windows-1252 and other encodings, and export it from there. Rows have different lengths. The status line counts them, and missing fields are treated as empty. To check the finished JSON or reformat it, paste it into the JSON formatter.
Frequently asked questions
How do I convert a CSV file to JSON?
Paste the CSV or open a .csv file. The first row is used as the keys, and each following row becomes one JSON object. The result updates as you change the options. Copy it or download a .json file.
Are numbers and true/false values converted?
With “Detect numbers, booleans and null” on, 42 becomes the number 42, true becomes a boolean and null becomes null. Values that would lose information stay as text: a ZIP code such as 01234 keeps its leading zero, and IDs longer than 15 digits stay as strings so they are not rounded. Turn the option off to keep every value as a string.
Can I create nested JSON from a CSV?
Yes. Column names with dots are turned into nested objects, so address.city and address.country become an address object. Numbered columns such as tags.0 and tags.1 become an array. Turn off “Nest dotted column names” to keep the names as flat keys.
Which delimiters are supported?
Comma, semicolon, tab and pipe are detected automatically, and you can choose one if detection guesses wrong. Quoted fields with commas, quotes and line breaks inside them are read correctly.
What is JSON Lines (NDJSON)?
JSON Lines puts one complete JSON object on each line, with no surrounding array. It is used for log files, BigQuery and other bulk imports, and for streaming large datasets, because each line can be read on its own.
Is my CSV uploaded?
No. The conversion runs in a background worker in this browser tab. Your data is not sent to SuperUtils or saved.