JSON Tools

JSON to CSV Converter

Convert a JSON array of objects into CSV for spreadsheets.

Browser workspace
LOCAL PROCESSING

Input stays in this browser while you use the tool.

About this tool

The JSON to CSV Converter turns JSON data into CSV, a plain-text table format that opens in Excel, Google Sheets, LibreOffice and most database and analytics tools. You paste a JSON array in which each item is an object, and the tool returns a table: one header row with the key names, followed by one row for every object.

The two formats are built for different jobs. JSON is a flexible format that APIs use, and it can hold nested objects and lists of different shapes. CSV (comma-separated values) is flat and simple: every line is a row, and every value in a row is separated by a comma. Converting JSON to CSV is therefore useful when you want to look at API data in a spreadsheet, filter and sort it, make a chart, send it to a colleague who does not work with JSON or load it into a database.

JSON that is already a flat list of records converts cleanly. Complex data needs more care. A value that contains a comma, a quotation mark or a line break must be wrapped in double quotes, and a quotation mark inside it is written twice, which is how the CSV format keeps one value from spilling into the next. Nested objects and arrays do not fit into a single cell, so tools handle them by flattening the keys, for example address.city, or by writing the nested part as JSON text. The tool you use decides which of these happens, so check the result for any nested fields.

The conversion runs in your browser, so your data is processed on your own device and is not sent to the BitToolsKit server.

Use cases

  • Open API data in a spreadsheet. Copy a JSON response, convert it and view, filter and sort the records in Excel or Google Sheets.
  • Share data with people who do not use JSON. A CSV file is easier for colleagues, clients and non-technical teams to open and understand.
  • Export records for reports and charts. Turn a list of orders, users or events into a table for a report, a pivot table or a chart.
  • Load data into a database or an analytics tool. Many importers, such as those of SQL databases, CRM systems and mailing tools, accept CSV directly.
  • Prepare a mailing or import list. Convert a list of contacts or products into the CSV layout that an import form expects.
  • Check the shape of your data. Seeing JSON as rows and columns makes it easy to spot missing fields, empty values and inconsistent records.
  • Compare datasets. Convert two JSON exports to CSV and compare them in a spreadsheet, or put them through a text diff to find the rows that changed.
  • Clean up test and sample data. Turn mock API data into a CSV fixture for a test, a demo or a tutorial.

How to use

  1. Paste your JSON into the Input box. The simplest and most reliable input is an array of objects, such as [{"id":1,"name":"Ada"},{"id":2,"name":"Bob"}].
  2. Click Run tool.
  3. Read the CSV in the Output box. The first line holds the column names and every following line is one record.
  4. If a message appears instead of a result, the input is not valid JSON or does not have the expected shape. Fix the problem with the help of the common errors below and run the tool again.
  5. Check the result for nested fields, empty cells and values that contain commas or quotation marks.
  6. Click Download to save the result as a file, or Copy output to paste it into another program. Click Clear to start again.

To open the file in Excel, use the data import feature of the program (in Excel: Data, then From Text/CSV) and choose UTF-8 as the encoding. Opening the file by double-clicking can garble accented letters or change numbers and dates.

Examples

Example 1: A simple array of objects

Input (JSON):
[{"id":1,"name":"Ada","city":"London"},{"id":2,"name":"Bob","city":"Paris"}]
What a converter produces (CSV):
id,name,city
1,Ada,London
2,Bob,Paris

Example 2: Values with a comma and a quotation mark

Input (JSON):
[{"name":"Smith, John","note":"He said \"hi\""}]
What a converter produces (CSV):
name,note
"Smith, John","He said ""hi"""
The value with a comma is wrapped in double quotes, and each quotation mark inside a value is written twice.

Example 3: Records with different keys

Input (JSON):
[{"a":1,"b":2},{"a":3}]
A typical result (CSV):
a,b
1,2
3,
The columns are all keys found in the data, and a missing value becomes an empty cell. How a tool orders the columns can differ.

Example 4: A nested object

Input (JSON):
[{"id":1,"address":{"city":"Lahore"}}]
Depends on the tool:
Some tools flatten the key into a column called address.city with the value Lahore. Others write the whole nested part as JSON text in one cell. Check the output for nested fields, and flatten the data first if you need separate columns.

Example 5: A leading zero lost in Excel

Input (JSON):
[{"zip":"00123"}]
CSV:
zip
00123
The CSV file is correct, but Excel may show the value as 123 when you open the file directly. Import the column as text to keep the zeros.

Example 6: Invalid JSON

Input (JSON):
[{"id":1,}]
No CSV. A message appears because JSON does not allow a comma after the last item. Remove the comma and run the tool again.

Common errors

A message says the JSON is invalid

The input has a syntax error, most often a trailing comma, single quotes, unquoted keys or a missing bracket. Fix it first. The JSON Validator shows where the problem is.

The input is a single object, not an array

CSV needs rows, so the easiest input is an array of objects. If you have one object, wrap it in square brackets: [ { ... } ]. If your data is an object that contains an array, such as {"items":[...]}, copy only the array.

Nested objects or arrays appear as odd text in one cell

A CSV cell can hold only a flat value. Nested parts are either flattened into columns such as address.city or written as JSON text. Flatten the data in advance, or keep only the fields you need.

Some columns are missing or some cells are empty

Records do not all have the same keys. A missing key leaves an empty cell, and a tool that builds the header from only the first record may skip keys that appear later. Check that the header contains every field you need.

A value with a comma splits into two columns in your program

A correct CSV wraps such a value in double quotes. If a program still splits it, it is reading the file with the wrong settings. Import the file with the data import feature and choose the comma as the delimiter and the double quote as the text qualifier.

Excel shows all data in one column

Some regional settings use a semicolon as the list separator, so Excel does not split on commas. Use the import feature and select the comma as the delimiter, or change the separator in your system settings.

Excel changes numbers and dates

Excel converts text that looks like a number or a date. It removes leading zeros from ZIP codes and phone numbers, shows long numbers such as 12345678901234567890 in scientific notation and may turn values like 3-4 into a date. Import the column as text to keep the original value.

Accented letters or other alphabets look garbled

The file is UTF-8, but the program read it with another encoding. Open it with the import feature and choose UTF-8, or use a spreadsheet program that detects UTF-8 on its own.

Values that start with =, +, - or @ are treated as formulas

A spreadsheet can run a cell that begins with one of these characters as a formula. This is called CSV injection. If the data comes from an untrusted source, check such cells, or put a single quote or a space in front of them before opening the file.

null, true and false appear as text

CSV has no data types, so every value becomes text. JSON null usually becomes an empty cell, and true and false become the words TRUE and FALSE or true and false. Convert them in your spreadsheet or import settings if you need a different form.

Frequently asked questions

What is CSV?

CSV stands for comma-separated values. It is a plain-text table in which every line is a row and the values in a row are separated by commas. It is widely supported by spreadsheets, databases and data tools.

What JSON structure converts best to CSV?

An array of objects that all have the same flat keys, such as a list of users or orders. Each object becomes a row, and the keys become the column names.

What happens to nested objects and arrays?

CSV is flat, so nested data does not fit in a cell directly. Tools either flatten the keys into columns such as address.city or write the nested part as JSON text. Check the output, and flatten the data first if you need separate columns.

What if my objects have different keys?

The CSV needs a column for every key that appears in the data. Records that lack a key get an empty cell. If the header is built from the first record only, keys that appear later can be missing, so check the header.

How does CSV handle commas, quotation marks and line breaks inside a value?

A value that contains a comma, a quotation mark or a line break is wrapped in double quotes, and any quotation mark inside it is written twice. This is the common rule for CSV, so spreadsheets can read the value correctly.

Why does Excel change my numbers and dates?

Excel converts text that looks like a number or a date when it opens a CSV file directly. Leading zeros disappear and long numbers can turn into scientific notation. Import the file with Data, From Text/CSV and set those columns to text.

Why are accented letters garbled in Excel?

The file is saved as UTF-8, while Excel may assume another encoding when you open it by double-clicking. Import it with the data import feature and choose UTF-8.

Is CSV a safe format for data from an unknown source?

A spreadsheet can treat a cell that starts with =, +, - or @ as a formula, which can be abused. If the data comes from an untrusted source, check those cells before you open the file in a spreadsheet.

Can I convert a large JSON file?

Very large inputs can be slow because the conversion happens in your browser. For files of many megabytes, a command-line tool such as jq or a script is a better choice.

Is my data uploaded to a server?

No. The tool runs in your browser and works on your device. As a general habit, avoid pasting passwords, API keys or private tokens into any online tool.

Related tools

Share this page