Loading...
Loading...
Convert JSON to CSV or CSV to JSON in your browser. Nested objects flatten to dot-notation columns automatically. Nothing is uploaded.
CSV has no concept of a nested object — every cell is a single flat value. Feed a nested object straight into a naive converter and it calls JavaScript's default toString() on it, which produces the literal text [object Object] — not an error, just a useless string that happens to look like data. This tool flattens nested keys into dot-notation column names instead, so the structure survives as column names rather than getting collapsed into that placeholder text.
Before (JSON)
[
{
"user": {
"name": "Ann",
"address": { "city": "Boston" }
}
}
]After (CSV, full flatten)
user.name,user.address.city Ann,Boston
The "only 1 level" option stops after the first dot — user.address would hold the raw {"city":"Boston"}as text instead of recursing further. The "don't flatten" option skips flattening entirely, so every nested value is stored as its original JSON text in a single cell under the top-level key. If flattening two different paths would produce the same column name (e.g. a literal key named a.b colliding with a nested {"a":{"b":1}}), this tool renames the second one and shows a warning rather than silently overwriting a column.
Use the "Convert back (verify)" button after a conversion to run the result through the opposite direction — a quick way to see what a round trip actually changes. Three things are worth knowing about going JSON → CSV → JSON:
JSON.parse converts them to IEEE-754 double-precision floats, the same type JavaScript uses for every number — integers past 2^53 can round to a nearby value on the way through.null by convention, but that's a guess — if the original value was really "", the round trip won't recover that distinction.| CSV | JSON | |
|---|---|---|
| Structure | Flat rows and columns only | Arbitrary nesting — objects inside objects, arrays inside objects |
| Data types | No native types — every cell is text (RFC 4180) | String, number, boolean, null, array, object (RFC 8259) |
| Comments | Not supported | Not supported (despite many hand-edited config files using // anyway) |
| Size for many similar rows | Compact — column names stored once, in the header | Larger — each object repeats its own key names |
| Typical use | Spreadsheets, databases, bulk import/export | APIs, config files, anything with nested or variable-shape data |
JSON exports from an API and CSV exports from a database often contain exactly the data you'd rather not hand to a third-party server — user records, order details, internal identifiers. This tool reads pasted text or a local file with the browser's FileReader API, converts it in memory, and gives you the result as a copy or download. Nothing is sent over the network, so there's nothing to log, cache, or leak.
| This tool | Typical online converter | |
|---|---|---|
| File leaves your device? | No | Yes — uploaded to their server |
| Works offline once loaded? | Yes | No |
| Signup required? | No | Sometimes, for larger files |
Nested objects need to be "flattened" into columns first, or a naive converter will print the JavaScript default string for an object — literally the text "[object Object]" — instead of the actual values. This tool flattens nested keys into dot-notation columns automatically (e.g. {"user":{"name":"Ann"}} becomes a column named user.name), and lets you switch to a shallow (1-level) or off (raw JSON text per cell) mode if you want the original structure preserved instead.
For a flat list of objects, pandas.json_normalize(data) followed by .to_csv("out.csv", index=False) handles nested keys the same way this tool does — dot-notation columns. For simple flat lists, csv.DictWriter with the union of all keys as fieldnames also works, but you have to flatten nested dicts yourself first or you'll get the same "[object Object]"-style problem (Python's version is the dict's repr string).
Excel has no built-in CSV-to-JSON export. Power Query (Data > Get Data > From Text/CSV, then Close & Load To > only create connection, then use the Advanced Editor) can produce a JSON-like table, but it's a multi-step detour for something a browser tool does in one paste. This page reads the CSV, detects the delimiter, and gives you a downloadable .json file directly.
If every element of the array is an object, each object becomes one CSV row and the union of all keys (in first-appearance order) becomes the columns — rows missing a given key just get an empty cell. If the array is itself an array of arrays (e.g. [[1,2],[3,4]]), you choose whether the first inner array is a header row or whether to generate generic column names. Paste the array into this tool and it detects which case you're in.
CSV itself has no data types — every cell is text (RFC 4180 doesn't define one). This tool's "infer types" option (on by default) turns a cell like 42 into the JSON number 42, true/false into JSON booleans, and a blank cell into JSON null, while leaving everything else as a string. Turn it off if your data has meaningful leading zeros (like ZIP codes or IDs) that should stay text — this tool already skips inferring numbers with a leading zero for that reason.