CSV to JSON Converter (and Back)
Convert CSV with a header row into a JSON array of objects, or turn a JSON array back into CSV — quotes and commas handled, all in your browser.
About this tool
CSV and JSON are the two most common ways to move tabular data around, and you frequently need to switch between them. This converter turns CSV into a JSON array of objects, using the first row as the keys, and converts a JSON array of objects back into CSV, deriving the column headers from the object keys. The CSV parser follows the usual RFC-4180 conventions: it correctly handles fields wrapped in double quotes, commas inside quoted fields, escaped quotes (written as two double-quotes), and both Windows and Unix line endings. Everything runs locally in your browser, so spreadsheets and exports with sensitive data never leave your device. Use it to load CSV exports into code, or to produce a CSV from API JSON for a spreadsheet.
How to use it
- Pick a direction: CSV → JSON or JSON → CSV.
- Paste your data (CSV needs a header row; JSON needs an array of objects).
- Click Convert.
- Copy the converted output.
Frequently asked questions
- How do I convert CSV to JSON?
- Paste the CSV with a header row and click Convert. The first row becomes the object keys, and each subsequent row becomes a JSON object, producing an array. Quoted fields and embedded commas are handled correctly.
- How does the CSV parser handle commas inside values?
- Fields containing commas (or quotes or newlines) should be wrapped in double quotes per RFC 4180, e.g. "Smith, John". The parser respects those quotes so the comma stays part of the value rather than splitting it.
- How are quotes escaped in CSV?
- A literal double-quote inside a quoted field is written as two double-quotes (""). The parser converts "" back to a single " in the JSON output, and the JSON→CSV direction re-escapes them.
- What JSON shape does CSV→JSON produce?
- An array of flat objects, one per data row, with string values keyed by the header names. Nested structures are not inferred — CSV is inherently flat — so all values come through as strings.
- Does JSON → CSV handle different keys per object?
- Yes. It collects the union of all keys across the objects to build the header row, and fills missing values with empty cells, so irregular arrays still produce a valid CSV.
- Is my data uploaded?
- No. Both conversions run entirely in your browser. Nothing is sent to a server, so even confidential spreadsheets stay private.