Data

JSON to CSV

Convert JSON arrays to CSV

Loading interactive tool…

Embed this tool on your site

About this tool

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. Converting by hand is tedious and error-prone: 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 comma-separated CSV as you type. Column headers are derived from all keys found across the dataset so no field is silently omitted, and records missing a key get an empty cell. Values containing commas, quotes or line breaks are quoted per RFC 4180. Keep each record flat: nested objects are not flattened and appear as [object Object]. Load example fills in a small sample, Beautify JSON tidies your input, and the CSV can be copied or downloaded.

Why use it

  • 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.

  • Live Conversion: The CSV output updates on every keystroke, so you can fix a JSON typo and see the result immediately without pressing a button.

  • Copy or Download: Copy CSV puts the output on your clipboard and Download CSV saves it as converted.csv, ready to open in a spreadsheet.

  • 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

  1. Paste a JSON array of objects into the JSON input box — each object becomes one CSV row
  2. Watch the CSV output update as you type, with headers built from every key in the data
  3. Use Beautify JSON to re-indent your input, or Load example to try a sample
  4. Fix any 'Invalid JSON' message shown under the input
  5. Click Copy CSV, or Download CSV to save converted.csv, then open it in Excel, Google Sheets, or your data tool

When it helps

  • 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"}]
Expected result
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"}]
Expected result
id,name,email
1,Alice,alice@x.com
2,Bob,

Value with comma quoted

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

Tips

  • Open a shareable sample with ?example=people in the address bar, or click Load example, to see the expected input shape.
  • Flatten nested objects into top-level keys (for example address_city) before converting, since nested values are not expanded into columns.
  • If your spreadsheet expects semicolons, use its text import wizard and choose comma as the delimiter for this file.
  • 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?
A JSON array of objects at the top level, such as [{"id":1},{"id":2}]. A single object, an array of primitives like [1,2,3], or an array containing nested arrays shows the error 'Use an array of objects.'
How are nested objects handled?
They are not flattened. A nested object is written as the text [object Object], and an array value is written as its items joined by commas (quoted, because it contains commas). Flatten nested data before converting if you need separate 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. Values containing commas, double-quotes or newlines are quoted per RFC 4180, and Unicode text is kept as-is. The downloaded file is plain UTF-8 without a byte order mark.
Why does Excel show garbled text when I open the CSV?
Excel may not detect UTF-8 encoding automatically. Import via Data > From Text/CSV and choose UTF-8 encoding in the wizard, or open the file in Google Sheets, which reads UTF-8 by default.
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.
Can I choose a semicolon or tab delimiter?
No. The output always uses commas. If your spreadsheet locale expects semicolons, import the file through your spreadsheet's text import wizard and pick comma as the delimiter.

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.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities