# JSON to CSV

Convert a JSON array to CSV you can open in Excel or Sheets. Columns come from every record, not just the first. Nothing is uploaded.

Canonical page: https://filetity.com/json-to-csv

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: JSON in, as an array of objects or an array of arrays. CSV out, with a comma, semicolon or tab separator and a header row you can turn off.
- Limits: Held in memory, so a few tens of megabytes is comfortable. Nested objects and arrays have no CSV representation and are written as JSON text inside the cell rather than being flattened into invented column names.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### What happens to nested objects inside my JSON?

They are written into the cell as JSON text. The alternative is inventing column names like address.city.postcode, which looks tidy until two records nest differently and the header grows a column nobody asked for. Keeping the JSON in the cell is lossless and reversible, and you can flatten deliberately before converting if that is what you want.

### Why do my columns come from every record and not the first?

Because an API that omits a null field would otherwise lose it. If record one has no middle name and record two does, taking the header from record one drops that column for the whole file. Every key seen anywhere becomes a column, in the order it was first encountered, and records missing it get an empty cell.

### Why is a value starting with = escaped in the download?

Because Excel and Google Sheets treat a leading equals, plus, minus or at sign as the start of a formula, and will run it when the file is opened. A cell containing =1+1 becomes 2, and a hostile one can do considerably worse. The download prefixes those cells so they open as the text you actually had. You can turn it off if you are feeding the file to a program rather than a spreadsheet.

### Does it quote every field?

Only the ones that need it: a field containing the separator, a double quote, a carriage return, a line feed, or a leading or trailing space. Quoting everything is valid CSV and every parser accepts it, but it makes a file that is unpleasant to read in a text editor and to diff in git, and the point of CSV is that it is plain.

### Can I use a semicolon instead of a comma?

Yes, and you may have to. Excel reads the separator from your Windows or macOS regional settings, so on a machine where the decimal separator is a comma, a comma separated file opens as one column. Pick semicolon in that case, or tab, which every spreadsheet reads the same way everywhere.

## Related tools

- [CSV to JSON](https://filetity.com/csv-to-json): Turn a CSV or TSV file into JSON, as an array of objects or as rows.
- [JSON Formatter and Validator](https://filetity.com/json-formatter): Format, beautify, validate and read JSON, and find the line that broke it.
