Free ToolsOnline Toolkit
All ToolsBlogDeveloperCalculatorsDocumentsAboutFAQContact
Home
Tools
JSON to CSV

JSON to CSV Converter — Free Online JSON Array to Spreadsheet Tool

Convert JSON array data to CSV format instantly. Paste your JSON array and get comma-separated output ready for Excel, Google Sheets, or any spreadsheet app.

About JSON to CSV

JSON to CSV transforms structured data into spreadsheet-ready format for data analysts, business intelligence teams, and developers. Convert API responses or data exports to CSV instantly for analysis in Excel, Google Sheets, or data visualization tools.

How to use this tool

  1. Paste a JSON array of objects into the text area — each object should have the same keys.
  2. Click "Convert to CSV" to parse the JSON and generate comma-separated output.
  3. The tool extracts headers from the first object and handles commas and quotes in string values automatically.
  4. Review the CSV output in the preview area below.
  5. Click "Copy" to copy the CSV to your clipboard, or "Download" to save it as data.csv.

Example

Input

[{"name":"Alice","age":30},{"name":"Bob","age":27}]

Output

name,age
Alice,30
Bob,27

Tool guide

Flattening nested JSON for tabular output

JSON is hierarchical (objects nested within objects), while CSV is strictly two-dimensional (rows and columns). Our converter handles nested objects by flattening keys with dot notation (e.g., "address.city" becomes a column header). Arrays within JSON objects are the hardest case — an array of addresses for one user produces either multiple rows (denormalized) or a single JSON-stringified cell. Our tool offers both modes: "expand" creates one row per array element (repeating parent data), and "compact" stores arrays as JSON strings in a single cell.

Large JSON arrays (100,000+ objects) can cause browser memory issues because the entire dataset must be processed client-side. For production ETL pipelines, use a backend tool like jq or a streaming CSV parser. Our tool is best suited for moderate-sized data (up to ~10 MB of JSON) for analysis or import into spreadsheet applications.

CSV encoding pitfalls

CSV has no official encoding standard (RFC 4180 is the closest). Common issues include: values containing commas (must be quoted with ""), values containing double quotes (must be escaped as ""), and multi-line values (must be quoted). Our converter follows RFC 4180 strictly: all cells are properly quoted and escaped. It also detects the delimiter — some systems expect semicolons as delimiters (European locales) — and lets you switch between comma, semicolon, and tab. For Excel compatibility (especially on non-English systems), semicolon-delimited CSV is often required.

Character encoding is another common source of errors. Our converter outputs UTF-8 with BOM, which Excel for Windows uses to correctly detect the encoding. Without the BOM, Excel may interpret UTF-8 text as Windows-1252, mangling special characters like accented letters and em dashes.

How to use the JSON to CSV Tool

Step 1: Paste your JSON data into the input area. The JSON should be an array of objects (like API response data) or a single object that can be flattened into a row.

Step 2: The tool automatically detects the JSON structure and flattens nested objects using dot notation (e.g., "address.city" becomes a column header).

Step 3: Preview the first few rows of the CSV output to verify that columns are correct and data is properly aligned before downloading.

Step 4: Choose the delimiter if needed — comma for standard CSV, semicolon for European locale Excel compatibility, or tab for TSV format.

Step 5: Download the CSV file using the download button, or copy the CSV text directly to paste into Excel, Google Sheets, or your data processing tool.

Step 6: Open the CSV in your spreadsheet application and verify that all columns are present and data types are correct (numbers as numbers, not strings).

Common mistakes and how to fix them

Error: JSON is not an array of objects. The tool works best with JSON arrays like [{"name":"Alice"},{"name":"Bob"}]. A single object or deeply nested structure without a clear tabular shape may not convert correctly.

Error: Inconsistent keys across objects. If some objects have keys that others do not, the CSV fills missing cells with empty values. Review the column list to ensure all expected fields are present.

Error: Excel displays numbers as text. This happens when the CSV lacks a BOM (Byte Order Mark). Our tool outputs UTF-8 with BOM for Excel compatibility. If using another tool, add the BOM prefix.

Error: Commas in data values breaking CSV format. Values containing commas must be enclosed in double quotes in CSV. Our tool follows RFC 4180 and quotes all cells properly to prevent this issue.

Error: Nested arrays producing unexpected output. Arrays within JSON objects can expand to multiple rows or be stored as JSON strings. Choose the expand mode for one row per array element, or compact mode for a single cell.

Tips and best practices

Preview the first 5 rows before downloading the full CSV. This catches unexpected nesting, missing keys, or data type issues that would produce empty or incorrectly formatted columns.

Use semicolon delimiters for European locale Excel installations where commas are used as decimal separators. Comma-delimited CSV may import incorrectly in these locales.

For large JSON datasets (100,000+ objects), consider using a backend tool like jq or a streaming CSV parser. Browser-based conversion may slow down with very large datasets.

After converting, open the CSV and verify that numbers are stored as numbers (not text strings) and dates are in a consistent format. Some spreadsheet applications auto-detect types during import.

When converting API responses, save the raw JSON first, then convert to CSV. This preserves the original data for re-conversion if you need different column layouts or filtering.

Frequently asked questions

Can I convert CSV back to JSON?

Yes, our toolkit includes a CSV-to-JSON converter. The reverse conversion is simpler because CSV has no nesting — arrays and nested objects must be reconstructed from dot-notation headers.

What happens to null values in JSON?

Null values in JSON become empty cells in CSV. If you need to preserve "null" as a literal string, toggle the option to keep nulls as text rather than empty cells.

Does the tool handle deeply nested JSON (5+ levels)?

Yes, the flattening algorithm handles arbitrary depth. Column headers become very long (e.g., "user.profile.settings.notifications.email.enabled"), which may exceed Excel column-width limits. Consider using the compact array mode for deeply nested structures.

How do I handle JSON arrays inside objects?

Arrays can expand to multiple rows (one per element, repeating parent data) or be stored as JSON strings in a single cell. Choose the mode that fits your analysis needs.

What CSV encoding does the tool use?

The tool outputs UTF-8 with BOM, which Excel for Windows correctly detects. Without the BOM, Excel may interpret UTF-8 text as Windows-1252, mangling special characters.

Can I filter which columns to include in the CSV?

After conversion, you can remove unwanted columns in your spreadsheet application. For selective conversion, pre-filter the JSON to include only the keys you need.

What is the maximum file size for conversion?

The tool handles JSON up to approximately 10MB reliably in the browser. Larger files may cause memory issues. For production ETL pipelines, use backend tools for large datasets.

How do I convert a single JSON object to CSV?

Wrap the object in an array: [{your-object}]. The tool converts each array element to one CSV row, so a single-object array produces a CSV with one data row and headers.

Does the tool support JSON Lines (JSONL) format?

The tool is designed for standard JSON arrays. For JSON Lines (one JSON object per line), convert to a JSON array first by wrapping the content in [ and ] and adding commas between objects.

Can I choose the column order in the CSV?

The tool uses the key order from the first JSON object to determine column order. To change column order, reorder the keys in the first object of the JSON array before converting.

Related Tools

JSON Formatter

Use our JSON formatter online to instantly format, validate, and beautify any JSON data. Paste minified JSON and get perfectly indented output with syntax error detection.

XML Formatter

Use our XML formatter online to instantly format, beautify, and validate any XML document. This free XML validator catches syntax errors and pretty prints your data.

Diff Checker

Use our diff checker online to instantly compare two texts and find differences. This free text diff tool highlights additions, deletions, and changes side by side.

Related Reading

  • JSON to CSV Data Migration: A Practical Guide

Free Tools

Online toolkit

A premium collection of browser-first utilities for developers, creators, and teams who want fast, private workflows without signup.

Built by Zohaib Hassan — trusted web tools designed for speed, precision, and privacy.

Explore

  • All Tools
  • Blog
  • Developer Tools
  • Document Tools
  • Calculators

Resources

  • Privacy Policy
  • Terms of Service
  • Disclaimer
  • FAQ
  • Contact

Company

  • About
  • Sitemap
  • Request a tool

© 2026 Free Online Tools. All rights reserved.

Crafted for developers, students, and teams who value private browser-first utilities.