JSON ↔ CSV Converter

Convert JSON arrays to CSV and CSV back to JSON.

Two formats, different strengths

CSV is a flat table: rows and columns, nothing more. It opens in any spreadsheet, is trivially readable, and every data tool on earth accepts it. JSON is hierarchical: objects can contain other objects and arrays to any depth, which makes it the natural format for APIs and configuration.

Converting between them is routine — pulling API data into a spreadsheet, or turning a client's spreadsheet into something an application can consume.

The nesting problem

The formats do not map cleanly, because CSV has no way to express nesting. Something has to give.

This converter flattens nested objects using dot notation, so an object containing an address with a city becomes a column named address.city. This preserves the information in a readable way and is a widely used convention.

Arrays are a harder case, since a row can hold only one value per column. Arrays are serialised as JSON text within the cell, which preserves the data but means it is not directly usable as a spreadsheet value. If your data contains arrays that matter, splitting them into separate rows before converting usually gives a more useful result.

Quoting and why CSV parsing is not trivial

CSV looks simple and is not. A field containing a comma must be wrapped in quotes, and a field containing a quote must escape it by doubling it. Fields can also contain line breaks inside quotes, which means you cannot parse CSV by splitting on newlines — a mistake that produces silently corrupted data.

This tool implements a proper character-by-character parser that handles quoted fields, escaped quotes and embedded newlines correctly. Output is quoted only where necessary, keeping the result readable.

Delimiters

Comma is standard, but semicolons are the norm in much of Europe, where the comma is the decimal separator. Tab-separated values avoid the ambiguity entirely and are often the safest choice for data containing punctuation. Pipe-delimited files appear in older enterprise systems.

If a spreadsheet opens your CSV with everything crammed into one column, a delimiter mismatch is almost always the cause.

Type handling

CSV has no types — everything is text. When converting to JSON, values that look numeric are converted to numbers and the words true and false become booleans. This is usually what you want, but be aware it affects values like postcodes and phone numbers with leading zeros, which lose them when treated as numbers. Where that matters, quote such fields in the source.

Converted in your browser

Everything runs locally, which matters since exported data frequently contains customer records and other personal information.

Frequently Asked Questions

How are nested objects handled?

They are flattened using dot notation, so a nested address object with a city becomes a column named address.city.

What happens to arrays?

They are serialised as JSON text inside the cell, since a CSV row can hold only one value per column.

Why does my spreadsheet show everything in one column?

A delimiter mismatch. Much of Europe uses semicolons because the comma is the decimal separator. Try switching the delimiter.

Why did my postcode lose its leading zero?

Numeric-looking values are converted to numbers when producing JSON. Quote such fields in the source if leading zeros matter.

Is my data uploaded?

No. Conversion runs entirely in your browser, which matters since exports often contain customer records.