CSV to JSON
Convert CSV with a header row into a JSON array, choosing comma, semicolon or tab as the separator and turning numbers into real numbers.
About CSV to JSON
CSV to JSON turns a spreadsheet export into a JSON array of objects, the shape most APIs, scripts and web apps expect. The first row becomes the keys and every other row becomes an object.
Choose the separator
Comma, semicolon or tab. Many European exports use semicolons because the comma is their decimal mark.
Numbers and true/false
Tick the option to turn 42 into a number and true into a boolean, which APIs and databases usually want. Leave it off for postcodes, phone numbers and IDs with leading zeros, so they stay exactly as written.
Before you convert
Give every column a unique, simple name, because those names become the keys. Remove empty rows at the end of the file.
Quotes and commas inside values
Values that contain the separator, a quote or a line break must be wrapped in double quotes. Spreadsheet programs do this when they export.
Copy or download
Copy the JSON or download it as a file.
Private
The conversion runs in your browser. Your data is not uploaded.
How to use CSV to JSON
- Paste your CSV, including the header row.
- Choose the separator.
- Tick the option to convert numbers and true/false values if you want typed values.
- Copy the JSON or download it.
- Look at the first object in the result to confirm the keys and the number types are what you expect.
Help & FAQ
Does the first row have to be a header?
Yes. The first row supplies the property names for every object in the array.
Why are our numbers in quotes?
Without "Convert numbers and true/false", every value stays a string. Tick the option to get real numbers and booleans.
Our file uses semicolons. What should we do?
Choose Semicolon as the separator. Many European spreadsheet exports use it because commas are decimal marks.
What if a value contains a comma?
In a correct CSV file such a value is wrapped in double quotes, and the tool keeps it as one value.
Does it handle large files?
Very large files depend on your device's memory. Split a huge file first if the page becomes slow.
Can we convert JSON back to CSV?
Yes. Use the JSON to CSV tool for that.
How do we keep leading zeros?
Turn off number conversion so values stay as text.
Can we convert a CSV without a header row?
The tool uses the first row as keys, so add a header row first.
Why are some of our numbers still strings?
The option 'Convert numbers and true/false' is off, or the value is not a clean number, for example it has a currency symbol or a thousands separator.
How do we keep postcodes and IDs exactly as written?
Leave number conversion off. Every value stays text, so 00123 and +44 numbers are not changed.
What if two columns have the same header?
Keys in an object must be unique, so the later column would overwrite the earlier one. Rename the headers before converting.
Can we convert a tab-separated file?
Yes. Choose Tab as the separator and paste the text copied from a spreadsheet.