JSON to CSV Converter

Global tools

Two conversions that look trivial and are not. A comma inside a value, a quote inside a quote, a line break in a note, a semicolon file from a country where the decimal separator is a comma, a row with the wrong number of fields, a cell starting with an equals sign - every one of those breaks a converter that only knows how to join things with commas. CSV has a small specification that answers all of them, and this page follows it.

A table out of data, or data out of a table: the options below change with the direction, so only the ones that direction uses are shown.

JSON to CSV wants an array of objects (or an array of arrays). CSV to JSON wants text with a header row, or without one if you say so below.

Semicolons are the convention where the decimal comma is used - a CSV full of 1,5 values is not a CSV full of commas.

Writing without a header drops the column names; reading without one gives arrays instead of objects.

Either way nothing is dropped: the shape is preserved as column names, or as JSON inside one cell.

A spreadsheet treats those four characters as the start of a formula: this is the well-known CSV injection problem, and the apostrophe is the standard defense.

RFC 4180 asks for CRLF; a database loader or a Unix pipeline usually prefers LF. The characters inside a cell are untouched either way, so the rows are the same.

Leave it blank for "table.csv" or "table.json".

Results update as you type. Nothing leaves your device.

A table with 3 rows

3 columns

Written as CSV with comma ( separators, ready for a spreadsheet, a database import or a script.

Rows
3
Columns
3
Cells
9
Size
97 B

CSV

name,role,since
Ada Lovelace,Editor,2024
Grace Hopper,Reviewer,2025
Alan Turing,Advisor,2025

Copy it, or download it as a file. Every value is exactly what the JSON held: nothing was rounded, shortened or reordered.

What the numbers do not say

  • Nested objects became dotted column names (address.city). Arrays stayed as JSON text inside one cell, because a table cannot hold a list without either losing it or inventing rows.
  • The separator is comma (, with a header row, and line endings are CRLF. Every cell containing the separator, a quote or a line break is quoted, and its quotes are doubled: that is the whole of RFC 4180.
The document was parsed and the table written in this browser tab. A CSV export of customer data or an API response is exactly the kind of thing that should not travel through somebody else’s server, so it does not travel at all.

Both directions are here: an array of objects in, a table out; a table in, an array of objects out. What it will not do is make decisions quietly - columns that were padded, rows that were reshaped and cells that were protected from being read as formulas are all reported, because a converter that silently reshapes data is worse than one that refuses.

About this json to csv converter

Among the formats a data pipeline crosses, JSON and CSV sit at opposite ends: one nests, the other is flat. This page converts between them - flattening an API response into rows and columns, keeping chosen nested parts whole, and reading a spreadsheet export back into objects - and it shows the table before you download it.

The conversion is deterministic and its rules are printed beside it: a nested object becomes dotted keys, an array becomes a joined cell or numbered columns, and a value holding a comma or a quote is quoted the CSV way. There is no account and no upload; the parse and the write happen in the tab.

CSV carries no types, so a number, a date and the text that looks like them are indistinguishable once written; the page keeps them as strings rather than guessing. Header order follows the first object unless you set it. Check the preview before feeding the file to anything that expects a schema.

How this json to csv converter works

What CSV actually is, and the four things your data will hit

A CSV file is a table written as text, and the rules are short: fields are separated by a delimiter, records by a line break, and a field may be wrapped in double quotes. Inside those quotes, a doubled quote means one quote, the delimiter is just a character, and a line break belongs to the field rather than ending the record. That last rule is why a note with two lines in it is one cell and not two rows, and why splitting on newlines first will mangle the file.

The delimiter is not always a comma. Much of Europe uses a semicolon, because the decimal separator there is a comma and `1,5;2,5` is unambiguous where `1,5,2,5` is not. Excel pastes tab-separated text into cells. So the separator is a setting here, with a detection option that looks for the character that appears the same number of times on every line - which is what makes a table a table.

The fourth thing is invisible: a byte order mark. Excel writes one at the front of a "CSV UTF-8" file, and it arrives as a character with no width, which becomes part of the first column name and makes that name impossible to find. This page removes it on the way in, which is one line of code that saves a surprising amount of confusion.

Nested objects, ragged rows, and the choices that have to be made

A JSON document can nest; a table cannot. So a nested object either becomes dotted column names (`address.city`) or travels as JSON text inside one cell, and the option is there because both answers are right in different situations - one for importing into a database, the other for keeping the document intact. Nothing is dropped either way. Arrays stay as JSON text in a cell in both modes: a list inside a table would have to be split into extra rows (which invents rows) or truncated (which loses data).

Rows that do not match the header are the other thing a naive converter gets wrong by accident. Here a short row is padded with empty cells and a long one is trimmed, so the table stays rectangular - and both are counted and reported, because a row that lost a field is exactly the sort of thing somebody needs to know about before importing a thousand records.

Missing keys become empty cells, and `null` becomes an empty cell too. That is worth knowing: once a document is CSV there is no way to tell "absent" from "empty" from "null", because the format has no way to write the difference.

The formula problem, which is a security issue rather than a quirk

A cell beginning with `=`, `+`, `-` or `@` is treated as a formula by Excel, LibreOffice, Numbers and Google Sheets. That is well known enough to have a name - CSV injection, or formula injection - and it means a CSV file can make somebody else’s spreadsheet compute something the moment they open it: a link that is followed, a shell command on some older configurations, at the very least a confusing cell full of errors. The value came from an export of user input, which is exactly where an attacker would put it.

The standard defense is the one this page applies by default: prefix such a cell with an apostrophe, which spreadsheets treat as "the rest of this is text". The visible content of the cell is unchanged, a find-and-replace removes the apostrophes if you want them raw, and the option can be turned off - but it is on by default because the person opening the file is the one who would suffer.

Worked examples

Each example below was run through the calculator on this page when the site was built, so the numbers match what you see when you enter the same inputs.

An API response turned into a table

Which way: JSON to CSV - a table out of data

A table with 3 rows

3 columns

Written as CSV with comma ( separators, ready for a spreadsheet, a database import or a script.

Rows: 3 · Columns: 3 · Cells: 9 · Size: 97 B

Three objects in, three rows out, with the keys as the header row. Each object holds the same three keys, so nothing is padded and nothing is trimmed - which is the tidy case rather than the only case.

The same data with the nested parts kept whole

Which way: JSON to CSV - a table out of data · Nested objects: Keep each one as JSON text in its cell

A table with 3 rows

3 columns

Written as CSV with comma ( separators, ready for a spreadsheet, a database import or a script.

Rows: 3 · Columns: 3 · Cells: 9 · Size: 97 B

With flattening off, a nested object travels as JSON text inside its cell, quotes doubled the way CSV requires. That is the version to keep if the document has to survive the round trip unchanged.

A spreadsheet export, back into data

Which way: CSV to JSON - data out of a table · Cell values: Detect numbers and booleans

Read 2 rows

3 columns

The table was read following RFC 4180 and written out as JSON, one object per row.

Rows: 2 · Columns: 3 · Ragged rows: 0 · Size: 159 B

Reading the other way detects numbers and booleans, except where a number would be wrong: a leading zero (a phone number, a postcode) and more than fifteen digits both stay as text, because that is what they are.

Frequently asked questions

Is my data uploaded anywhere?

No. The text is parsed and written by JavaScript in this tab, and the download is a blob created locally. There is no request behind the page at all, which matters more here than on most tools: a JSON to CSV conversion is often an export of customer records, an API response with a token in it, or somebody’s contact list.

Why does my CSV open in a spreadsheet with everything in one column?

Because the file uses a different delimiter from the one the spreadsheet guessed. A file written with semicolons opens correctly in a spreadsheet configured for the decimal comma and as a single column everywhere else; a tab-separated file does the same in reverse. Set the separator here to match, or use the detection option and check the first line of the output before importing a thousand rows.

What happens to nested objects and arrays?

Objects become dotted column names (address.city) when flattening is on, or JSON text inside one cell when it is off - either way nothing is dropped. Arrays always stay as JSON text in a single cell, because a table cannot hold a list without either inventing rows or throwing part of it away, and both of those are worse than a fat cell.

Why is some of my output wrapped in double quotes?

Because the value contains the delimiter, a quote or a line break, and the format requires those fields to be quoted so that a reader knows the comma inside is text rather than a separator. Quotes inside a quoted field are doubled, which is how a field containing a quote is written. This is the whole of RFC 4180, and every spreadsheet understands it.

Why does my number have an apostrophe in front of it?

Because it starts with =, +, - or @ and a spreadsheet would treat it as a formula. That is the CSV injection problem: a cell like `=HYPERLINK(...)` is executed by the spreadsheet that opens the file, and the value usually came from user input on a website. The apostrophe is the standard defense and can be turned off in the settings - the option is there, and it is on by default because the person who opens the file is the one at risk.

Why is everything a string in the JSON I get back?

Because that is the default and the safe reading: a spreadsheet column of phone numbers, postcodes, account numbers and version strings is full of values that look like numbers and are not. Turn type detection on and plain integers, decimals and `true`/`false` become JSON numbers and booleans, while anything with a leading zero or more than fifteen digits stays text - those two rules exist because turning them into numbers would silently corrupt the data.

What happens to rows that do not match the header?

They are padded (if short) or trimmed (if long) so the table stays rectangular, and the number of such rows is reported in the results with the first few row numbers. A CSV file written by hand or exported from something inconsistent will have them, and the honest thing is to say so rather than to fail or to pretend it did not happen.

Can I choose how nulls, empty strings and missing keys are written?

Not individually, and the reason is worth knowing: CSV has no way to tell them apart. A missing key, an empty string and a null all end up as an empty cell, so a round trip through CSV cannot preserve the distinction - which is the format’s limitation rather than this page’s. If that distinction matters for your data, keep it in JSON and use CSV only for the table that a human will read.

Assumptions and sources

  • CSV follows RFC 4180 and JSON follows RFC 8259, in both directions.
  • Cells starting with `=`, `+`, `-` or `@` get an apostrophe prefix by default, so a spreadsheet cannot execute them; ragged rows are reported with row numbers.
  • Nothing is uploaded; the table or the JSON is written to a local download.

Last reviewed 2026-09-16. Runs locally on your device; keep backups; no financial advice applies. Read the full disclaimer.

Where a figure on this page comes from an official agency — HUD, IRS, FICO or a state body — the site keeps a dated snapshot of the source page in its sources library, and a scheduled job re-checks that snapshot, so the number can be traced back to the document it came from.