CSV to JSON converter
Convert CSV to JSON or JSON to CSV, with quoted fields handled properly.
Runs in your browser. Your input is not uploaded.
Loading the tool…
What it does
CSV looks simple but has rules (RFC 4180): a field containing the delimiter, a quote or a new line must be wrapped in double quotes, and a quote inside a field is written twice. This converter follows those rules, so "Smith, John" stays one field.
The delimiter is detected from the first lines (comma, semicolon, tab or pipe). JSON output is an array of objects keyed by the header row, or an array of arrays without one.
How to use it
- Paste CSV (or JSON for the reverse direction), or open a file.
- Check the delimiter and whether the first row is a header.
- Tick Detect types to turn numbers and
true/falseinto JSON values, then copy or download.
Example
Input
id,name,city 1,"Smith, John",Sydney
Output
[
{
"id": 1,
"name": "Smith, John",
"city": "Sydney"
}
]Things to watch for
- Leading zeros are kept as text (
0123stays a string) so postcodes and IDs are not damaged. - Excel in many European locales writes semicolon-separated files. The detector handles them, but check the delimiter shown.
- Nested JSON objects are flattened to dotted column names (
address.city). Arrays are written as JSON text in a single cell.
Questions
- Does it handle commas inside quotes?
- Yes. Quoted fields can contain commas, quotes (written as
"") and new lines. - How do I convert JSON to CSV?
- Choose JSON to CSV and paste an array of objects. The columns are the union of all keys, in the order first seen.
- Why are some numbers still strings?
- Detect types is off, or the value has a leading zero or is too large to represent exactly in JavaScript.
- Will Excel open the CSV?
- Yes. If accented characters look wrong in Excel, use Download with BOM so Excel reads it as UTF-8.