What it does
This converter goes both ways between CSV and a JSON array of objects. CSV → JSON treats the first row as column headers and turns every following row into an object, keyed by those headers. JSON → CSV takes an array of objects and writes a header row followed by one row per object. Switch direction with the toggle at the top; output updates as you type.
How it works
The CSV parser is a proper state machine, not a naive split(","), so it respects RFC 4180 quoting: a field wrapped in double quotes may contain commas and line breaks, and two double quotes in a row ("") represent a single literal quote. Carriage returns are normalised first, so files saved on Windows parse correctly. Going the other way, the writer collects the union of all keys across your objects as the header, then quotes any field that contains a comma, quote or newline. All values are treated as strings — see the gotchas.
Gotchas
- CSV has no types, so every value round-trips as a JSON string:
"42", not42. Cast afterwards if you need numbers. - JSON → CSV expects a top-level array of objects. A bare object or a nested structure throws an error shown with a
⚠. - Nested objects or arrays inside a cell are stringified crudely; flatten your data first for clean columns.
- Duplicate header names collapse — the last column with a given name wins when building objects.
Worked example
The CSV name,role / Ada,admin / Bob,editor becomes [{"name":"Ada","role":"admin"},{"name":"Bob","role":"editor"}], and pasting that array back with the toggle flipped reproduces the CSV. To pretty-print or validate the JSON side, use JSON; to convert YAML instead, see YAML ↔ JSON.
Privacy
Everything runs locally; nothing is uploaded.