CSV ↔ JSON Converter
Paste rows exported from Excel, Google Sheets or a database as comma-separated text and get JSON your code can consume — or go the other way to open API data in a spreadsheet.
How the conversion maps data
CSV is a flat table; JSON is a tree. Converting CSV → JSON treats the first row as column names and produces an array with one object per row, keyed by those names. The header cells must be non-empty and unique, otherwise the tool shows an error, and completely blank rows are skipped. Converting JSON → CSV needs a non-empty array of objects: it collects every key that appears in any object to build the header and writes one row per object, leaving empty cells for missing keys and for null.
Nested values are not flattened into dotted columns. An object or array inside a field is written into its cell as JSON text (for example {"city":"London"}, quoted as needed), so deeply nested data is better flattened before conversion.
CSV details that break naive converters
Fields containing commas, quotes or line breaks must be wrapped in double quotes, and an embedded quote is doubled (""). The parser handles these quoting rules, accepts both Windows and Unix line endings, and reports an error for an unclosed quoted field. The delimiter is always a comma: there is no delimiter detection, so convert semicolon- or tab-separated files to commas first. A UTF-8 byte-order mark is not stripped, so if the first column name looks odd, remove the invisible character at the start of the file.
Everything is text
CSV has no types, and this converter does not guess them: every value in the JSON output is a string, so 42 becomes "42" and true becomes "true". That keeps leading zeros in postcodes, ids and phone numbers intact, but if you need real numbers or booleans, convert them in your code afterwards. The JSON output is pretty-printed with two-space indentation and can be fed straight into the JSON Formatter for further inspection.
How to use it
- Paste comma-separated CSV with a header row into the left box (or a JSON array of objects into the right box).
- Click CSV → JSON or JSON → CSV; the result appears in the other box, and an error message replaces it if the input is invalid.
- Use Copy JSON to copy the JSON, or select the CSV text from the left box.
Example
This CSV:
id,name,city,active 1,Ada Lovelace,London,true 2,"Grace Hopper, PhD",Arlington,false
becomes [{"id":"1","name":"Ada Lovelace","city":"London","active":"true"},{"id":"2","name":"Grace Hopper, PhD","city":"Arlington","active":"false"}] (the tool pretty-prints it over several lines). The quoted field containing a comma is handled correctly, and every value, including id and active, stays a string.
Common use cases
- Loading a spreadsheet of products, users or prices into an application as seed or fixture data (converting numeric fields in code).
- Exporting an API response to CSV so a colleague can analyse it in Excel.
- Converting a database export to JSON for a NoSQL import or a front-end mock.
- Checking how a CSV with tricky quoting is parsed before importing it elsewhere.
Frequently asked questions
Is my spreadsheet data uploaded?
No. Parsing and conversion run in your browser; customer lists or financial data never leave your machine.
How are nested JSON objects represented in CSV?
They are not flattened into columns. An object or array inside a field is written into a single cell as JSON text, so flatten nested data first if you want separate columns.
Why are all my numbers strings in the JSON?
The converter does no type inference: every CSV value becomes a JSON string. This also means leading zeros such as 00420 are preserved.
Can it handle semicolon or tab separated files?
No, only commas. Replace the delimiter with commas first (taking care with fields that contain commas), then convert.
Can it handle large files?
It runs in your browser, so the limit is your device's memory; very large files may be slow. For multi-gigabyte files use a command-line tool such as csvkit or jq.