Skip to content
Devlar

Runs in your browser. Your input stays on your device.

JSON to CSV Converter

Turn a JSON array into a CSV file. Nested objects can be flattened into columns, numbers are kept exactly as written, and cells that could run as spreadsheet formulas are neutralized by default.

Conversion options

Opens a file from your device. The file is read in your browser and is not uploaded.

0 characters · 0 B

0 characters · 0 B

Privacy: This tool runs in your browser. Your input is processed on your device and is never uploaded to a server.

How to use

  1. Paste a JSON array of objects into the input box, or select Open file to load a .json file (you can also drop it on the box). An array of arrays or a single object also works.
  2. Choose how nested objects are handled: flattened into columns such as address.city, or written as JSON text in one cell.
  3. Pick the delimiter, whether to include a header row, and the line endings. Turn on Excel compatible if the file will be opened in Excel and contains non-English text or emoji.
  4. Keep Protect against formula injection on unless the CSV is only for other programs. Check the preview table below the converter to see the first rows.
  5. Short input converts as you type. For long input select Convert, or press Ctrl+Enter (Cmd+Enter on a Mac) anywhere in the tool, not only in the input box. Then copy the CSV or download it as data.csv.

Example

Converted with the default options. The address is flattened, the tags array is written as JSON, the large ID and -75.50 are unchanged, and the formula in note is prefixed with a quote.

Input
JSON
[
  {
    "id": 9007199254740993,
    "name": "Ayesha Khan",
    "address": { "city": "Lahore", "zip": "54000" },
    "tags": ["admin", "beta"],
    "balance": -75.50,
    "note": "=HYPERLINK(\"http://example.com\")"
  },
  {
    "id": 2,
    "name": "Liam O'Brien, Jr.",
    "address": { "city": "Dublin" },
    "verified": true
  }
]
Output
CSV
id,name,address.city,address.zip,tags,balance,note,verified
9007199254740993,Ayesha Khan,Lahore,54000,"[""admin"",""beta""]",-75.50,"'=HYPERLINK(""http://example.com"")",
2,"Liam O'Brien, Jr.",Dublin,,,,,true

Frequently asked questions

What is CSV formula injection, and what does the protection do?

Spreadsheet programs such as Excel and Google Sheets treat a cell that starts with =, +, -, or @ (and, in some programs, a tab or carriage return) as a formula. If the JSON came from users, a value like =HYPERLINK("http://example.com") could run as a formula when someone opens the CSV, for example to send data to another site. With protection on, such text cells get a single quote in front, so spreadsheets show them as plain text. Numbers from the JSON, like -5, are never changed. The trade-off: when you open the CSV in Excel, protected cells show the leading apostrophe as part of their text, for example '=1+1, and other programs see it as part of the value too. If you trust the data, or the CSV is meant for a database or a script rather than a spreadsheet, turn the option off.

How are nested objects and arrays handled?

With Flatten with dot notation on, nested objects become separate columns named by their path, such as address.city and address.zip. With it off, each nested object is written as JSON text in a single cell. Arrays are always written as JSON text, because a list does not map cleanly onto a fixed set of columns.

Why do Arabic, Urdu, or emoji look broken when I open the CSV in Excel?

Excel often assumes a legacy encoding when it opens a CSV file, so UTF-8 text shows up as unreadable characters. Excel compatible adds a UTF-8 byte order mark at the start of the downloaded file, which tells Excel to read it as UTF-8. Most other programs do not need it. The mark is added to the download only, not to the copied text.

Will large numbers or values like 1.50 change?

No. The JSON is read with a parser that keeps every number exactly as written, so an ID like 9007199254740993 or a price like 1.50 appears in the CSV character for character. Converters built on JavaScript’s JSON.parse would round that ID to 9007199254740992 and print 1.50 as 1.5.

Which columns end up in the CSV?

Every key that appears in any object, in the order the keys first appear. When an object is missing a key, that cell is left empty, and null values are written as empty cells too.

CSV to JSON Converter

Convert CSV or TSV to JSON with delimiter detection, header handling, and optional, lossless type detection.

JSON Formatter

Format and beautify JSON with your choice of indentation, and find syntax errors by line and column.

JSON Validator

Check JSON for errors with line, column, and code context, and catch duplicate keys and unsafe large numbers.

Keyboard shortcuts

Run the tool, from anywhere in it
Ctrl+Enter
Show this list (outside text fields)
?
Close this list
Esc