JSON to CSV

Convert JSON arrays to CSV format with configurable delimiters and headers

Enter a JSON array of objects to convert to CSV format

CSV Options

CSV output ready for spreadsheet applications

What is JSON to CSV Conversion?

JSON to CSV conversion transforms JSON arrays of objects into comma-separated values (CSV) format that can be opened in spreadsheet applications like Excel, Google Sheets, or LibreOffice Calc. This tool automatically detects column headers from your JSON object keys and converts each object into a CSV row. All conversion happens in your browser - your data never leaves your device.

How to Use the JSON to CSV Converter

  1. Paste your JSON array into the input field
  2. Configure CSV options (delimiter, headers, quoting)
  3. Click "Convert to CSV" to generate the output
  4. Copy the result or download it as a .csv file

Example: Converting JSON to CSV

Input JSON:

[
  {
    "name": "Alice Johnson",
    "email": "alice@example.com",
    "age": 28,
    "department": "Engineering"
  },
  {
    "name": "Bob Smith",
    "email": "bob@example.com",
    "age": 34,
    "department": "Marketing"
  },
  {
    "name": "Carol White",
    "email": "carol@example.com",
    "age": 31,
    "department": "Engineering"
  }
]

CSV Output:

name,email,age,department
"Alice Johnson","alice@example.com",28,"Engineering"
"Bob Smith","bob@example.com",34,"Marketing"
"Carol White","carol@example.com",31,"Engineering"

Key Features

  • Automatic Header Detection: Extracts column names from JSON object keys
  • Configurable Delimiters: Choose comma, semicolon, tab, or pipe separators
  • Smart Quoting: Automatically quotes values containing special characters
  • Nested Object Handling: Flattens nested objects into dot notation
  • Web Worker Processing: Uses background threads for large datasets (>100KB)
  • Multiple Line Endings: Support for Unix (LF) and Windows (CRLF) formats
  • 100% Client-Side: Your data never leaves your browser

When to Use JSON to CSV

  • Data Analysis: Import API data into Excel or Google Sheets
  • Reporting: Convert JSON logs or metrics to spreadsheet format
  • Data Migration: Export JSON data for import into databases
  • Sharing Data: Provide data in a universally readable format
  • Backup: Create human-readable backups of JSON data
  • Testing: Generate test data files for applications

CSV Configuration Options

  • Delimiter: Character separating values (comma, semicolon, tab, pipe)
  • Include Headers: Add column names as the first row
  • Quote Strings: Wrap text values in quotes for safety
  • Line Ending: Unix (LF) or Windows (CRLF) format

Handling Complex JSON

The converter works best with flat JSON arrays where each object has the same structure. For nested objects, properties are flattened using dot notation (e.g., "address.city"). Arrays within objects are converted to JSON strings. If your JSON has inconsistent structures, the tool will include all unique keys as columns, leaving empty cells where properties don't exist.

Performance Optimization

For large JSON files (over 100KB), the tool automatically uses Web Workers to perform the conversion in a background thread. This keeps the user interface responsive while processing large datasets. You'll see a processing indicator when this happens.

Frequently Asked Questions

What JSON format is required?

The input must be a JSON array of objects. Each object represents a row, and the object keys become column headers. For example: [{"name":"Alice","age":28}, {"name":"Bob","age":34}]. The tool will not work with single objects, arrays of primitives, or nested arrays.

How are headers determined?

Headers are automatically detected from all unique keys across all objects in the array. If different objects have different properties, the CSV will include all unique keys as columns. Rows with missing properties will have empty cells in those columns.

Can I convert nested JSON objects?

Yes, but with limitations. Nested objects are flattened using dot notation (e.g., "user.address.city" becomes a single column). Arrays within objects are converted to JSON strings. For complex nested structures, you may want to flatten your JSON first using a JSON transformer.

Which delimiter should I use?

Use comma (,) for standard CSV files compatible with most applications. Use semicolon (;) for European locales where comma is the decimal separator. Use tab (\t) for TSV files or when data contains many commas. Use pipe (|) when data contains commas and quotes.

What happens with large JSON files?

For files larger than 100KB, the tool automatically uses Web Workers to perform the conversion in a background thread. This prevents the browser from freezing and keeps the interface responsive. You'll see a processing indicator while the conversion is running.

Is my data sent to a server?

No, all JSON to CSV conversion happens entirely in your browser. Your data never leaves your device, ensuring complete privacy and security for sensitive information. This also means the tool works offline once the page is loaded.

Can I download the CSV file?

Yes! Click the "Download CSV" button to save the converted data as a .csv file to your computer. The file will be named with a timestamp for easy organization.

How do I open the CSV in Excel?

Simply download the CSV file and open it with Excel, Google Sheets, or any spreadsheet application. If you used a non-comma delimiter, you may need to use the "Import" feature in your spreadsheet app and specify the delimiter.