CSV to JSON Converter
Convert CSV or TSV into JSON arrays or objects, with delimiter detection, safe type conversion and nested keys from dotted headers.
Tool guide
What this tool does
CSV to JSON Converter parses comma, semicolon, tab or pipe separated data, including quoted fields with commas and line breaks, and turns it into an array of objects, an array of arrays, an object keyed by ID or one array per column. Numbers and booleans can be typed automatically while codes with leading zeros stay text.
Spreadsheets and database exports arrive as CSV, but web apps, test fixtures and APIs want JSON. Splitting lines on commas works until a name like "O'Neill, Tom" or an address with a line break appears inside quotes, and then every following row shifts. Type handling is another trap: converting every numeric-looking value to a number silently turns the product code 0042 into 42 and the postcode 018956 into 18956.
This tool parses CSV with Papa Parse, a mature RFC 4180 parser that handles quoted delimiters, doubled quotes and multi-line fields, and can detect the delimiter for you. Type conversion is deliberately conservative: only values that are valid JSON numbers without leading zeros, and the words true, false and null, are converted. Headers like address.city can be expanded into nested objects. The parser is loaded only when you use the tool and everything runs in your browser.
How to use CSV to JSON Converter
- Paste CSV into CSV input, open a .csv or .tsv file, or click Sample.
- Leave Delimiter on Detect automatically, or force comma, semicolon, tab or pipe.
- Confirm whether the First row is a header; if not, columns are named column1, column2 and so on.
- Choose the Output shape: array of objects, array of arrays, object keyed by the first column, or one array per column.
- Set type conversion, empty-cell handling, nested headers and trimming to suit the data.
- Review the Rows, Columns and Delimiter figures and any row warnings, then copy or download data.json.
Tips for better results
- Object keyed by first column is ideal for lookup tables, for example turning a list of country codes into { "GB": {...}, "FR": {...} }.
- Object of column arrays suits charting libraries that expect one array per series.
- Duplicate header names are renamed with a suffix (email, email_2) so no column overwrites another.
- For very large files, switch to Minified indentation to keep the output small and quick to copy.
Common use cases
- Turning a spreadsheet export into seed data or test fixtures.
- Feeding a product or price list into a JavaScript front end.
- Converting a bank or analytics export for processing in a script.
- Building i18n or configuration files from a sheet maintained by non-developers.
Common mistakes to avoid
- Turning off type conversion and then comparing numbers as strings in code, where "10" sorts before "9".
- Converting a file saved in a legacy encoding such as Windows-1252; resave it as UTF-8 first or accented characters will be wrong.
- Ignoring the row warnings: a row with too few or too many fields usually means an unclosed quote earlier in the file.
Frequently asked questions
Why does 0042 stay a string?
Values with leading zeros are usually identifiers such as product codes, phone numbers or postcodes. Converting them to numbers would lose the zeros, so the tool only converts values that are valid JSON numbers.
Can it read tab-separated or semicolon files?
Yes. Automatic detection checks common delimiters, and you can force comma, semicolon, tab or pipe. Excel exports in many European locales use semicolons.
How do I get nested JSON objects?
Name your headers with dots, such as address.city and address.postcode, and switch on Nest dotted headers. Those columns are combined into an address object in each record.
What happens with very large integers?
Integers beyond 9,007,199,254,740,991 cannot be represented exactly in JSON numbers used by JavaScript, so they are kept as strings to avoid silent rounding.
Feedback & suggestions
Help us improve CSV to JSON Converter. We read every message.