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.

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.

How to use

  1. Choose a direction: “CSV → JSON” or “JSON → CSV”.
  2. Paste your data — the CSV separator (comma, semicolon, tab or pipe) is detected from the first row.
  3. For CSV → JSON, pick the shape (array of objects or arrays) and untick “First row is headers” if your file has none.
  4. Toggle “Detect numbers & booleans” and “Pretty-print” to taste — the output updates live.
  5. Copy the output, or download it as a .json or .csv file.

Examples

API test fixture
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.
Quoted commas survive
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.
European exports
A semicolon-separated file from Excel's German or French locale is detected automatically — no settings to change.
JSON API response to a spreadsheet
Paste an API response array, click “JSON → CSV”, download the file and open it in Excel — keys become column headers.

Frequently asked questions

How are commas inside values handled?
By the standard CSV quoting rules: a field wrapped in double quotes may contain separators, line breaks and doubled quotes ("" means one literal quote). That's how Excel and Sheets write their exports, so they convert correctly here.
Which separators are supported?
Commas, semicolons, tabs and pipes. The tool counts each candidate in your first row and uses the most frequent, which reliably picks the right one — including tab-separated data pasted from a spreadsheet.
What does “Detect numbers & booleans” do?
Values that look like numbers, true/false or null become real JSON types instead of strings. Values with leading zeros (ZIP codes, phone numbers) and integers longer than 15 digits stay strings, because converting them would corrupt the data. Untick the option to keep every value a string.
What JSON can be converted to CSV?
An array of objects (keys become the header row — a union of the keys across all rows), an array of arrays, or a single object. Nested objects and arrays are embedded in the cell as JSON text.
What if my CSV has no header row?
Untick “First row is headers” and every row is treated as data, with keys named column1, column2, and so on. Duplicate or empty header names are fixed up automatically.
Is my data uploaded?
No. Parsing and conversion run entirely in your browser — nothing you paste is transmitted or stored, which matters when you're converting real exports.