Open or paste a CSV file and the JSON appears next to the options as you change them. By default each row becomes an object keyed by the column names; choose an array of arrays, an object of column arrays or JSON Lines when the receiving code expects that shape. Every value stays a string by default, so 00731 and 20-digit IDs come out exactly as they were; turn on number detection only when a column should become JSON numbers and true/false. For configuration files, CSV to YAML writes the same rows as YAML. The file is converted in your browser and never uploaded.
How to convert CSV to JSON
- Open a
.csv,.tsvor.txtfile, drop it on the tool, or paste rows. The delimiter and a UTF-8 or UTF-16 byte-order mark are detected; pick another delimiter or a legacy encoding such as Windows-1252 or Shift_JIS under Import settings. - Choose the JSON shape. The preview shows the first 200 rows of the exact output the download will contain.
- Set Value types, Empty cells, nesting and indentation, then select Download JSON or Copy.
To convert many files with the same settings, choose Batch and select them together: each file is converted in turn and the results download as one ZIP.
JSON output options: objects, arrays or JSON Lines
| Array of objects | One object per row, keyed by the header: [{"sku": "00731", …}]. The shape most APIs and JavaScript code expect. |
|---|---|
| Array of arrays | The header row first, then each row as a list. Smallest output; column order is kept explicitly. |
| Object of column arrays | {"sku": ["00731", "00732"], …} — convenient for charting libraries and data-frame tools. |
| JSON Lines | One JSON object per line (JSON Lines), with no surrounding array. Suits log pipelines, BigQuery loads and line-by-line processing. |
| Keep every value as text | Every cell becomes a JSON string, exactly as written in the file. This is the default. |
| Detect numbers and true/false | A column becomes JSON numbers only if every non-empty value is a plain number that survives the conversion: no leading zeros, at most 15 significant digits, no decimal comma. true/false columns become booleans. Dates stay strings. |
| Empty cells | Write "", null, or leave the key out of that object. |
| Nest dotted column names | user.name and user.email become {"user": {"name": …, "email": …}}. If a name is both a value and a parent (user and user.name), those columns stay flat and the tool tells you. |
Headers, quoted values and IDs in the JSON
- Quoted commas, quotes (
"") and line breaks inside a value are read per RFC 4180 and written as ordinary JSON string escapes (\n,\"). - Header names are used exactly as written, including spaces and non-Latin scripts. A blank header becomes
Column 3; a repeated one becomesname (2), so no value is overwritten. - Headers such as
__proto__orconstructorare written as ordinary keys. - A row with more values than the header gets extra keys named
Column 4,Column 5…; a shorter row gets empty values. Nothing is dropped. - Typed output never turns
0012into12or a 19-digit order number into a rounded float: such a column stays text.
Common CSV to JSON problems
- Everything is in one key. The delimiter was guessed wrong; set Comma, Semicolon, Tab or Pipe under Import settings and open the file again.
- Accented letters look like é. The file is not UTF-8. Choose its encoding (often Windows-1252 for older Excel exports) under Import settings.
- A number column stayed text. At least one value isn’t a plain number — for example
1,5,12 kgor a value with a leading zero. Search the column in the CSV viewer to find it. - The quoting error names a record. A quote opened in that record never closes. Fix it in the CSV editor or check the source system’s export.
Limits and privacy
Files up to 25 MB, 100,000 rows or 2 million cells open with a live preview. Larger files are converted in streaming mode: the file is read twice in chunks (once to learn the columns and types, once to write), the preview is replaced by a notice, and the download covers every row. A single output file is capped at 4 GB.
Conversion runs in a background worker in this tab, so the page stays responsive and Cancel stops it. The CSV is never sent to a server.
Example: a product list as JSON objects
A product list with a leading-zero SKU and a quoted comma, converted with the default settings (all text, array of objects, 2-space indent). With Detect numbers and true/false, price becomes 34.9 and in_stock becomes true, while sku stays "00731".
sku,name,price,in_stock 00731,"Desk lamp, brass",34.90,true 00732,Cable tidy,4.50,false
[
{
"sku": "00731",
"name": "Desk lamp, brass",
"price": "34.90",
"in_stock": "true"
},
{
"sku": "00732",
"name": "Cable tidy",
"price": "4.50",
"in_stock": "false"
}
]Questions and answers
Why are numbers in quotes by default?
Because CSV has no types: 00731, 1.50 and 2024-03-01 are all just text. Keeping them as strings guarantees the JSON says exactly what the file said. Choose number detection when you know a column holds quantities.
Can I convert JSON back to CSV here?
Not yet. This page converts CSV and TSV into JSON only.
Is JSON Lines the same as NDJSON?
Yes, in practice: both mean one complete JSON value per line, separated by newline characters.