CSV ↔ JSON Converter
Data arrives in the wrong shape constantly: a spreadsheet export that an API will not take, a JSON response a spreadsheet cannot open. This converter flips between the two in either direction, following the quoting rules both formats actually specify.
The conversion runs entirely in your browser. Nothing you paste — customer lists, exports, logs — is uploaded, stored, or sent anywhere.
With a header, each row becomes a JSON object keyed by the header names. Without one, the output is an array of arrays.
Converted entirely in your browser — the data you paste is never uploaded or stored.
Embed this calculator on your website →
The formula
CSV row → JSON object (one per row, keyed by the header)
- quoting (RFC 4180) — a field wrapped in double quotes may contain the delimiter and newlines; a quote inside a quoted field is written doubled ("").
- values stay strings — CSV carries no types, so "36" in CSV becomes "36" in JSON, never a guessed number.
- JSON → CSV headers — the union of all objects' keys, in the order first seen; missing keys and nulls become empty cells; nested values are written as compact JSON text in the cell rather than flattened or dropped.
Worked example: the default CSV above — two rows keyed by name, age, city — converts to a JSON array of two objects, with Grace's "New York, NY" kept as one field by its quotes.
How it works
Delimiters. Comma is the default; semicolon (common in European spreadsheet exports), tab, and pipe are supported, and Auto guesses from the first line by counting candidates outside quotes. If a conversion comes out as one wide column, the delimiter is almost always the reason.
Ragged rows are handled openly. A row shorter than the header is padded with empty strings. A row with MORE fields than the header is an error, with the row named — extra fields almost always mean an unquoted delimiter inside the data, and silently dropping them would lose information without telling you.
Duplicate headers. If the header repeats a name, later copies are renamed with _2, _3 suffixes and the rename is reported under the result — two columns never collapse into one.
Examples
- A spreadsheet export for an API → CSV with a header row becomes the JSON array of objects the API expects.
- An API response for a spreadsheet → an array of flat objects becomes CSV with the union of keys as the header; a key missing from one object is an empty cell in its row.
- Addresses with commas → "New York, NY" survives both directions because the quoting rules are followed exactly, not approximately.
Frequently asked questions
Is my data uploaded?
No. The converter is pure browser code — open your network tab and converting makes no request. That is the main reason to use a tool like this for exports that contain personal or business data.
Why are all the JSON values strings?
Because CSV itself has no types: 36 in a CSV file is the two characters '3' and '6', and whether it means a number, a year, or a code is your knowledge, not the file's. Guessing would corrupt values like phone numbers and leading-zero codes, so this tool never guesses.
What JSON shapes can become CSV?
An array of flat objects. Nested objects or arrays inside a value are written as compact JSON text in that cell (so nothing is lost), and a top-level value that is not an array of objects is rejected with an explanation — a single object has no rows to make.
My file uses semicolons. What do I do?
Choose Semicolon as the delimiter, or leave it on Auto — European Excel locales export CSV with semicolons because the comma is their decimal separator, and the auto-detection handles that case.
Related calculators
JSON Formatter & Validator
LiveFormat, validate, and minify JSON, with the exact position of any syntax error pointed out.
Base64 Encode / Decode
LiveEncode text to Base64 or decode Base64 back to text, with full UTF-8 support for accents and emoji.
URL Encode / Decode
LiveEncode text for safe use in URLs, or decode percent-encoded URLs back to readable text.

