GT GetToolsFree
Free · No sign-up · Runs in your browser

CSV to JSON Converter

Convert CSV to JSON, or JSON back to CSV, with proper handling of quoted fields — not a naive comma split.

Ad space — 728×90 banner
Rows
0
Columns
0

How to use the CSV to JSON Converter

  1. Paste CSV into the top box and click "CSV → JSON" to convert it, using the first row as headers.
  2. Or paste a JSON array of objects into the bottom box and click "JSON → CSV" to convert it the other way.
  3. Rows and columns detected are shown below the boxes, along with any parsing errors.
  4. Copy or download either box's contents with the buttons underneath it.

How it works

Naively splitting a CSV line on commas breaks as soon as a field contains a comma of its own — a name like "Doe, John" would be split into two columns instead of one. This tool instead reads the CSV one character at a time, tracking whether it's currently inside a quoted field; inside quotes, commas and line breaks are treated as ordinary characters that belong to the field, and a doubled quote ("") is understood as an escaped literal quote rather than the end of the field. For example, the row Jane,"Says ""hi"" to everyone",Boston is parsed as exactly three fields, with the middle one reading Says "hi" to everyone. Converting JSON to CSV works in reverse: any field containing a comma, quote, or line break is automatically wrapped in quotes with internal quotes doubled, so the resulting CSV round-trips correctly.

Frequently asked questions

Is my data uploaded anywhere?

No — both conversions run entirely in your browser with JavaScript. Nothing is sent to a server.

Does this handle commas inside a field, like "Doe, John"?

Yes — the CSV parser is a proper character-by-character parser that tracks quoted fields, not a naive split on commas. A quoted field like "Doe, John" is read as a single value, and a doubled quote ("") inside a quoted field is read as one literal quote character.

Does this handle a line break inside a quoted field?

Yes — as long as the field is wrapped in quotes, a real line break inside it is kept as part of that field's value rather than incorrectly starting a new row.

What happens with spreadsheet-formula-looking values like =SUM(A1) when exporting to CSV?

Any field that starts with =, +, -, or @ gets a leading apostrophe added when converting JSON to CSV. This is a standard, widely used protection against "CSV injection" — it stops the value from being interpreted as a formula if the file is later opened in Excel or Google Sheets, while still preserving the original text.