ModernCalcs

JSON to CSV Converter

Convert JSON arrays of objects to CSV format instantly. Supports custom delimiters, optional headers, and one-click download. 100% browser-based.

JSON Input
299 chars
CSV Output
3 rows · 5 cols

3

Data Rows

5

Columns

154

Characters

Comma

Delimiter

JSON to CSV Converter: Turn API Data into Spreadsheets Instantly

REST APIs return data as JSON. Spreadsheet tools, databases, and data pipelines expect CSV. Our JSON to CSV Converter bridges that gap — paste your JSON array, pick a delimiter, and get clean RFC 4180-compliant CSV ready for Excel, Google Sheets, Pandas, or any data workflow. All processing happens locally in your browser.

Formula
Headers = union of all keys across every object (first-occurrence order) Row N = values at each header key for object N (empty cell if key absent) Escaping = wrap in quotes if value contains delimiter, quote, or newline

Follows RFC 4180 CSV standard for maximum compatibility across tools.

Union-of-Keys Headers

Real API responses are rarely perfectly uniform — some records have extra fields, others are missing optional ones. This tool scans every object in the array and collects the union of all keys as column headers. Objects missing a key produce an empty cell for that column rather than shifting data sideways or dropping the row entirely.

RFC 4180 Cell Escaping

Proper escaping is critical for CSV files to open correctly. Values that contain the delimiter character, a double quote, or a newline are automatically wrapped in double-quote delimiters. Internal double quotes are escaped by doubling: Alice "A" Smith becomes "Alice ""A"" Smith". This ensures the output parses correctly in Excel, Google Sheets, Python's csv module, and every standard CSV parser.

Custom Delimiters

Comma is the default, but European software often uses semicolons to avoid conflicts with locale-formatted numbers (e.g. 1.234,56). Tab-separated values (TSV) are standard in data pipelines and database exports. Pipe-delimited formats are used in EDI and some ERP systems. Choose the delimiter that matches your target tool before downloading.

Nested Objects & Arrays

JSON supports deep nesting — objects inside objects, arrays of arrays. CSV is inherently flat. When a value is a nested object or array, this tool serializes it to a compact JSON string and places it in the cell. If you need each nested field as its own separate column, use the JSON Flattener tool first to flatten the structure, then convert to CSV here.

Practical Examples

API response to spreadsheet

Exporting user records from a REST endpoint.

  • 1.Input: [{"id":1,"name":"Alice","role":"admin"},{"id":2,"name":"Bob","role":"viewer"}]
  • 2.Delimiter: Comma, Header: enabled
  • 3.Output: id,name,role → 1,Alice,admin → 2,Bob,viewer
  • 4.Open output.csv directly in Excel or Google Sheets.

Inconsistent object keys

Handling objects with different sets of fields.

  • 1.Input: [{"a":1,"b":2},{"a":3,"c":4}]
  • 2.Headers collected: a, b, c (union of all keys)
  • 3.Row 1: 1,2, (b present, c empty)
  • 4.Row 2: 3,,4 (b empty, c present)

Frequently Asked Questions

What JSON format does this tool accept?

The tool accepts a JSON array of objects — the most common format returned by REST APIs. Each object becomes one CSV row, and all unique keys across every object become column headers. A single JSON object (not wrapped in an array) is also supported and produces one data row.

What happens if objects have different keys?

The tool collects the union of all keys across every object and uses them as headers in first-occurrence order. If an object is missing a key, that cell is left empty. No data is dropped or shifted.

How are special characters handled?

Values that contain the chosen delimiter, double quotes, or newlines are automatically wrapped in double quotes per the RFC 4180 CSV standard. Internal double quotes are escaped by doubling them — e.g. He said "hi" becomes "He said ""hi""".

Can I convert nested JSON objects or arrays?

Yes, but nested structures are serialized to a JSON string and placed in the cell as-is. If you need nested fields as separate columns, flatten your JSON before converting using the JSON Flattener tool.

What delimiters are supported?

Comma (standard CSV), semicolon (common in European locales to avoid conflicts with decimal commas), tab (TSV format), and pipe (|). The chosen delimiter affects both the preview and the downloaded file.

Is my JSON data uploaded to a server?

No. All conversion happens entirely in your browser using JavaScript. Your data never leaves your device — there are no uploads, no server requests, and no logging.

Can I download the output as a file?

Yes. Click Download .csv to create a local file named output.csv. The download is triggered instantly in the browser with no server required.

What is the maximum file size this handles?

There is no hard limit imposed by the tool. Performance is bounded only by your browser's available memory. JSON files up to several megabytes convert in milliseconds.