About the JSON to CSV Converter
API responses and exported data usually arrive as JSON, but colleagues, clients and accountants want something they can open in Excel or Google Sheets. This tool will convert JSON to CSV from an array of objects, flattening nested fields into dotted column names such as address.city, collecting every key that appears into the header row and quoting values safely. You can choose commas, semicolons or tabs, and download a file that opens correctly in Excel, including non-English characters. It is the bridge between a developer's data and a spreadsheet user. To go the other way, use CSV to JSON, and to explore complex JSON first, the JSON Viewer.
Two things make this conversion harder than it first appears, and both are dealt with. First, JSON records do not have to share the same fields: one customer has a second phone number and the next does not. The header is built from every key found in any record, so nothing vanishes, and a record that lacks a field simply leaves that position blank instead of pushing its other values into the wrong columns.
Second, JSON can be nested while a spreadsheet is flat. An object inside another object is flattened into a column whose name joins the keys with dots, which is how a city stored inside a user's address ends up under the heading user.address.city. Lists can either be spread across numbered columns or joined into a single cell, whichever suits the spreadsheet you are building.
Values are quoted wherever the CSV rules require it. Any cell containing a comma, a quotation mark or a new line is enclosed in quotes with its inner quotes doubled, so the file opens with every value in the right column. The conversion happens entirely on your own device, which makes it suitable for client lists, order exports and internal data you would never paste into a public website.
How to use the JSON to CSV Converter
- Paste the JSONUsually a list of objects, though a single object works as well.
- Decide how to treat nestingFlatten it into dotted column names, or keep nested values as JSON text in one cell.
- Choose the separatorComma, semicolon or tab, depending on what your spreadsheet expects.
- Get the CSVCopy it, or download a file that opens straight in a spreadsheet.
JSON to CSV Converter features
- Headings collected from the keys of all records together
- Nested objects flattened into dotted column names
- Lists spread over numbered columns or joined in one cell
- Correct quoting for commas, quotation marks and line breaks
- Comma, semicolon or tab separators
- Parse errors that point to the problem
- Conversion carried out in your browser
Common uses
- Getting the results of an API call into a spreadsheet
- Sharing data with someone who cannot read JSON
- Preparing a file for a bulk upload form
- Reviewing a JSON export in a familiar table layout
- Turning application log entries into a quick report
JSON to CSV in practice: API exports for spreadsheets, Urdu text in Excel, very large IDs, one row per item and formula injection
Turning API data into a spreadsheet is one of the most common requests a developer receives from colleagues in sales, finance and operations. The conversion is quick, but the result has to survive being opened in Excel, which brings its own surprises. This guide works through exporting orders from an API, then covers Urdu text, big numbers, dates, choosing between one row per order or per item, and a security issue many exports overlook.
A worked example: orders from an API
An API returns orders like this:
[{"id": "1042", "customer": {"name": "Ayesha", "city": "Lahore"}, "total": 3450}]
Converted to CSV, the nested customer object becomes two columns, customer.name and customer.city, beside id and total. For a finance colleague, renaming the headers to Order ID, Customer, City and Total in rupees makes the sheet immediately readable, and placing the identifier first makes sorting and lookups easier.
Urdu text in Excel
Excel on Windows may display Urdu names as garbled characters when it opens a UTF-8 CSV file without a byte order mark. Saving the file with a byte order mark, sometimes labelled UTF-8 with BOM, usually makes Excel read it correctly. Many import systems prefer files without one, so keep the version for people and the version for machines separate.
Very large numbers
JavaScript can represent whole numbers exactly only up to 9,007,199,254,740,991. Larger IDs in JSON, which some platforms use for orders and messages, may lose their last digits as soon as the JSON is parsed, before any CSV is written. This is why many APIs also send IDs as strings, and those string versions should be used. Spreadsheets add a second limit by keeping only 15 significant digits, so long IDs should stay as text throughout.
Dates and time zones
APIs usually send timestamps such as 2026-10-25T14:30:00Z, where Z means UTC. Spreadsheets may not recognise this format as a date, and colleagues in Pakistan will read the time as five hours early unless it is converted to local time. Converting timestamps to a plain local date and time, and stating the time zone in the header, prevents misread reports.
One row per order or one row per item
An order containing several products can become one row with the items joined in a single cell, or several rows, one per item, each repeating the order details. The first suits order counts and totals, while the second suits product analysis, such as which items sell best. For one row per item, restructure the JSON first so each item is its own object carrying the order ID, then convert.
Formula injection
Spreadsheet programs treat cells beginning with an equals sign, plus, minus or @ as formulas. If an export includes text typed by users, such as names or comments, a malicious value can run a formula when a colleague opens the file. Exports of user-supplied data should neutralise such values, commonly by adding a leading apostrophe, before the file is shared.
Checking the export
Before sending the file, open it the way the recipient will, in the same spreadsheet program, and check a few rows against the original data. Look at totals, dates and any column with leading zeros. A two-minute check prevents a report being built on silently corrupted numbers.
Common mistakes
- Parsing very large numeric IDs and losing their final digits.
- Leaving UTC timestamps unconverted for local readers.
- Sharing exports of user text without guarding against formulas.
- Sending developer-style column names to non-technical colleagues.
Related tools
To inspect the result as a table, use CSV Viewer. To explore the source data first, try JSON Viewer, and to convert in the other direction, CSV to JSON Converter.
Amounts in the smallest unit
Some payment and accounting APIs send money as whole numbers of the smallest currency unit, so 345000 may mean Rs 3,450.00 in paisa. Exporting these values unchanged makes every total in the spreadsheet a hundred times too large. Check the API documentation for the unit used and convert amounts before sharing the file with colleagues.
True, false and empty values
JSON true and false values appear in CSV as text, and spreadsheets may convert them to their own TRUE and FALSE values or leave them as words. Null values usually become empty cells. For readers outside the development team, converting these to Yes, No and a clear word such as Not set often makes reports easier to understand.
Paginated API results
APIs usually return results in pages, such as 100 records at a time, with a link or token for the next page. Converting only the first response produces an export that looks complete but is not. Combine every page before converting, and compare the number of rows with the total count reported by the API.
Regular exports
If the same export is needed every week or month, a short script that fetches, converts and saves the file is more reliable than repeating the steps by hand. Many platforms also offer their own scheduled CSV exports. Manual conversion remains ideal for one-off requests, investigations and checking what an API actually returns.
Privacy
Conversion runs entirely in your browser. Order data, customer details and other JSON are not uploaded or stored.
Further reading: JSON for Beginners: Syntax, Common Errors and Formatting.
Frequently asked questions
What kind of JSON does the converter expect?
A list of objects, which is what most API endpoints return when they list records. A single object becomes a CSV with one data row, and a list of plain values such as numbers or names becomes a single column.
How are nested objects handled?
They are flattened into column names joined with dots, so a city inside an address becomes the address.city column. If you would rather keep the structure, switch flattening off and the whole nested value is stored, as JSON, inside one cell.
What if my records do not all have the same fields?
The columns are taken from every key that appears in any record, so no field is lost. Where a record lacks one of them, that spot is left blank, and its other values stay in their proper places.
Why does Excel put all my data into one column?
That is almost always a separator mismatch. Excel installations set up for many European countries expect semicolons rather than commas, so choose semicolon as the separator and the file will open with proper columns.
Are commas inside values a problem?
No. Any value containing a comma, a quotation mark or a line break is wrapped in quotes and escaped as the CSV convention requires, so it stays in its own cell when the file is opened.
Is my JSON uploaded during conversion?
No. The conversion runs in your browser, which is why it is safe to use with production data, customer records or anything else that should not be shared with an outside service.