JSON to CSV Converter

Paste a JSON array of objects below to instantly generate clean, RFC 4180-compliant CSV output. Headers are extracted automatically from every object's keys, nested values are stringified, and fields containing commas or quotes are properly escaped. Everything runs in your browser - nothing is sent to a server.

Try These Examples

  • Contact list - A simple array of people with name, email, age, and city
  • Product catalogue - Products with prices, tags array, and nested dimensions object
  • Sparse records - Objects with differing keys to demonstrate merged headers and empty cells

How It Works

The converter follows three straightforward steps to turn your JSON array into valid CSV:

  • Key extraction - The tool iterates over every object in the array and collects all unique keys. These become the column headers in the first row of the CSV. If one object has a key that others lack, those cells are left empty.
  • CSV formatting - Each object is mapped to a row. Primitive values (strings, numbers, booleans, null) are written directly. Objects and arrays are serialised with JSON.stringify() so no data is lost.
  • Quoting rules - Per RFC 4180, any field that contains a comma, a double-quote character, or a newline is wrapped in double quotes. Existing double quotes inside the field are escaped by doubling them (" becomes "").

Because the conversion uses only native JavaScript methods (JSON.parse, string manipulation), there are no external dependencies and the tool works offline once the page loads.

Frequently Asked Questions

What kind of JSON does this tool accept?

This tool accepts a JSON array of objects, such as [{"name":"Jane"},{"name":"John"}]. Each object in the array becomes one row in the CSV output. The keys from all objects are merged to form the full set of column headers.

How are nested objects and arrays handled?

When a field value is an object or an array, the tool converts it to a JSON string using JSON.stringify() and places that string in the CSV cell. The cell is automatically quoted so the JSON content does not break the CSV structure.

How does CSV quoting work?

Fields that contain commas, double quotes, or newlines are wrapped in double quotes. Any double-quote characters within those fields are escaped by doubling them (e.g., a single " becomes ""). This follows the RFC 4180 standard for CSV formatting.

Is my data safe when using this converter?

Yes. The entire conversion runs client-side in your browser using JavaScript. Your JSON data is never transmitted to any server. You can verify this by checking the Network tab in your browser's developer tools while using the tool.

Related Tools

← Back to all tools