Calcorithmevery number has an answer
πŸ”
All tools β†’
← Converters

JSON to CSV

Convert JSON arrays to CSV format instantly β€” paste your JSON, click Convert, and copy the result.

JSON input
CSV output

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data format used almost universally in web APIs, configuration files, and data exchange between applications. A JSON value can be a string, number, boolean, null, object (key–value pairs enclosed in curly braces), or array (ordered list enclosed in square brackets). JSON supports nesting: an object can contain arrays of other objects, making it ideal for hierarchical data.

// Example: valid JSON array of objects [ { "name": "Alice", "age": 30, "city": "Amsterdam" }, { "name": "Bob", "age": 25, "city": "Rotterdam" } ]

What is CSV?

CSV (Comma-Separated Values) is the simplest tabular data format: each row is a line of text, each column is separated by a comma, and the first row typically contains column headers. CSV has no official standard for all edge cases, but RFC 4180 is the de facto specification most tools follow.

// Same data as CSV (RFC 4180 format) name,age,city Alice,30,Amsterdam Bob,25,Rotterdam

CSV is supported natively by Microsoft Excel, Google Sheets, LibreOffice Calc, most BI tools (Tableau, Power BI, Looker), SQL import utilities, and virtually every data science library (pandas, R, MATLAB). It is the lowest-common-denominator format for data exchange between systems.

JSON vs. CSV: when to use each

FeatureJSONCSV
Data structureHierarchical (nested objects/arrays)Flat (two-dimensional table only)
Human readabilityReadable but verbose for large datasetsVery readable for simple tabular data
Spreadsheet supportRequires import plugin or conversionOpens directly in Excel / Sheets
Nested dataSupported nativelyNot supported β€” must be flattened
Data typesStrings, numbers, booleans, null, arrays, objectsAll values are plain text strings
File sizeLarger due to key names repeated per objectCompact β€” headers appear only once
Best forAPIs, config files, complex dataSpreadsheets, BI tools, SQL imports

How JSON-to-CSV conversion works

Converting a JSON array of objects to CSV requires two steps: extracting the column headers from the keys of the first object, then writing each subsequent object as a row in the same column order. Any value that contains a comma, a double-quote, or a newline must be enclosed in double-quotes, with internal double-quotes escaped as two consecutive double-quotes ("").

Input JSON: [{ "product": "Widget, Pro", "price": 9.99 }] Output CSV (RFC 4180): product,price "Widget, Pro",9.99 ↑ The comma inside the value requires wrapping in quotes

Limitations: what this tool cannot convert

CSV is inherently flat. If your JSON contains nested objects or arrays, they cannot be represented directly in CSV without additional decisions about how to flatten them. This converter handles the common case β€” a JSON array of flat objects β€” and will produce an empty or partial result for deeply nested structures.

// This flat JSON converts cleanly: [{ "name": "Alice", "score": 95 }] // This nested JSON does NOT convert cleanly: [{ "name": "Alice", "scores": [95, 88, 72] }] // The "scores" array has no direct CSV representation

For nested JSON, you have three options: flatten the data manually before converting, serialize the nested values as strings (e.g. JSON-stringify the inner array), or use a dedicated ETL tool that supports custom flattening logic.

Common use cases

API responses
Export API data (users, orders, products) to CSV for analysis in Excel or Sheets
Database exports
Convert JSON dumps from MongoDB, Firestore, or similar NoSQL stores into tabular format
Reporting
Feed CSV into BI tools like Tableau or Power BI that require flat data input
Data migration
Transform JSON records into CSV for SQL bulk imports (LOAD DATA, COPY FROM)
Collaboration
Share structured data with colleagues who work in spreadsheets, not JSON
Testing
Generate test fixtures in CSV format from JSON test data sets

Tips for clean conversions

  • Ensure consistent keys across all objects. If some objects have extra fields that others lack, the missing columns will be empty in the output. Normalise your JSON so every object has the same keys before converting.
  • Validate your JSON first. A common mistake is exporting JSON with trailing commas or single-quoted strings β€” both are invalid in standard JSON but allowed in JavaScript. Use a JSON validator to confirm your input is spec-compliant before converting.
  • Watch for special characters in values. Commas, newlines, and double-quotes inside values are automatically escaped by this tool per RFC 4180. If you open the CSV in a text editor and see quotes around some values, that is correct escaping β€” not an error.
  • Large datasets: consider streaming tools. This browser-based converter handles thousands of rows comfortably. For millions of records, use a command-line tool (jq, csvkit) or a server-side script to avoid memory limitations.

Frequently asked questions

What does this tool do?

It converts JSON data β€” typically an array of objects β€” into CSV format with a header row, ready to open in Excel, Google Sheets or any spreadsheet.

Is my data uploaded to a server?

No. The conversion runs entirely in your browser, so your JSON stays private on your device.

How are nested JSON objects handled?

Flat objects map cleanly to columns. Deeply nested structures may need flattening first, since CSV is a two-dimensional format without nesting.

What if my JSON objects have different keys?

The converter builds columns from the keys it finds; rows missing a key get an empty cell for that column.

iFormula / How it works

Takes a JSON array of objects and converts each object to a CSV row. The first row contains the column headers from the object keys. Values with commas or quotes are automatically escaped per RFC 4180.

Related Converters tools

Length Converter
km, miles, feet, cm, inches
Weight Converter
Convert weight between kilograms, pounds, ounces and stone
Temperature Converter
Convert temperatures between Celsius, Fahrenheit and Kelvin instantly
Area Converter
Convert area between square meters, square feet, acres and hectares
Volume Converter
Convert volume between liters, gallons, cups and milliliters
Speed Converter
Convert speed between km/h, mph, m/s and knots
Data Size Converter
Convert digital storage units β€” bytes, KB, MB, GB, TB and PB
Time Zone Converter
Convert times across world time zones instantly