CSV to JSON & JSON to CSV
Convert CSV to JSON and JSON to CSV with delimiter detection and nested JSON flattening.
Runs in your browser. Nothing is uploaded.
What is CSV to JSON & JSON to CSV?
CSV, short for comma-separated values, is the plain-text table format that spreadsheets, databases and exports use everywhere. JSON is the structured format that web APIs and applications use. Moving data between the two is a daily job for developers and analysts: turn a spreadsheet export into JSON for an API or a test fixture, or flatten an API response into CSV so it opens in Excel or Google Sheets.
This converter works in both directions and handles the details that usually go wrong. For CSV to JSON it detects whether your file uses commas, semicolons, tabs or pipes, reads quoted fields, doubled quotes and line breaks inside cells, and turns numbers, true and false and empty cells into real JSON values while leaving IDs such as 007, phone numbers and prices like 1.50 untouched so nothing is silently changed. For JSON to CSV it builds the columns from every record, and you choose how nested data is handled: flatten objects and arrays into columns like address.city and tags.0, keep arrays as JSON text, or keep every nested value as JSON text.
A table preview shows the first rows so you can check the columns before you copy, you can open a file from your computer and download the result, and an Excel-friendly option writes a byte-order mark and Windows line endings so accents and non-Latin text open correctly. Everything is converted in your browser and large files are handled in a background worker, so your data is never uploaded.
How to use
- Choose CSV to JSON or JSON to CSV, then paste your data or open a file.
- For CSV, leave the delimiter on Auto-detect or pick one, and say whether the first row is a header.
- For JSON, choose how nested objects and arrays should become columns.
- Check the table preview, then use Copy or Download.
- Tick the Excel-friendly option before downloading a CSV that contains accents or non-Latin text.
Example
Input
id,name,price 1,Widget,9.99 007,Gadget,19.50
Output
[{"id":1,"name":"Widget","price":9.99},{"id":"007","name":"Gadget","price":"19.50"}]Frequently asked questions
- Why did 007 or 19.50 stay as text?
- To avoid changing your data. A number is only converted when writing it back would give exactly the same text, so IDs with leading zeros, prices with a trailing zero, phone numbers and very long numbers stay strings. Untick the conversion option to keep every value as text.
- How is nested JSON turned into CSV columns?
- By default objects and arrays are flattened into dotted columns such as user.name and tags.0, with one column for every key found in any record. You can instead keep arrays as JSON text in a single cell, or keep all nested values as JSON text.
- Which delimiters are supported?
- Comma, semicolon, tab and pipe. Auto-detect picks the one that gives the same number of columns on the most lines, which handles semicolon files from European versions of Excel.
- Is my data uploaded?
- No. Files and pasted text are converted in your browser, and large inputs run in a background worker. Nothing is sent to a server.
Related tools
- JSON Formatter & ValidatorFormat, minify and validate JSON online with line-accurate error messages.
- JSON DiffCompare two JSON documents and see every added, removed and changed value by path.
- URL Encode / DecodePercent-encode and decode text and URLs, and break a URL into its parts.
- Case ConverterConvert text to camelCase, snake_case, kebab-case and more.