Free CSV to JSON Converter (and JSON to CSV)
Paste CSV or JSON and convert in either direction. Quoted fields, embedded commas, and multi-line values are handled correctly — all in your browser.
Why CSV is harder to parse than it looks
Splitting a line on every comma seems like the obvious way to parse CSV, and it works right up until a value itself contains a comma — a name field like "Smith, Jo" would incorrectly split into two columns under a naive parser. The CSV format (formalized as RFC 4180) solves this by wrapping any value containing a comma, quote, or line break in double quotes, and escaping a literal quote inside a quoted value by doubling it (""). A correct parser has to track whether it's currently "inside quotes" character by character, which is exactly what this converter does — a plain split(",") would silently corrupt any row with a quoted, comma-containing field.
Choosing a JSON shape
An array of objects (header row → keys) is what most APIs, scripts, and databases expect to import directly. An array of arrays preserves the raw grid — useful if you want to process rows positionally, or if the source data has no meaningful header row at all.
Frequently Asked Questions
How are commas inside values handled?
Per the CSV standard (RFC 4180), values containing commas, quotes, or line breaks are wrapped in double quotes, and quotes inside values are doubled (""). This converter reads and writes that format correctly in both directions.
What JSON shape does the converter produce?
With "First row is header" checked, you get an array of objects using the header names as keys — the shape most APIs and scripts expect. Unchecked, you get an array of arrays preserving raw rows.
Can I convert Excel files?
Indirectly — in Excel or Google Sheets use File → Save As / Download → CSV, then paste or convert that CSV here. Semicolon-delimited CSVs (common in European locales) are auto-detected.
Why can't a CSV file just be split on every comma?
Because a value can legitimately contain a comma if it's wrapped in quotes — a naive split would break a name like "Smith, Jo" into two separate columns. A correct parser has to track whether it's currently inside a quoted field before deciding whether a comma is a real delimiter.
What happens if two columns share the same header name?
The resulting JSON is a plain object per row, so a duplicate key can only hold one value — whichever column comes later in the row overwrites the earlier one with the same name. Rename duplicate headers before converting if you need to keep both columns' data.
Is my data uploaded to a server?
No. Parsing and conversion run entirely in your browser, so it is safe to convert files containing private or business data.