UtilityKit

500+ fast, free tools. Most run in your browser only; Image & PDF tools upload files to the backend when you run them.

JSON to CSV

Convert JSON arrays to CSV

About JSON to CSV

JSON is the language of APIs but CSV is the language of spreadsheets, data analysis tools, and bulk import wizards. When you pull a list of records from an API or a database export and need to load it into Excel, Google Sheets, or a Python pandas DataFrame, you need clean comma-separated values with a proper header row. Flattening JSON arrays to CSV by hand is tedious and error-prone: nested objects get dropped, field order shifts between records, and special characters in string values break parsers that do not handle quoting correctly. This tool takes a JSON array of objects and converts it to a well-formed CSV file instantly. Column headers are derived from all keys found across the dataset so no field is silently omitted. Nested values are optionally flattened or stringified.

Why use JSON to CSV

Full Header Coverage

Column headers are derived from the union of all keys found across every object in the array, not just the first record. Fields that appear in some records but not others are included and left blank for the rows where they are absent.

RFC 4180 Quoting

String values that contain commas, double-quotes, or newlines are correctly wrapped in double-quotes with internal quotes escaped. This prevents silent data corruption when opening the file in Excel or importing into a database.

Nested Object Handling

Nested JSON objects can be flattened using dot-notation column names like address.city, or serialized as JSON strings if the structure is too deep to flatten meaningfully. You choose the strategy that fits your analysis workflow.

Delimiter Flexibility

Switch between comma, semicolon, or tab delimiters with a single click. European locales that use comma as a decimal separator often require semicolon-delimited CSV, and tab-delimited format works well for copy-paste into spreadsheets.

Instant Preview

The first few rows of the generated CSV are shown in a preview table so you can verify column alignment and value formatting before downloading the full output. Catch structural issues before loading into your data tool.

Browser-Local

Conversion runs entirely in your browser. Sensitive API exports, customer records, and financial data stay on your machine and are never uploaded to a server.

How to use JSON to CSV

  1. Paste a JSON array of objects into the input editor — each object becomes one CSV row
  2. Review the detected column headers derived from all keys in the dataset
  3. Choose how to handle nested objects: flatten with dot notation or stringify as JSON
  4. Set your preferred delimiter (comma, semicolon, or tab) to match your target application
  5. Click Convert to generate the CSV output with a header row
  6. Copy or download the result and open it in Excel, Google Sheets, or your data tool

When to use JSON to CSV

  • You need to load an API response into Excel or Google Sheets for analysis or reporting
  • You are preparing a bulk data import for a CRM, e-commerce platform, or database that accepts CSV uploads
  • You pulled records from a REST API and want to hand off a spreadsheet to a non-technical colleague
  • You are feeding JSON data into a Python pandas script that reads CSV more conveniently than JSON
  • You need to export a subset of records from a JSON data store to a flat format for archiving
  • You are debugging a data pipeline and want to inspect record-level values in a spreadsheet view

Examples

Simple array to CSV

Input: [{"id":1,"name":"Alice","role":"admin"},{"id":2,"name":"Bob","role":"user"}]

Output: id,name,role 1,Alice,admin 2,Bob,user

Sparse fields handled

Input: [{"id":1,"name":"Alice","email":"alice@x.com"},{"id":2,"name":"Bob"}]

Output: id,name,email 1,Alice,alice@x.com 2,Bob,

Value with comma quoted

Input: [{"id":1,"address":"12 Main St, Suite 4"}]

Output: id,address 1,"12 Main St, Suite 4"

Tips

  • Always preview the first few rows before downloading to catch header mismatches or encoding issues early.
  • If a column contains long JSON strings after flattening, consider extracting nested arrays to a separate CSV joined on an ID column instead.
  • Use the semicolon delimiter when importing into German, French, or Italian Excel — those locales treat commas as decimal separators.
  • Strip null values from records before converting if your target system does not tolerate empty cells in mandatory columns.
  • For recurring exports, automate the conversion with a jq one-liner: jq -r '(.[0]|keys_unsorted) as $k | $k,(.[]|[.[$k[]]])|@csv'.

Frequently Asked Questions

What input shape does the tool expect?
The tool expects a JSON array of objects at the top level, such as [{"id":1},{"id":2}]. A single object is also accepted and produces a one-row CSV. Primitive arrays like [1,2,3] produce a single-column file.
How are nested objects handled?
Nested objects can be flattened to dot-notation columns (address.city) or serialized as JSON strings. Arrays within objects are serialized as JSON strings by default since they cannot map cleanly to flat columns.
What happens when records have different keys?
The tool unions all keys found across every record to build the header row. Records missing a key get an empty cell in that column, which is the correct behaviour for sparse data.
Does it handle special characters and Unicode?
Yes. The output is UTF-8 encoded. Values containing commas, double-quotes, newlines, or multibyte characters are correctly quoted per RFC 4180.
Why does Excel show garbled text when I open the CSV?
Excel may not detect UTF-8 encoding automatically. Add a UTF-8 BOM (byte order mark) at the start of the file, or import via Data > From Text/CSV and choose UTF-8 encoding in the wizard.
Can I convert back from CSV to JSON?
Yes — UtilityKit's csv-to-json tool handles that direction, automatically detecting headers and producing a JSON array of objects.
What is the maximum size the tool can handle?
The tool is browser-based and handles typical API export sizes (tens of thousands of rows) without issues. Very large files above a few MB may slow down the browser tab; for those use a command-line tool like jq or csvkit.
How do I choose between comma, semicolon, and tab delimiters?
Use comma for most English-locale tools. Use semicolon for European tools where the comma is the decimal separator. Use tab when pasting directly into a spreadsheet, since tab-separated values paste into separate cells without needing an import dialog.

Explore the category

Glossary

CSV
Comma-Separated Values — a plain-text format where each line is a record and fields within a line are separated by a delimiter, typically a comma. Defined by RFC 4180.
RFC 4180
The informal standard that defines CSV formatting rules, including that fields containing commas or quotes must be enclosed in double-quotes and internal double-quotes must be doubled.
Header row
The first line of a CSV file that contains column names. Most data tools and spreadsheet applications use the header row to label columns during import.
Delimiter
The character that separates fields within a CSV record. Common delimiters are comma (,), semicolon (;), and tab (\t). The choice depends on the locale and target application.
Flattening
The process of converting a nested JSON object into a flat key-value structure by concatenating nested keys with a separator like a dot. For example, {address:{city:'NYC'}} flattens to address.city: NYC.
Sparse data
A dataset where not all records have the same set of keys. CSV handles sparse data by including all possible column headers and leaving cells empty for records that lack a given field.