What is JSON to CSV conversion?
JSON (JavaScript Object Notation, RFC 8259) is a tree-shaped text format for structured data; CSV (Comma-Separated Values, RFC 4180) is a flat, tabular text format. Converting JSON to CSV flattens that tree into rows and columns, so a dataset that started life as an API response opens cleanly in a spreadsheet without retyping a single row.
How does JSON to CSV conversion work?
Every conversion runs locally in your browser. The high-level steps are:
JSON.parsevalidates the input and confirms it's a top-level array of records. A clear error fires if the brackets, commas, or quoted keys don't add up.- The writer derives header columns from your records. That's either the union of every key seen, or just the keys from the first record, depending on the toggle.
- Nested objects are flattened to dot-keys (
user.id,user.city) or serialized as a single JSON cell, your choice. Arrays inside objects are JSON-stringified either way. - Each cell is escaped per RFC 4180: any value containing the delimiter, a double quote, or a line break gets wrapped in quotes, and internal quotes are doubled. Rows join with
\r\nline endings. - The CSV lands in the read-only output box, and a download link builds a
Blobwith thetext/csv;charset=utf-8MIME type so you can save the file with one click.
Why convert JSON to CSV with this tool?
- Privacy: every parse, flatten, and write pass happens in your browser. The data never reaches our servers.
- Correctness: the writer follows RFC 4180. A value like
Bob, Jr.comes back as"Bob, Jr."— one quoted cell, not two columns — and embedded newlines or quotes survive the round-trip intact. - Spreadsheet-ready: the output pastes straight into Excel or Google Sheets, with header columns already derived from your keys, so there's no manual cleanup before the data is usable.
- Flexibility: flatten nested objects to dot-keys or stringify them as one cell, pick any delimiter for non-comma CSV dialects, and choose whether headers come from every key or just the first record.
What are common applications of JSON to CSV conversion?
Flattening JSON into CSV shows up across data work and tooling:
- Data export: turning an API response into a CSV file your finance, ops, or product team can open in Excel or Google Sheets without writing code.
- Reporting: dropping a JSON query result into a spreadsheet for a pivot table, a chart, or a quick column of formulas. That kind of work is painful against raw JSON.
- Spreadsheet review: flattening a nested JSON config (settings, feature flags, A/B variants) into CSV so non-technical reviewers can read and edit it cell by cell.
What does a JSON to CSV example look like?
Paste [{"name":"Alice","age":30},{"name":"Bob, Jr.","age":25}], leave the delimiter on comma, and press CONVERT. You get three lines: a name,age header row, an Alice,30 data row, and a "Bob, Jr.",25 row. That embedded comma is exactly what trips up a naive join — here it triggers RFC 4180 quoting, so the cell stays whole.
Does this JSON to CSV converter run entirely in my browser?
Yes. Every parse, flatten, and write pass runs locally as JavaScript inside your browser tab. The tool does not call fetch, XMLHttpRequest, or navigator.sendBeacon at all, so your JSON payloads never reach our servers, a third-party converter, or any analytics pipeline. The tool also works offline once the page has loaded, because it is a static HTML/CSS/JS bundle with no runtime API dependency.
What is the maximum input size this converter can handle?
The converter buffers the entire input in memory and runs synchronously on the main thread, so practical limits depend on your device. A JSON array up to about 10 MB (roughly 100,000 typical records) flattens to CSV without a noticeable pause on a modern laptop. Beyond that the UI can stall while the writer runs. Streamed conversion using a Web Worker plus a chunked writer is a planned follow-up — for now, split very large datasets before pasting them in.
How does the writer handle values with commas, quotes, or newlines?
Per RFC 4180. Any value containing the active delimiter, a double quote, a CR, or an LF is wrapped in double quotes, and internal quotes are doubled. So a name like Bob, Jr. becomes the single cell "Bob, Jr." instead of spilling into two columns, and a multi-line description stays in one cell rather than breaking the row. This is the part a naïve join(',') gets wrong.
What happens to nested JSON objects when converting to CSV?
Nested objects are handled per the Nested objects toggle. In Flatten mode (the default), keys are dot-joined — {"user":{"id":1,"city":"Paris"}} becomes columns user.id and user.city. In Stringify mode, the nested object is serialised as a single JSON cell value with RFC 4180 quote escaping intact, preserving its structure for round-tripping. Arrays inside objects are JSON-stringified in both modes.
Which delimiters can the CSV output use?
Four: comma (,, the RFC 4180 default), semicolon (;, common in European locales), tab (\t, the TSV dialect), and pipe (|). Pick the one your downstream tool expects. The writer escapes any cell that happens to contain the chosen delimiter, so the choice never corrupts a value.
This JSON to CSV converter flattens your array and emits RFC 4180-compliant output you can paste straight into a spreadsheet, a report, or a code review, without uploading a single byte. Need the reverse? The CSV to JSON converter parses the other way.