CSV to JSON Converter
Convert CSV data to a JSON array of objects, or a JSON array back to CSV — handling quoted fields, embedded commas, and multi-line values correctly.
Interactive Client Prototype Sandbox
Disclaimer: This free tool is provided “as is,” without warranties of any kind, and is for general informational purposes only — not professional, legal, financial, medical, tax, or engineering advice. Results may contain errors; verify anything important independently and use at your own risk. We accept no liability for any loss or damage arising from its use. See our Terms of Use for details.
Step-by-Step Guide
Pick a direction with the CSV → JSON or JSON → CSV toggle. For CSV → JSON, paste CSV text where the first row is the header; each subsequent row becomes one JSON object using the header cells as keys. For JSON → CSV, paste a JSON array of flat objects (no nested objects or arrays as values); the tool collects every key across all objects to build a consistent header row, filling missing fields with empty cells.
Fields containing a comma, a double quote, or a line break must be wrapped in double quotes in CSV, with any internal quotes doubled ('' → " inside the field) — this tool both reads and writes that convention automatically, so round-tripping data through it preserves values exactly.
Copy the output with one click once the row count confirms the conversion looks right.
CSV input:
name,role,years Ada Lovelace,Engineer,3 "Doe, Jane",Designer,2
converts to JSON:
[{"name":"Ada Lovelace","role":"Engineer","years":"3"},{"name":"Doe, Jane","role":"Designer","years":"2"}]
Note the comma inside "Doe, Jane" survives because the CSV field was quoted.
Who it's for
Developers, data analysts, spreadsheet users, and no-code/automation builders moving data between spreadsheets, APIs, and databases.
Core Features
- Convert CSV (with a header row) into a JSON array of objects, one per row.
- Convert a JSON array of flat objects back into CSV with a header row built from the union of all keys.
- Correctly handles quoted fields containing commas, double quotes, and embedded newlines.
- Shows a row count and flags exactly what's wrong with malformed input.
- Runs entirely client-side — your data never leaves your device.
🛡️ No tracking — your inputs, keys, and details never leave this client sandbox.
Why is a comma inside a name not treated as a new column?
Because the value is wrapped in double quotes in the CSV source, e.g. "Doe, Jane". Quoted fields can contain commas, line breaks, and even literal double quotes (written as two double quotes in a row, "") without being split into extra columns. This tool's parser honors quoting exactly as the CSV standard (RFC 4180) defines it.
What happens if rows have different numbers of columns?
For CSV → JSON, a short row simply produces fewer keys on that object (missing trailing columns are treated as absent, not empty). For JSON → CSV, the tool builds the header from every key that appears anywhere in the array, so objects missing a given key just get an empty cell in that column — no row is dropped.
Are numbers and booleans preserved as numbers and booleans?
CSV has no native types — every cell is text — so CSV → JSON produces string values for every field, even ones that look numeric. If you need real JSON numbers or booleans, cast them after conversion (for example in a script) or use the JSON Formatter to review and adjust types.
Can I convert JSON with nested objects or arrays to CSV?
Not directly — CSV is fundamentally a flat, two-dimensional format. This tool expects a JSON array of flat objects (string, number, or boolean values only). If an object contains a nested value, flatten it first (for example, dot-notation keys) or export just the fields you need.
Is my data uploaded anywhere?
No. Parsing and conversion happen entirely in your browser using hand-written JavaScript — nothing is sent to a server, which matters if the CSV or JSON contains customer data, financial figures, or other sensitive rows.
Why CSV and JSON keep colliding
CSV and JSON solve different problems and neither one is going away. CSV is what every spreadsheet application, database export tool, and legacy system speaks by default — it's compact, human-editable, and opens instantly in Excel or Google Sheets. JSON is what nearly every modern API, JavaScript codebase, and NoSQL database speaks natively. The moment data needs to cross that boundary — a marketing team exporting a spreadsheet for an engineer to import, or an API response that a non-technical analyst wants to open in a spreadsheet — someone has to convert between the two, and it happens constantly enough that most data teams have done it by hand at least once with a text editor and a lot of patience.
The quoting problem is where hand conversion breaks
A naive CSV parser that just splits on commas works fine until a single cell contains a comma of its own — an address, a company name like 'Smith, Jones & Co.', or free-text notes. The CSV specification handles this by wrapping such a field in double quotes, and it further escapes a literal double quote inside that field by doubling it. A hand-written split(',') will silently corrupt any row containing this pattern, shifting every subsequent column over by one and producing data that looks plausible but is wrong — which is far more dangerous than an obvious crash, because it can go unnoticed until a report is already wrong.
What gets lost in the round trip
Converting CSV to JSON and back is not perfectly lossless by default: CSV has no concept of a JSON number, boolean, or null — every value is text — so a CSV → JSON conversion produces string fields, and a later JSON → CSV conversion of that same data will not magically know that '42' was originally a number. Anyone building a pipeline around this conversion should decide explicitly where type casting happens, rather than assuming the round trip preserves types.