JSON to CSV / CSV to JSON

Convert a JSON array of objects to a CSV table, or turn CSV text back into JSON — both directions run entirely in your browser.



Input JSON (array of objects)



Result

All conversion happens locally. Nothing is uploaded.

Runs locally in your browser. Nothing is uploaded.

What is JSON to CSV conversion?

JSON and CSV are the two most common ways to move tabular data around. APIs usually speak JSON — an array of objects, where each object is a row and each key is a column. Spreadsheets, on the other hand, speak CSV: plain text where the first row lists the column names and every following row is one record, with fields separated by commas. Converting between them by hand is tedious and error-prone, especially once fields contain commas, quotes, or line breaks of their own. This tool handles both directions, following the standard CSV quoting rules so that a spreadsheet opens the result with every value in the right column.

Going from JSON to CSV, the column list is the union of all keys across every object, in order of first appearance; if one object lacks a column, that cell is left blank. Values that are themselves objects or arrays are written as compact JSON text inside the cell. Going from CSV to JSON, the first row becomes the set of keys, and each following row becomes one object. The parser fully supports quoted fields, so a field may contain commas, doubled quotes, and even line breaks without breaking the row structure.

How to use the JSON to CSV converter

Pick a direction from the dropdown, then paste your data into the input box. For JSON to CSV, the input must be an array of objects. For CSV to JSON, the first row must be the header row. Click Convert and the result appears in the output box, ready to copy. When converting CSV to JSON, the "Auto-convert numbers" checkbox controls whether cells that look like plain numbers (42, 3.14, -7) become JSON numbers or stay as strings — leave it checked for spreadsheet data that will be fed back into code, uncheck it when identifiers like zip codes or product codes must keep their exact text form. The Load sample button fills in an example for the current direction, including a quoted field containing a comma, so you can see the quoting rules in action.

Frequently asked questions

Why does JSON to CSV complain that an element is not an object?
CSV is a two-dimensional table, so it can only express rows and columns. If your array holds numbers, strings, or nested arrays, there are no column names to map them to. Reshape the data into an array of objects first, then convert.

What happens if the CSV header has duplicate column names?
When building each JSON object, a later column with the same name overwrites the earlier one. Rename duplicate headers before converting so no data is lost.

Why does the CSV look garbled when opened in Excel?
The output is UTF-8 text. Older versions of Excel misread UTF-8 CSV files opened by double-clicking. Use Data → From Text/CSV and choose UTF-8 encoding on import, or open the file in a modern spreadsheet app.

Can I convert back and forth without losing data?
Yes, for flat tabular data: JSON to CSV and back again round-trips cleanly, including quoted commas. Nested objects and arrays survive as JSON text inside their cells, but they come back as strings rather than nested structures.

Related tools

JSON Formatter & Validator · JSON Repair · JSON Diff · Text Diff

Runs locally in your browser. Nothing is uploaded. How our privacy works

© 2026 TinyLabTools · tinylabtools.com