CSV to JSON Converter
Turn CSV data into clean JSON — or JSON back into CSV — with proper handling of quotes, headers and data types.
🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.
The CSV to JSON Converter turns spreadsheet-style data into clean, valid JSON in real time. Paste a CSV export and it becomes an array of objects, with the header row supplying the keys — or an array of arrays if you prefer raw rows. The separator is detected automatically (comma, semicolon, tab or pipe), and the conversion works in reverse too: paste a JSON array and get a CSV file back, ready for Excel or Google Sheets.
Also on Txtset: format and validate JSON with line errors · tidy up the query behind the data.
The hard part of CSV is the part naive converters get wrong. A value like "Smith, John" contains a comma that is not a separator; quoted fields can contain line breaks; a literal quote is written as two quotes. This tool follows the standard CSV rules (RFC 4180), so real-world exports from Excel, Sheets and databases convert correctly instead of shattering at the first quoted comma. It also recognises European semicolon-separated files automatically.
Type detection keeps the JSON honest: 42 becomes a number, true a boolean and null a null — while ZIP codes with leading zeros and IDs too long for JavaScript numbers stay safely quoted as strings. Turn detection off and everything remains a string. Like every Txtset tool, the conversion runs entirely in your browser, so exported customer data never leaves your machine. When the JSON that comes back needs indenting, minifying or checking after a hand edit, the JSON Formatter takes it from here.
How to use
- Choose a direction: “CSV → JSON” or “JSON → CSV”.
- Paste your data — the CSV separator (comma, semicolon, tab or pipe) is detected from the first row.
- For CSV → JSON, pick the shape (array of objects or arrays) and untick “First row is headers” if your file has none.
- Toggle “Detect numbers & booleans” and “Pretty-print” to taste — the output updates live.
- Copy the output, or download it as a .json or .csv file.
Examples
A Google Sheets export of test users becomes an array of JSON objects you can drop straight into a mock API or unit-test fixture.
The row
"Smith, John",42 converts to {"name": "Smith, John", "age": 42} — the comma inside quotes is kept as text, not treated as a separator.A semicolon-separated file from Excel's German or French locale is detected automatically — no settings to change.
Paste an API response array, click “JSON → CSV”, download the file and open it in Excel — keys become column headers.