Skip to main content

Convert JSON to CSV Online Convert JSON arrays to CSV format with proper escaping and formatting.

JSON to CSV illustration
🔄

JSON to CSV

Convert JSON arrays to CSV format with proper escaping and formatting.

1

Paste JSON data

Paste a JSON array of objects into the input area.

2

View CSV output

The CSV output with headers and data rows appears instantly.

3

Copy or download

Copy the CSV to clipboard or download as a .csv file.

Loading tool...

What Is JSON to CSV?

JSON to CSV converts JavaScript Object Notation arrays into comma-separated values format. It is the standard data format for web APIs and modern applications, but CSV remains essential for spreadsheets, database imports, and data analysis tools like Excel. This converter extracts all unique keys from your objects to create the header row, then maps each object to a data row. Values containing commas, quotes, or newlines are automatically escaped following RFC 4180 standards. The tool handles arrays of flat objects and automatically collects all keys across all objects, ensuring no data is lost even if objects have different sets of keys.

Why Use JSON to CSV?

  • Automatically collects all keys from all objects — handles inconsistent schemas.
  • Proper CSV escaping for commas, quotes, and newlines in values.
  • Instant conversion with no server upload required.
  • Ready-to-use output that opens correctly in Excel, Google Sheets, and other spreadsheet apps.

Common Use Cases

API Data Export

Convert JSON API responses into CSV for analysis in spreadsheet applications.

Report Generation

Transform JSON data into CSV format for business reports and data sharing.

Database Import

Prepare JSON data as CSV for bulk import into SQL databases.

Data Sharing

Convert JSON datasets to the universally compatible CSV format for sharing with non-technical colleagues.

Technical Guide

The tool first scans all objects in the input array to build a complete set of unique keys, which become the CSV header row. This approach ensures that even if objects have different key sets, all data is preserved.

Each value is processed through an escaping function that follows RFC 4180 rules: if a field contains a comma, double quote, or newline character, the entire field is wrapped in double quotes. Any existing double quotes within the field are escaped by doubling them (e.g., a single " becomes "").

It handles flat objects natively. Nested objects and arrays are serialized as their string representation in the CSV output. For deeply nested structures, consider flattening first using a JSON transformer.

Null and undefined values are output as empty fields. Boolean and numeric values are converted to their string representations. The output uses standard comma delimiters and Unix-style line endings (\n) which are compatible with all major spreadsheet applications.

Tips & Best Practices

  • 1
    Input must be a JSON array of objects (e.g., [{...}, {...}]). Single objects will be wrapped in an array.
  • 2
    Nested objects and arrays will be serialized as JSON strings in the CSV output.
  • 3
    The header row is generated from all unique keys found across all objects.
  • 4
    For best results with Excel, save the output with a .csv extension and use UTF-8 encoding.

Related Tools

Frequently Asked Questions

Q What if my JSON objects have different keys?
The converter collects all unique keys from all objects. Objects missing certain keys will have empty values in those columns.
Q Can it handle nested JSON?
Nested objects and arrays are converted to their JSON string representation in the CSV cell.
Q Will the CSV open correctly in Excel?
Yes. The output follows RFC 4180 standards with proper quoting, which Excel handles correctly.
Q What about special characters?
Fields with commas, quotes, or newlines are automatically wrapped in double quotes and properly escaped.
Q Is there a limit on the number of objects?
No hard limit. Processing happens in your browser, so very large arrays (10,000+ objects) may take a moment.

About This Tool

JSON to CSV is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.