JSON ↔ CSV Converter

JSON Input
CSV Output

How to Convert JSON to CSV

Paste an array of JSON objects into the left panel. Each object becomes one row, and the header is the union of every key seen across every object — so rows do not have to be homogeneous. A key missing from one row simply produces an empty cell there. Conversion runs as you type; use Download file to save a .csv you can open directly in Excel, Numbers, or Google Sheets.

A single object rather than an array is also accepted and produces a one-row file. Everything runs in your browser — your data is never uploaded, logged, or sent to a server, which matters because the JSON people convert to CSV is usually an export containing real customer records.

The Flattening Rule

CSV is a flat grid and JSON is a tree, so something has to give. This converter uses a single rule with no exceptions: every leaf value becomes one column, named by its dot-joined path from the root. A numeric path segment is an array index.

JSON in
[
  {
    "id": 1,
    "address": { "city": "London" },
    "tags": ["founder", "math"]
  }
]
CSV out
id,address.city,tags.0,tags.1
1,London,founder,math

The advantage of one rule over special cases is that it inverts cleanly. Converting that CSV back gives you the original nested structure, because address.city unambiguously means an object and tags.0 unambiguously means an array. Most converters either refuse nested input or join arrays into a single comma-separated cell, and neither choice survives a round trip.

Converting CSV to JSON

Switch to CSV → JSON and paste a delimited file. The parser is a full RFC 4180 implementation: quoted fields containing the delimiter, embedded newlines inside quotes, and doubled quotes as an escaped quote all parse correctly. A UTF-8 byte order mark — which Excel writes by default — is stripped rather than becoming part of your first column name.

Three options control the result. First row is a header uses row one for key names; turn it off and you get column1, column2, and so on. Infer numbers & booleans is described below. Omit empty cells drops keys whose cell is blank instead of emitting "" — worth leaving on, because CSV is rectangular and JSON is not, so every row otherwise carries every column whether it had a value or not.

Type Inference That Does Not Corrupt Your Data

CSV has no type system. Every value is text, so any converter that produces typed JSON is guessing. The usual guess — "if it looks like a number, make it a number" — destroys data quietly and often.

This tool uses a stricter test: a value becomes a number only if converting it back to text yields the exact original characters. That single check eliminates the entire class of corruption.

CSV cellJSON valueWhy
4242Round-trips exactly — safe to convert
007"007"Would come back as 7, so it stays text
1.10"1.10"Would come back as 1.1 — version strings survive
12345678901234567890"12345678901234567890"Exceeds float precision, so the ID is preserved intact
truetrueBoolean
+1-555-0100"+1-555-0100"Not numeric syntax

Leading-zero identifiers, ZIP codes, version numbers, and large database IDs are exactly the values that break under naive inference, and they are exactly the values that matter. Turn inference off entirely if you want every field as a string.

Four CSV Problems Worth Knowing About

1. Excel is not reading your file wrong — it is reading a different delimiter. In locales where the comma is the decimal separator, including most of continental Europe, Excel writes and expects semicolon-delimited files while still calling them CSV. A file that opens as one column per row on a colleague's machine is almost always this. Switch the delimiter above to Semicolon.
2. Spreadsheets rewrite your data on open. Excel and Sheets apply type detection when a file is opened, not when it is written. A product code like 0012 loses its zeros, 1-2 can become a date, and a long numeric ID switches to scientific notation. The CSV on disk is correct; the display and any subsequent re-save are not. Import as text explicitly when the values are identifiers.
3. CSV injection is a real vulnerability. A cell beginning with =, +, -, or @ is treated as a formula by spreadsheet software. If your application exports user-supplied text to CSV, an attacker can store =HYPERLINK(...) in a name field and have it execute when a colleague opens the export. This converter never alters your values — that is the correct behaviour for a data tool — but if you are generating exports from untrusted input, prefix such cells with an apostrophe or a tab in your own export code.
4. Line endings and stray quotes. RFC 4180 specifies CRLF, but most Unix tooling writes LF, and both are accepted here. A quote appearing in the middle of an unquoted field — 6" nails — is strictly invalid but common in real exports, so it is kept as a literal character rather than failing the parse.

What Cannot Survive the Trip

Two things are genuinely lost, and it is better to know in advance than to discover them in a diff.

Empty arrays and empty objects. The flattening rule works on leaves, and [] and {} have none, so they produce no column and disappear. A record whose tags array is empty comes back without a tags key at all.

The difference between null and empty. CSV has one representation for absent data: nothing between two delimiters. A JSON null, an empty string, and a missing key all write the same empty cell and cannot be told apart afterwards. If that distinction carries meaning in your data, convert through YAML instead, which represents null explicitly.

Where This Conversion Comes Up

Handing API data to someone who uses spreadsheets. This is the most common case by a wide margin. Finance, support, and operations colleagues want a file they can sort and filter, not a JSON array. Fetch, convert, download, send.

Bulk-loading a database. Postgres COPY, MySQL LOAD DATA INFILE, and most warehouse import paths take CSV far faster than row-by-row inserts. Converting a JSON export to CSV first can turn a multi-hour load into a few minutes.

Getting a spreadsheet into an application. The reverse direction turns a colleague's manually maintained sheet into JSON you can validate and commit. Run the result through our JSON formatter and validator to confirm the structure before it goes anywhere near production, and use XML ↔ JSON if the destination system predates JSON entirely.

Loading this data somewhere? Managed Postgres platforms such as Neon and Supabase accept CSV import directly from their dashboards, so a converted file is the whole ingestion step. These are affiliate links — they cost you nothing and help keep these tools free.

Frequently Asked Questions

Is my data uploaded anywhere?
No. Parsing and conversion run entirely in JavaScript in your browser, including the download — the file is generated locally with a blob URL. Nothing is transmitted, stored, or logged.
Why do my columns have dots in the names?
Your JSON was nested. address.city means the city key inside the address object. Converting that CSV back rebuilds the nesting exactly.
Can it handle arrays of different lengths?
Yes. The header is the union of all rows' columns, so a row with three tags produces tags.0 through tags.2 and rows with fewer simply leave the extra cells empty.
My CSV has commas inside the values. Will it break?
Not if those fields are quoted, which is what RFC 4180 requires and what every spreadsheet writes. "Turing, Alan" parses as one field. The same applies to newlines and quotes inside quoted fields.
Why is my number still a string?
Because converting it back to text would not have produced the original characters — most often a leading zero, a trailing zero after a decimal point, or an integer too large for a 64-bit float. That is deliberate: the alternative silently corrupts identifiers.
Is there a row limit?
No hard limit — you are bounded only by your browser's memory. Files with tens of thousands of rows convert without trouble; very large exports may briefly freeze the tab.