Skip to content
TextBench Lab

JSON to CSV Converter

Turn a JSON array, a single object or JSON Lines into a CSV table for Excel, Google Sheets or a database. Nested objects become columns, and you choose the delimiter and columns. It runs in your browser, so nothing is uploaded.

.json or .jsonl up to 2 MB, read in your browser. Pasted text up to 500,000 characters.
Nested data
CSV format

Excel-safe puts a ' before text that starts with = + - or @, so a spreadsheet never runs it as a formula.

Rows
0
Columns
0
Characters
0

Preview

The table appears here.

How to convert JSON to CSV

  1. Paste JSON or choose a file

    Paste an array, an object or JSON Lines, or choose a .json or .jsonl file up to 2 MB. It is read in your browser.

  2. Check the preview

    The table shows the first 20 rows. If the JSON is invalid, the line and column of the problem are shown.

  3. Set nested data and columns

    Choose the flatten depth and how arrays are written, then untick any columns you do not need.

  4. Pick the CSV format and save

    Choose the delimiter and line ending, then copy the CSV or download a .csv file, with a BOM for Excel if you like.

Features

  • Nested JSON and JSON Lines

    Nested objects become dot columns like user.address.city. JSON Lines files are detected by themselves.

  • Exact numbers

    Every number is written exactly as in your JSON, even IDs longer than JavaScript can hold.

  • Ready for Excel

    Comma, semicolon, tab or pipe, an optional BOM, and an Excel-safe mode against formula injection.

  • Private

    The conversion runs in your browser. Your data is never uploaded or stored.

What this converter does

JSON is how most APIs, apps and exports hand over data. It suits programs, but you cannot sort or filter it in a spreadsheet. CSV is a plain table that Excel, Google Sheets and almost every database can open. Paste JSON or choose a file, check the preview, and copy or download the CSV. Everything happens in your browser.

Shapes it understands

  • An array of objects. The most common case. Each object becomes a row and each key becomes a column.
  • A single object. It becomes one row. If the object holds a list of records, as many API responses do with something like "data": [...], the tool uses that list as the rows and tells you so. Under Rows from you can pick another list or the whole object.
  • JSON Lines. A file with one JSON record per line, often called .jsonl or NDJSON, is common for logs and data exports. It is detected by itself, so you do not have to choose a mode.
  • Plain values. A list of numbers or strings becomes a single column called value.

Nested objects and arrays

A table is flat, but JSON often is not. The converter flattens nested objects with dot names, so a customer's city lands in a column called address.city. Flatten depth sets how many levels may join in a column name. At depth 1 only the top-level keys become columns and anything deeper is written into the cell as compact JSON text, which is handy when you only need a few main fields.

Arrays need a decision, because a list of tags does not fit in one cell by default. You have three choices:

  1. Join into one cell, for example admin; editor. Good for short lists of words.
  2. One column per item, such as tags.0 and tags.1. Good when every record has the same few items. Objects inside the array are flattened further, so you get columns like items.0.price.
  3. Keep as JSON text. The cell holds the array exactly as JSON, ready to be parsed again later.

Records with different keys

Real data is rarely tidy: one record has a phone number and the next one does not. Every key found in any record becomes a column, so no value is lost, and a record without that key gets an empty cell. Columns appear in the order they are first seen, or in natural alphabetical order, where tags.2 comes before tags.10. Open Columns to untick the ones you do not need.

Choosing the CSV format

The common format is described in RFC 4180: commas between fields, a line break after every row, and double quotes around any field that contains a comma, a quote or a line break, with a quote inside a field written twice. The tool follows these rules by default and uses CRLF line endings, as the RFC does.

You can change the details when the program that reads the file expects something else:

  • Semicolon. In countries that write decimals with a comma, such as Germany or France, Excel often expects semicolons between fields.
  • Tab. Tab-separated text pastes straight into spreadsheet cells.
  • Pipe. Useful when the data itself is full of commas and semicolons.
  • Quote every field, for strict importers, and LF line endings for Mac and Linux tools.

If accented letters or non-Latin text such as Urdu look broken after you open the file in Excel, tick Add a BOM to the download. The byte order mark at the start of the file tells some versions of Excel that the file is UTF-8. Copy never adds it.

Excel-safe mode and formula injection

A spreadsheet treats a cell that starts with =, +, - or @ as a formula. If your data comes from other people, a value like =HYPERLINK(...) could run when someone opens the file. This is known as CSV injection or formula injection. With Excel-safe on, such text gets a single quote in front, so the spreadsheet shows it as plain text. Real JSON numbers, including negative ones, are never changed.

Big numbers stay exact

JavaScript holds whole numbers exactly only up to 9,007,199,254,740,991. Converters that use the browser's built-in JSON reader quietly change a longer ID such as 12345678901234567890 into a different number. This tool reads the JSON itself and writes every number exactly as written, and a note tells you when it found numbers above that limit.

When the JSON is invalid

If the input is not valid JSON, you get the line and column of the problem and a plain reason: a trailing comma, single quotes, a missing comma, a comment, or a key without quotes. Tidy it with the JSON formatter, and see how to fix the most common JSON errors or what an Unexpected token error means.

Privacy and limits

Your JSON is not uploaded, saved or tracked. Pasted text is limited to 500,000 characters, files to 2 MB and tables to 2,000 columns, so the page stays fast. Large results show a preview, while Copy and Download give the full CSV. Like every page on this site, this one may show ads from third-party vendors once ads are switched on, and those vendors can use cookies. Read the privacy policy for details.

Frequently asked questions

How does the converter handle nested JSON?

Nested objects become columns with dot names, like user.address.city. Lower the flatten depth to keep deep parts as JSON text in one cell instead.

What happens to arrays inside my objects?

You choose: join the values into one cell with a separator, give each item its own column (tags.0, tags.1), or keep the whole array as JSON text.

My objects have different keys. Is that a problem?

No. Every key found in any row becomes a column, and a row without that key gets an empty cell. You can sort the columns by first appearance or alphabetically.

Why do accents look wrong when I open the CSV in Excel?

Some Excel versions read a CSV in an older encoding. Tick Add a BOM before you download, or import the file with UTF-8 chosen, and the text shows correctly.

What does Excel-safe do?

Text that starts with =, +, - or @ can run as a formula in a spreadsheet. Excel-safe puts a ' in front of such text, so it is shown as plain text.

Is my data uploaded?

No. Everything happens in your browser. Pasted text is limited to 500,000 characters and files to 2 MB, so the page stays fast.