CSV to JSON Converter
Convert CSV, semicolon or tab separated data into JSON, correctly handling quoted fields, commas inside values and typed output.
Convert CSV or tab separated data into JSON, handling quoted fields and commas inside values.
Parsed table
2 rows, 4 columns
| name | role | years | remote |
|---|---|---|---|
| Ada Lovelace | Engineer | 7 | true |
| Hopper, Grace | Admiral | 12 | false |
[
{
"name": "Ada Lovelace",
"role": "Engineer",
"years": 7,
"remote": true
},
{
"name": "Hopper, Grace",
"role": "Admiral",
"years": 12,
"remote": false
}
]About the csv to json converter
Splitting a CSV on commas works right up until a value contains one. Real CSV wraps such values in double quotes and escapes any quote inside them by doubling it, which a naive split gets wrong every time.
This uses a proper field parser, so "Hopper, Grace" stays a single value. It can also cast numbers, booleans and nulls to real JSON types instead of leaving everything as strings.
How to use it
- 1Paste your CSV.
- 2Pick the delimiter your file uses.
- 3Say whether the first row holds column names.
- 4Choose an array of objects or an array of arrays.
- 5Turn on type conversion if you want numbers as numbers.
- 6Check the parsed table, then copy the JSON.
Questions
Does it handle commas inside a value?
Yes, as long as the value is wrapped in double quotes, which is what the CSV format requires. Doubled quotes inside a quoted value are handled too.
What if there is no header row?
Turn off the header option and columns are named column1, column2 and so on.
Should I turn on type conversion?
It is useful for real data. Be careful with values like postcodes or IDs that look numeric but must keep leading zeros, since converting them to numbers loses those.
Is my file uploaded?
No. Parsing happens in your browser, so you can convert data containing real records safely.