JSON ↔ CSV

Convert between JSON and CSV in either direction, all in your browser.

How it works

This tool converts between two of the most common data formats, in both directions. Going from JSON to CSV, it parses your input, collects every key that appears across the objects to build the header row, and writes one line per object — quoting each value according to the CSV standard so that text containing commas, double quotes or line breaks stays intact. Going from CSV to JSON, it respects quoted fields while reading, takes the first row as the header, and turns every following row into an object. Both conversions run entirely in your browser, so the API payload or spreadsheet export you paste never leaves your device.

How to convert JSON to CSV (and back)

Everything starts from the Input box. For JSON to CSV, paste an array of objects such as [{"name":"Alice","age":30}] — a single object is accepted too and becomes one row — then click JSON → CSV. The converted table shows up in the Result box along with a status line telling you how many rows were produced. For the reverse direction, paste a CSV table whose first row is the header and click CSV → JSON: each row becomes an object and the output is pretty-printed with two-space indentation, ready to read or paste into code. Finish either way with Copy result to put the text on the clipboard or Download to save it as data.csv or data.json.

A concrete example

Say your store's API returns recent orders as a JSON array. Paste something like [{"id":1,"product":"USB-C Cable","qty":2,"note":"gift, handle with care"}] and click JSON → CSV. The result is a two-line table: a header of id,product,qty,note and one data row. The note value contains a comma, so this converter wraps it in double quotes automatically — drop the file into a spreadsheet and every field lands in its own cell. Later, export the sheet back to CSV and click CSV → JSON: the quoted field is parsed correctly and you get back the same array, so the round trip survives untouched.

What to expect

The converter is deliberately simple and predictable. The delimiter is always a comma — there is no option for semicolons or tabs, so a CSV exported in a regional format that uses ; will not parse as-is. The header row is built from the keys in the order they first appear, objects that don't share every key simply leave blank cells, and null or undefined values become empty cells. Nested objects and arrays (in either direction) are written into the cell as compact JSON text, because CSV has no notion of depth. When converting CSV to JSON, every value comes back as a string — this tool never guesses types — and the output JSON is indented with two spaces. Blank lines in a CSV input are skipped, download files are named data.csv or data.json, and there is no size limit beyond what your browser can handle.

Common problems and fixes

Your CSV cells come back as strings in the JSON? That's expected — the converter doesn't infer types, so a cell like 30 becomes "30"; cast it in your own code with Number() when you need a number. Getting an "Invalid JSON" error? JSON parsing is strict, so check for a trailing comma, keys that aren't wrapped in double quotes, or single-quoted strings. Seeing compact JSON text inside some CSV cells? CSV is flat, so nested objects and arrays are stored verbatim in the cell — nothing is lost, but those fields stay as JSON until you unpack them yourself. Rows you expected are missing? Blank lines in the input are skipped, and a CSV without a header row will have its first row consumed as the header, so add a header line first.

Frequently asked questions

What if my objects have nested data?

Nested objects and arrays are written into the CSV cell as compact JSON text, so no information is lost even though CSV itself is flat.

Does it handle commas inside values?

Yes. Values containing commas, double quotes or line breaks are automatically quoted on export and parsed correctly on import, following the standard CSV convention.

Can quoted CSV fields span multiple lines?

Yes. A field wrapped in double quotes may contain line breaks, and the parser will keep them as part of the value rather than ending the row.

Will numbers stay numbers when converting CSV to JSON?

No. Every cell becomes a string, so a value like 30 is output as "30". This avoids guessing wrong, but it means you should cast numeric fields with Number() in your own code if you need them as numbers.

My CSV has no header row — what happens?

The first row is always treated as the header. If your file has no header, that first data row will be used as the column names — add a header line to your CSV first.

Is my data uploaded anywhere?

No. Both conversions run entirely in your browser and nothing you paste leaves your device — you could be offline and the tool would still work.