JSON to CSV Converter

How to use 3 steps
  1. Paste your JSON.
  2. Pick the Delimiter, how Nested values are handled, and the header and quoting options.
  3. Press Convert, then Copy or Download CSV.
An array of objects, an array of arrays, or a single object. Nested objects are flattened.
CSV

Columns are the union of every key, in the order they are first seen, so records with missing keys still line up. Fields containing the delimiter, a quote or a line break are quoted and inner quotes are doubled, per RFC 4180. Formula neutralisation prefixes a value with an apostrophe so a spreadsheet treats =SUM(A1) as text rather than running it.

How this tool works

JSON is what APIs return; CSV is what spreadsheets open. The conversion is straightforward while the JSON is a flat array of objects with matching keys, and stops being straightforward the moment records nest, keys differ between records, or the data contains commas, quotes and line breaks, which real data always does.

Keys do not have to match across records: every key encountered becomes a column, and cells are left empty where a record lacks one, rather than dropping the column or failing. Everything runs on your device, which matters when the payload holds customer records, tokens or internal identifiers.

The options that decide whether Excel opens it properly

  • Delimiter: comma is standard but wrong across much of Europe, where a comma is the decimal separator and Excel expects semicolons. Otherwise every row lands in a single column.
  • Add a UTF-8 BOM: this is the fix for accented characters arriving as gibberish. Excel does not assume UTF-8 and guesses without it.
  • Neutralise spreadsheet formulas: a security measure rather than a formatting one. A cell beginning with = or + is executed by Excel, so anything derived from user input should keep this switched on.
  • Nested values: flatten them to dotted columns when you want to filter and sort them, or keep them as JSON in one cell when the payload should survive intact.

Why convert JSON to CSV?

JSON is what APIs return. CSV is what spreadsheets open. Almost every conversion between the two starts with the same problem: someone has a JSON response from an API, an export from a database or a log file, and they need it in Excel, Google Sheets or a BI tool that has never heard of a nested object.

The conversion is straightforward when the JSON is a flat array of objects with identical keys. It stops being straightforward the moment records nest, keys differ between records, or the data contains commas, quotes and line breaks — which real data always does.

What the converter accepts

The [msm_tool slug="json-to-csv"] accepts any of these shapes:

  • An array of objects — the common API response shape. Each object becomes a row and each key becomes a column.
  • An array of arrays — already row-shaped, converted directly.
  • A single object — converted to one row.

Keys do not have to match across records. The converter collects every key it encounters and leaves cells blank where a record does not have that key, rather than dropping the column or failing.

Handling nested objects

Nesting is where most converters either give up or quietly mangle the data. You get two options.

Flatten to dotted columns walks into nested objects and builds column names from the path. A record like {"user":{"name":"Ada","city":"London"}} becomes two columns, user.name and user.city. This is usually what you want, because the result is genuinely tabular and every value is filterable and sortable in a spreadsheet.

Keep as JSON in one cell leaves the nested structure serialised inside a single cell. Useful when the nested part is a payload you want to preserve intact rather than analyse — for example a settings blob you intend to feed back into another system.

The four options that decide whether Excel opens your file correctly

Delimiter

Comma is standard, but it is the wrong choice in much of Europe. In locales where the comma is the decimal separator, Excel expects semicolon-delimited files and will otherwise cram every row into a single column. Tab and pipe are the safest choices when your data itself contains punctuation.

Add a UTF-8 BOM

This is the fix for the single most common complaint about CSV files: accented characters and non-Latin scripts arriving as mojibake when opened in Excel. Excel does not assume UTF-8, and without a byte order mark it guesses — usually wrongly. If your data contains anything beyond plain ASCII, turn this on.

Quote every field

By default only fields that need quoting get it. Quoting everything produces a larger file but removes any ambiguity, which some strict parsers prefer.

Neutralise spreadsheet formulas

This one is a security control rather than a formatting preference, and it deserves its own section.

CSV injection, and why the formula option matters

If a cell value begins with =, +, - or @, Excel and Google Sheets interpret it as a formula rather than as text. That is a genuine attack path: an attacker who can get text into your database — through a signup form, a support ticket, a product review — can plant a value that executes when someone exports the data and opens it in a spreadsheet. The technique is well documented and is usually called CSV injection or formula injection.

Enabling Neutralise spreadsheet formulas prefixes those values so the spreadsheet treats them as plain text. If the JSON you are converting contains anything that originated from user input, leave this on. The cost is a harmless prefix on a handful of cells; the alternative is executing a stranger's formula on your machine.

How to convert JSON to CSV

  1. Paste your JSON into the input box.
  2. Choose a delimiter, and decide how nested values should be handled.
  3. Set the header row, quoting, BOM and formula options to suit where the file is going.
  4. Convert, then copy the result or download it as a .csv file.

Everything runs in your browser. The JSON is not uploaded, which matters when you are converting an API response that contains customer records, tokens or internal identifiers.

Frequently Asked Questions

Specific to the JSON to CSV Converter. Broader questions about this category are answered on the category page.

Paste the array in and convert it. An array of objects is the ideal input — each object becomes a row, and the column headers are taken from the union of all keys found across the records.
Nested structures are either flattened into dotted column names or preserved as JSON inside a single cell, depending on the option you choose. There is no universally correct answer, which is why it is a choice rather than a default.
Because Excel is not reading the file as UTF-8. Enable the BOM option and reopen the file; the characters will display correctly.
Your Excel locale expects a different delimiter than the one used in the file. Switch the delimiter to semicolon and try again, or use Excel's Text Import Wizard and set the delimiter manually.
There is no fixed limit, but conversion happens in your browser's memory, so very large files are constrained by your device rather than by a server quota. For multi-megabyte exports, a scripted conversion is usually a better fit than a browser tool.
No. The conversion runs entirely in JavaScript on your device. Nothing is uploaded, logged or stored.

Subscribe to receive notifications about new tools, features, and productivity tips.