JSON to CSV Converter

Export a JSON array of objects as spreadsheet-ready CSV. Missing keys are filled with empty cells, nested objects are serialised as JSON text, values that contain a comma, a quote or a line break are escaped correctly, and cells that start with a formula character can be neutralised before the file is opened.

JSON input

CSV output


            
            

Ready — paste some input or load the sample.

100% Client-Side · Privacy First. This tool runs entirely inside your browser. Nothing you type is uploaded, logged or sent to a server — you can even use it offline.

Overview

CSV is the format every spreadsheet reads, and it is also the format with the fewest rules: there is no standard for how a nested object should be flattened, how a missing value should look, or what a formula-looking string means. This converter takes an array of objects and produces a spreadsheet-ready table. The header row is the union of every key that appears in any object, so a field that is missing from some rows simply produces an empty cell rather than shifting the columns. Nested objects and arrays are serialised as compact JSON inside the cell, which keeps the structure without losing information. Values that contain the delimiter, a quote or a newline are quoted with the doubled-quote escape that Excel expects. There is also a formula injection guard: a cell that starts with =, +, - or @ is prefixed with a single quote, because a spreadsheet would otherwise execute it as a formula when the file is opened.

How to use the json to csv converter

  1. 1Paste a JSON array of objects into the input panel.
  2. 2Choose the delimiter if you need semicolons or tabs instead of commas.
  3. 3Leave the formula guard on when the data may come from users.
  4. 4Read the notes for the number of columns and rows that were written.
  5. 5Open the result in a spreadsheet or feed it into your reporting pipeline.
  6. 6The formula guard prefixes a cell that starts with =, + or - so that a spreadsheet cannot execute it.

Cheat sheet

The syntax you will use most, and what each part does.

PatternWhat it means
[{"a":1},{"a":2}] An array of objects becomes a table with a header row and one row per object.
Missing key The cell is empty, and the column still exists because another row defined it.
{"meta":{"id":1}} A nested object is written as compact JSON inside the cell.
=SUM(A1:A9) A value that starts with = is prefixed with a quote so a spreadsheet cannot execute it.
a,b "quoted" A value with the delimiter inside it is quoted, and any quote inside it is doubled.
[[1,2],[3,4]] An array of arrays becomes a table with generic column_1, column_2 headers.

Common mistakes

A formula executes when the file is opened.

Keep the formula guard enabled so a cell starting with =, +, - or @ is escaped with a leading apostrophe.

The columns do not line up.

The header is the union of all keys, so a row that is missing a field gets an empty cell in that position instead of a shifted value.

A value with a newline breaks the row.

Such values are quoted, which is legal in RFC 4180 CSV and is understood by Excel, LibreOffice and Google Sheets.

A UTF-8 file opens with strange characters.

The output is plain UTF-8. If your spreadsheet assumes a legacy encoding, import it explicitly and select UTF-8.

Worked examples

A list of records

[{"a":1,"b":"x"},{"a":2,"c":true}]

A table with the headers a, b and c, where the second row has an empty b cell.

A value that looks like a formula

[{"cmd":"=1+1"}]

The cell is written as =1+1 with a leading apostrophe so the spreadsheet shows the text.

Frequently asked questions

How are nested objects handled?

A value that is itself an object or an array is written as compact JSON text inside the cell, so the information survives the trip even though a flat CSV column cannot express it structurally.

What is the formula injection guard?

A cell that starts with an equals sign, a plus sign, a minus sign or an at sign is prefixed with an apostrophe, which tells a spreadsheet to treat it as text. Without the guard, a value such as =1+1 executes when the file is opened.

What happens to an object that is not an array?

A single object becomes a CSV with one header row and one data row, and a plain value becomes a single column named value. Nothing is lost and the file still opens cleanly.

Can I change the delimiter?

Yes. Comma, semicolon and tab are available, which matters for locales where the spreadsheet expects a semicolon and for systems that use tab separated values.

How are the columns determined?

The union of every key found in the array is used, in the order the keys first appear, so an object that is missing a key still lines up with the rest of the rows.

What if two objects have the same key?

The last value wins, because a JSON object cannot hold the same key twice. If the source data repeats a key, it is worth fixing it before the export.

Is the output UTF-8?

Yes. The characters are written as they are, so opening the file with the right encoding in your spreadsheet avoids the strange characters that a wrong encoding produces.

How large can the JSON be?

A few megabytes is comfortable in a browser tab. Beyond that the conversion and the rendering both compete for memory, and a streaming script is the better tool.

Does the export keep the order of the array?

Yes, the rows appear in the order of the input array, so a list that was sorted before the export stays sorted afterwards.

Why is a nested object written as JSON inside a cell?

A flat CSV cell cannot hold a structure. Writing compact JSON keeps the information and is still readable by a spreadsheet and by most scripts.

Can I reopen the result in this tool?

Not directly, because CSV cannot represent every JSON value. Use the CSV to JSON converter, which parses the escaped cells and rebuilds the objects.