CSV to JSON Converter
Two-way CSV and JSON conversion. Handles quoted fields and commas inside cells. Local only.
- Runs in your browser
- No sign-up
- No watermark
- No installs
name,age
Ada,12[{ "name":"Ada", "age":"12" }]What this tool does
Converts tabular data between CSV and JSON in both directions. In CSV to JSON mode it
parses comma, tab, or semicolon delimited text into rows and columns, honoring the CSV
quoting rules: a comma inside double quotes does not split the field, quoted fields may
span line breaks, and a doubled quote ("") is read as one literal quote.
With the header toggle on you get an array of objects keyed by the header; off, an array
of arrays. In JSON to CSV mode it accepts an array of objects or an array of arrays and
emits CSV, quoting any field that needs it. Everything runs locally; nothing is uploaded.
How to use it
Pick a direction. For CSV to JSON, paste your CSV, let auto-detect pick the delimiter (or choose one from the dropdown), and toggle "First row is header" to match your data. Press Convert to get pretty-printed JSON. For JSON to CSV, paste a JSON array (of objects or of arrays) and press Convert to get CSV back. Use Copy result to grab the output. Malformed input shows an inline error instead of failing silently.
Common use cases
- Turning a spreadsheet export into JSON for seeding a database or a test fixture.
- Flattening an API JSON response into CSV so it opens cleanly in a spreadsheet.
- Prepping small config or lookup data for a client-side app.
- Inspecting a CSV structure quickly by reading it as keyed objects.
- Converting between formats when a downstream tool only accepts one of them.
Common pitfalls
- Everything becomes a string. CSV carries no types, so numbers and booleans come through as strings on the JSON side. Cast them in your own code if you need real numbers or booleans.
- Auto-detect can misfire. A quoted comma in the first line can fool delimiter detection. If the columns look wrong, set the delimiter explicitly.
- Ragged rows get padded. If some CSV rows have fewer fields than the header, the missing cells are filled with empty strings so every object has the same keys. Check your source if that is unexpected.
- Nested JSON is stringified on the way to CSV. A cell whose value is an object or array is serialized to a compact JSON string rather than dropped, since CSV is flat by nature.
Frequently asked questions
- How does CSV to JSON handle commas inside a quoted field?
- A field wrapped in double quotes can contain literal commas, line breaks, and quote characters. For example, the CSV row "Doe, Jane","hi, there" parses into exactly two fields: Doe, Jane and hi, there. A literal double quote inside a quoted field is written by doubling it (""), which the parser converts back to a single quote. This follows the RFC 4180 quoting convention.
- What is the difference between the header on and header off modes?
- With "First row is header" on, CSV to JSON produces an array of objects, one per data row, keyed by the header cells (for example [{"name":"Ada","role":"Engineer"}]). With it off, every row is treated as data and you get an array of arrays (for example [["name","role"],["Ada","Engineer"]]). Pick whichever matches how you plan to consume the JSON.
- How does JSON to CSV decide the columns?
- If your JSON is an array of objects, the tool collects the union of all keys across every object, in first-seen order, and uses that as the header row. Objects missing a key get an empty cell for that column. If your JSON is an array of arrays, each inner array becomes a row as-is. Any field that contains a comma, quote, or newline is wrapped in double quotes and its inner quotes are doubled.
- Why does delimiter auto-detect sometimes pick the wrong separator?
- Auto-detect counts commas, tabs, and semicolons in the first line and picks the most frequent. If a header cell contains a quoted comma, the raw count can mislead detection. When that happens, choose the delimiter explicitly from the dropdown instead of leaving it on auto.
- What happens to numbers, booleans, and empty cells?
- CSV has no type information, so every cell becomes a JSON string, including things that look like numbers or true/false. An empty cell becomes an empty string. This keeps the conversion lossless and predictable; if you need typed values, cast them in your own code after import, where you control the rules.
- Is my data uploaded anywhere?
- No. The conversion runs entirely in your browser using built-in JavaScript. Nothing is sent to a server, so you can paste sensitive spreadsheets or exports without them leaving your machine. You can verify this in DevTools under the Network tab: there are zero requests during conversion.
- What JSON shapes are accepted for JSON to CSV?
- The tool accepts a top-level JSON array. Each element should be either an object (flat key/value pairs) or an array of values. Nested objects or arrays inside a cell are serialized back to a compact JSON string so no data is silently dropped. A non-array top-level value, or invalid JSON, produces a clear inline error rather than a crash.
Cite this tool
For academic, journalistic, or technical references. Pick a format:
Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.