Convert JSON to CSV

Convert JSON arrays of objects into CSV format. Maps JSON keys to CSV column headers and object values to row data, producing a flat tabular file from structured JSON data.

Input JSON
Options
CSV Column HeadersUse JSON object keys as CSV column names on the first row of the CSV data.
CSV Field DelimiterUse this character to separate CSV values.
CSV QuotingUse this character to quote CSV values.Wrap all CSV values in the specified quotes.
Output CSV

What It Does

Convert JSON arrays of objects into CSV format. Maps JSON keys to CSV column headers and object values to row data, producing a flat tabular file from structured JSON data.

How It Works

Convert JSON to CSV changes data from Json into Csv. That is more than a cosmetic rewrite. Field layout, quoting, nesting, and even type representation can shift because the destination format has different rules and limits.

Conversion tools are constrained by the destination format. If the source can express nesting, comments, repeated keys, or mixed data types more richly than the target, the output may need to flatten or reinterpret part of the structure.

All processing happens in your browser, so your input stays on your device during the transformation.

Common Use Cases

  • Convert REST API JSON responses into CSV for spreadsheet analysis
  • Export MongoDB query results from JSON to CSV
  • Transform JSON data files into CSV for database import
  • Convert JSON log entries into CSV for log analysis tools
  • Flatten JSON datasets for use in CSV-based workflows

How to Use

  1. Paste your JSON array into the input.
  2. Click Convert to generate CSV output.
  3. Review the column mapping.
  4. Copy or download the CSV.

Features

  • Handles arrays of flat objects
  • Flattens nested objects to dot-notation columns
  • Handles arrays within objects
  • Maps all unique keys to columns
  • Produces RFC 4180-compliant CSV

Examples

Below is a representative input and output so you can see the transformation clearly.

Input
[{"name":"Ada","score":9},{"name":"Lin","score":7}]
Output
name,score
Ada,9
Lin,7

Edge Cases

  • Very large inputs can still stress the browser, especially when the tool is working across many rows and columns. Split huge jobs into smaller batches if the page becomes sluggish.
  • Source values that look similar can map differently in the target format when data types are inferred, flattened, or serialized.
  • If the output looks wrong, compare the exact input and option values first, because Convert JSON to CSV should be repeatable with the same settings.

Troubleshooting

  • Unexpected output often means the input is being split or interpreted at the wrong unit. For Convert JSON to CSV, that unit is usually rows and columns.
  • If a previous run looked different, check for hidden whitespace, changed separators, or a setting that was toggled accidentally.
  • If nothing changes, confirm that the input actually contains the pattern or structure this tool operates on.
  • If the page feels slow, reduce the input size and test a smaller sample first.

Tips

For JSON with deeply nested objects, consider using jq or a JSON flattening tool first to get the structure you want before converting to CSV. This gives you more control over how nested data maps to columns.

JSON to CSV Conversion

JSON and CSV are the two most common data interchange formats, and converting between them is a daily task for developers and data analysts. This tool takes a JSON array of objects (the most common API response format) and produces a CSV table where each object becomes a row and each unique key becomes a column.

Key-to-Column Mapping

The converter scans all objects in the array to discover every unique key. These become the CSV header columns. Objects missing certain keys produce empty cells in those columns. This approach ensures no data is lost even when objects have different keys.

Nested Object Handling

JSON supports nesting that CSV cannot represent directly. The converter flattens nested objects using dot notation: {"address": {"city": "NYC"}} produces a column named "address.city" with value "NYC." Nested arrays are serialized to a JSON string within the CSV cell.

Common Source Formats

REST APIs return JSON arrays — converting to CSV enables analysis in Excel, Google Sheets, or database tools. MongoDB exports use JSON — converting to CSV allows relational database import. Firebase exports, Elasticsearch results, and GraphQL responses all benefit from JSON-to-CSV conversion for downstream processing in tabular tools.

Frequently Asked Questions

What JSON structure does this tool expect?

An array of objects: [{...}, {...}, ...]. Each object becomes a row. A single object (not in an array) is treated as one row.

How are nested objects flattened?

Nested keys use dot notation. {"user": {"name": "Alice"}} produces column "user.name" with value "Alice".

What happens to arrays within objects?

Arrays are serialized as JSON strings in the CSV cell. For example, {"tags": ["a", "b"]} produces a cell containing ["a","b"].

Can I select which keys become columns?

The tool maps all unique keys to columns by default. To select specific keys, extract them from the JSON first or use the Extract CSV Columns tool after conversion.

How are null and undefined values handled?

JSON null values become empty CSV fields. Undefined values (keys missing from an object) also produce empty fields.

Does the tool handle very large JSON arrays?

The tool processes data in the browser. Arrays with thousands of objects work fine. Very large arrays (hundreds of thousands of objects) may be slow.