Developer Tools
CSV to JSON Converter
Convert CSV or spreadsheet data to a JSON array of objects, with header detection, number/boolean typing and any delimiter.
How to use
- 1Paste CSV (or cells copied from a spreadsheet).
- 2The first row becomes the keys; choose whether to convert numbers and booleans.
Frequently asked questions
Does it handle commas inside values?
Yes. Values in double quotes can contain commas, quotes (written as "") and even line breaks, following RFC 4180.
What if my file has no header row?
Turn off 'First row is header' to get an array of arrays instead of objects.
Which delimiters are supported?
Comma, tab, semicolon and pipe — detected automatically from the first line.
RFC 4180 quoting is where naive CSV parsers break
A surprising number of 'CSV to JSON' scripts are just `line.split(',')`, which breaks the moment a value contains a comma, an embedded line break, or a quote that needs escaping. This tool's parseCsv follows RFC 4180 properly: a value in double quotes can contain commas and newlines, and an embedded double quote is written as two consecutive quotes (`""`) — so `"Doe, J"` correctly becomes the single value `Doe, J` rather than splitting into two columns. If your source data was exported from Excel or Google Sheets, it almost certainly relies on this quoting, which is exactly the case the included example demonstrates.
Type inference is opt-in, and it's all-or-nothing per cell
With 'Convert numbers & booleans' on, each cell is independently run through type inference, so a column can end up with mixed types if the source data is inconsistent (e.g. a mostly-numeric ID column with one blank row). Turn it off when you specifically need every value to stay a string — the common case being IDs or codes that look numeric but should never be treated as a number (a ZIP code '00501', a leading-zero account number), where silent numeric conversion would corrupt the value.
No header row means a different output shape, not an error
Unchecking 'First row is header' doesn't fail or guess a header for you — it switches the output to an array of arrays, with each row becoming a plain JSON array of cell values in order. That's the right shape for truly headerless exports (some legacy systems, some direct database dumps), but it means downstream code needs to access fields by index rather than by name, which is worth deciding on before you wire up a consumer for the JSON.
Worked example: CSV to JSON Converter
Paste `name,age,ok\n"Doe, J",31,true` with the defaults on, and you get a single-object array: `[{ "name": "Doe, J", "age": 31, "ok": true }]` — note the quoted comma inside 'Doe, J' didn't split into two columns, and `31`/`true` became a real number and boolean rather than strings. Turn off 'Convert numbers & booleans' on a semicolon-delimited `a;b\n1;x` and you instead get `[{ "a": "1", "b": "x" }]`, with `1` staying a string.
The separator is guessed from the first line, and 01 stays text
The separator is chosen from the first line only. Comma, tab, semicolon, and pipe are counted, and the one that appears most often wins. If the first line has none of them, a comma is used. A quote that opens and never closes stops with a message about an unclosed quote, and I get no rows. A completely blank line is dropped. First row is header starts on, and an empty box becomes an empty list. Convert numbers and booleans starts on. An empty cell becomes null in that mode. true and false must be lowercase. A number with a leading zero, such as 01, stays text so it is not turned into 1. A short row is filled with an empty cell.
Related tools
- JSON to CSV Converter
Turn a JSON array of objects into CSV for Excel or Google Sheets — nested objects are flattened into dot-notation columns.
- String Escape / Unescape
Escape or unescape strings for JavaScript, JSON, HTML, XML, SQL, CSV and regular expressions — quotes, backslashes and newlines handled.
- Excel Formula Explainer
Paste an Excel or Google Sheets formula and get a plain-English, step-by-step breakdown of every function, reference and operator — including nested IFs, lookups and ranges.
- Web Scraper (No-Code)
Extract data from any web page without coding — tables, links, headings, images, meta tags or anything matching a CSS selector — and export to CSV, Excel or JSON.
- PDF Form Data Extractor (Filled Forms to CSV / Excel)
Drop in a stack of filled PDF forms (applications, surveys, registrations) and get one spreadsheet: one row per PDF, one column per field, as CSV, Excel or JSON.
- Excel / CSV to PDF
Turn .xlsx, .xls or .csv spreadsheets into printable PDF tables — every sheet, with headers repeated on each page.