About the CSV to JSON Converter
This CSV to JSON converter reads a delimited table and returns a JSON array you can drop straight into code, a seed script or a test fixture. The parser walks the text character by character rather than splitting on commas, so quoted fields containing delimiters, embedded line breaks and doubled quotes all survive intact. With the header option on, each row becomes an object keyed by the trimmed column names; with it off, each row becomes an array of values. Optional type detection turns numeric and boolean-looking cells into real JSON numbers, booleans and nulls. Everything happens locally, so exported spreadsheets of customer or financial data stay on your machine.
How to use the CSV to JSON Converter
- 1
Paste your table into the 'CSV data' box, or paste TSV and set the delimiter to Tab.
- 2
Match the Delimiter option to your file: comma, semicolon, tab or pipe.
- 3
Leave 'First row is a header' ticked to get objects; untick it to get one array per row.
- 4
Toggle 'Detect numbers and booleans' depending on whether you want typed values or plain strings.
- 5
Use 'Pretty print' for readable output, then copy the JSON or download data.json.
What people use it for
Building test fixtures from a spreadsheet
Product and pricing data usually lives in a sheet. Export it, convert it, and you have a fixture array your tests can import without any parsing code.
Seeding a database or headless CMS
Seed scripts and content import endpoints almost always expect JSON. Converting the client's spreadsheet is quicker than writing a one-off CSV reader.
Feeding a chart or table component
Front-end table and charting libraries take arrays of objects. This turns an analytics export into exactly that shape in a few seconds.
Diagnosing a file that will not open cleanly
If a CSV looks misaligned in Excel, converting it reveals whether the real problem is an unbalanced quote or simply the wrong delimiter.
Why a real parser beats splitting on commas
The obvious approach, splitting each line on the delimiter, breaks on the first quoted field. RFC 4180 permits a field to be enclosed in double quotes, and inside those quotes the delimiter, carriage return, line feed and doubled quotes are all ordinary characters. That means a single logical record can span several physical lines, so splitting on newlines first is wrong too. The parser here walks the text one character at a time, tracking whether it is currently inside quotes, appending a literal quote when it sees two in a row, and closing a record only on an unquoted newline. Carriage returns are discarded, so Windows CRLF files and Unix LF files behave identically. Rows in which every cell is blank are dropped, which quietly handles the trailing newline almost every exporter writes at the end of a file, as well as the blank lines people leave between blocks of data.
What type detection changes, and when to switch it off
With detection enabled, a cell reading true or false becomes a JSON boolean, null becomes JSON null, and anything matching an optional minus sign followed by digits with an optional decimal part becomes a number. Everything else stays a string. This is usually what you want, but three cases bite. Identifiers with leading zeros lose them, so 007 becomes 7 and a zero-padded SKU or account code is corrupted. Long numeric identifiers beyond 2^53 - 1 lose precision once they become doubles, which is the same limit that affects JSON parsing generally. And values written in scientific or hexadecimal notation, such as 1e5 or 0x1F, are left as strings here because they do not match the decimal pattern, which may surprise you if you expected them to be numeric. If any column is an identifier rather than a quantity, turn detection off and cast the columns you actually need in your own code, where you control the rules.
Tips
- Header names are trimmed but not otherwise cleaned — rename columns containing spaces in the source if you want tidy JSON keys.
- A file with the wrong delimiter selected produces one giant column; check the Columns count in the Summary before copying.
- Turn off pretty printing when you are pasting the result into a single-line environment variable or a request body.