MateenLabs No ads · Runs in your browser
Free Developer Tool

JSON to CSV and CSV to JSON Converter

Paste or drop a JSON array of objects and get a CSV table, or paste a CSV file and get JSON. The converter follows RFC 4180: fields with commas, quotes or line breaks are quoted correctly, and both CRLF and LF line endings are read and written. You can choose comma, semicolon, tab or pipe, and CSV input is checked to detect its delimiter automatically.

Nested JSON can be flattened into dotted column names such as address.city, and arrays can be spread into numbered columns or joined into one cell. Going from CSV to JSON, you decide whether numbers and true/false values should be recognised, and leading zeros are always kept. For spreadsheets there are an Excel-friendly UTF-8 byte order mark and an option that guards against formula injection. Files stay on your device.

Free Forever No Login No File Uploads Browser Processing
Direction

Drop a .json or .csv file here

or

The file stays on your device. It is not uploaded. Up to 20 MB.

0 characters

Formula protection puts an apostrophe before text cells that start with = + - or @, so a spreadsheet shows them as text. It changes those cells.

Nothing yet

Paste JSON or CSV, or drop a file.

How the conversion works

JSON describes data as nested objects and lists, while CSV is a flat table of rows and columns. To fit one into the other the tool has to make choices, and it shows them as options instead of hiding them. When converting JSON to CSV, every key in any object becomes a column, in the order the keys first appear, and an object that lacks a key gets an empty cell. Nested objects become dotted columns, and arrays either get one column per position (tags.0, tags.1), are joined into a single cell, or are written as JSON text.

CSV has no data types: everything is text. By default the tool gives you strings, which is the safe choice, because guessing can damage data, for example turning the postcode 02134 into the number 2134. If you turn on type inference, numbers, true, false and null are converted, while values with leading zeros and numbers too long to be exact stay as text. If your file has dotted headers, you can ask the tool to rebuild nested objects and arrays from them. Rows with a different number of fields than the header are reported with their line number, or can be accepted and padded.

Spreadsheets treat a cell that begins with =, +, - or @ as a formula, which can be abused to run commands or leak data when a CSV from an untrusted source is opened. The protection option puts an apostrophe in front of such text cells so they are shown as plain text. It changes the cell content, so leave it off when the file is meant for a program rather than a person. Excel also needs a byte order mark to read UTF-8 accents correctly, and the BOM option adds it.

  • JSON array of objects to CSV, and CSV to JSON, following RFC 4180.
  • Delimiter auto-detection (comma, semicolon, tab, pipe) with manual override.
  • Header row on or off; row and column counts.
  • Flatten nested objects with dot notation; arrays by index, joined or as JSON.
  • Optional type inference that keeps leading zeros; optional rebuilding of nested objects.
  • UTF-8 BOM for Excel and a spreadsheet formula protection option.
  • Drop a .json or .csv file; large inputs are processed in slices with a Cancel button.
  • Line-numbered errors for invalid JSON and ragged CSV rows.

How to use the JSON ⇄ CSV Converter

  1. Choose the direction: JSON to CSV or CSV to JSON.
  2. Paste the data or drop a file onto the page.
  3. Adjust the options that appear for that direction.
  4. Copy the result or download it as a file.

Is it private?

Yes. Your JSON and CSV data and any file you drop are converted by your own browser. Nothing is uploaded, stored or sent anywhere.

Read our tools privacy policy →

Frequently asked questions

What JSON can be converted to CSV?

An array of objects, such as [{"id":1,"name":"Ada"},{"id":2,"name":"Bob"}], or a single object, which becomes one row. Other shapes, for example an array of numbers or an array that mixes objects and values, are reported with the position of the first item that does not fit.

How are nested objects and arrays handled?

With flattening on, nested keys become dotted column names such as user.address.city. Arrays become numbered columns, or one joined cell, or JSON text, as you choose. With flattening off, nested values are written as JSON text inside one cell. Keys that contain a dot are ambiguous when converted back.

Why are my numbers strings in the JSON I get from CSV?

CSV does not store types, so by default every value stays text. Turn on type inference to turn numbers, true, false and null into JSON values. Values such as 007 or numbers with more than 15 digits stay as text so that nothing is lost.

What does the formula protection option do?

It puts an apostrophe before any text cell that begins with =, +, - or @, so spreadsheet programs show it as text instead of running it as a formula. Real numbers are not changed. The protection alters the cell text, so only use it for files that people will open in a spreadsheet.

Why does Excel show strange characters, and what is the BOM option?

Excel often assumes an older encoding for CSV files. A byte order mark at the start of the file tells it that the text is UTF-8, so accents, emoji and non-Latin scripts display correctly. Programs that read the file directly do not need it.

Is my data uploaded?

No. Pasted text and dropped files are converted in your browser. Nothing is uploaded or stored, and large files are processed on your device in slices that you can cancel.

Related tools