JSON ↔ CSV Converter

Convert between JSON arrays and CSV format.

Enter data to convert

Two-Way Conversion

Switch between JSON → CSV and CSV → JSON with one click; the output updates live as you type. Going to CSV, the input must be a JSON array of objects — the keys of the first object become the header row. Going to JSON, the first CSV line is read as headers and every following row becomes one object.

Example input:

[{"name":"Alice","age":30},{"name":"Bob","age":25}]

CSV output:

name,age
Alice,30
Bob,25

Paste that CSV back in the other direction and you get the JSON array again — pretty-printed with 2-space indentation, ready to paste into code or a fixture file.

Escaping: Commas, Quotes, Newlines

Naive CSV export breaks the moment a value contains a comma. This converter applies the RFC 4180 rules automatically:

Value containsHandlingExample valueIn CSV
CommaWrap in quotesDoe, Jane"Doe, Jane"
Double quoteQuote + double the quote5" screen"5"" screen"
Line breakWrap in quotesmulti-line note"line1\nline2"

The CSV → JSON parser understands the same rules, so quoted fields with embedded commas and doubled quotes round-trip correctly.

Pitfalls to Know

  • Headers come from the first object. If later objects have extra keys, those columns are silently dropped — make sure every object has the same shape, or reorder so the most complete object comes first.
  • Nested objects aren't expanded. A value like {"address": {"city": "Berlin"}} won't become an address.city column. Flatten nested structures before converting.
  • CSV → JSON yields strings. age comes back as "30", not 30 — CSV has no type information. Cast numbers and booleans in your code afterwards.
  • Excel and semicolons: in many European locales Excel expects semicolon-separated files. This tool reads and writes standard comma-separated CSV; use Excel's import wizard (Data → From Text/CSV) to set the delimiter explicitly.

Privacy

Conversion runs entirely in your browser — your data never reaches a server, so customer lists and exports can be converted safely. Validate or tidy messy JSON first in the JSON formatter, and if your pipeline transports data as text, the Base64 encoder covers that step too.

Frequently Asked Questions

What JSON structure does the converter expect?
An array of flat objects, e.g. [{"name":"Alice","age":30},{"name":"Bob","age":25}]. The first object's keys define the CSV header row; each object becomes one data row.
How are commas and quotes inside values handled?
Per RFC 4180: values containing commas, quotes, or line breaks are wrapped in double quotes, and embedded quotes are doubled ("" for "). The CSV parser reverses this on the way back, so data round-trips intact.
Does it handle nested JSON?
Not as separate columns — nested objects and arrays are not flattened into dotted paths. Flatten your data first (e.g. address.city as its own key) for a usable spreadsheet.
Why are my numbers strings after CSV to JSON?
CSV carries no type information — every field is text. The converter returns all values as strings; cast them to numbers or booleans in your code after import.
Is my data uploaded during conversion?
No. Parsing and conversion happen entirely in your browser — nothing is sent to a server, so converting customer data or internal exports is safe.