ToolBook
Support us on Ko-fi
Help us keep this free, forever

JSON ↔ CSV Converter

How to convert JSON to CSV or CSV to JSON

Convert between JSON arrays and CSV spreadsheet format in seconds, entirely in your browser.

  1. Choose the conversion direction

    Select JSON to CSV to turn a JSON array into a spreadsheet, or CSV to JSON to parse a CSV file into a JSON array.

  2. Select a delimiter

    Pick comma, semicolon, tab, or pipe based on what your target tool expects.

  3. Paste, upload, or load sample data

    Paste JSON or CSV directly into the input area, click Upload to load a file from your computer, or click Load sample to see example data.

  4. Copy or download the result

    Click Copy to send the output to your clipboard, or Download to save the converted file as .csv or .json.

Frequently asked questions

What JSON structures can be converted to CSV?

The converter expects a JSON array of objects; each object becomes a row, and the union of all object keys becomes the column headers. A single object is treated as a one-row table. Nested objects are flattened using dot notation (e.g. address.city). Nested arrays are serialised as a JSON string in the cell.

What delimiter should I use?

Comma (,) is the universal default and works with Excel, Google Sheets, and most data tools. Use semicolon (;) if your data contains commas or if you are working in European locales where comma is the decimal separator. Tab produces TSV files. Pipe (|) is useful when your data may contain commas, semicolons, and tabs.

How are values with commas or quotes handled?

Any cell value that contains the delimiter, a double-quote, or a newline is automatically wrapped in double quotes. Existing double-quotes inside the value are escaped as two consecutive double-quotes (RFC 4180).

Does the csv to json conversion preserve data types?

Yes. The converter auto-detects common types: integers, decimals, booleans (true/false), and null become their native JSON types. Everything else stays as a string. If you see unexpected type coercion, wrap the value in double quotes in your CSV.

What happens to nested JSON when converting to CSV?

Object values are flattened with dot notation: {"address": {"city": "Mumbai"}} becomes a column named "address.city". Array values are kept as their JSON string representation in the cell, since CSV has no native way to represent nested arrays.

Can I import the CSV output into Excel or Google Sheets?

Yes. For Excel, open a blank sheet, go to Data → From Text/CSV, and select your downloaded file. For Google Sheets, use File → Import and choose the CSV file or paste directly into a cell. Comma-separated output works without any extra settings in either tool.

Is my data private? Is it sent to a server?

All conversion runs entirely in your browser using JavaScript. Your JSON or CSV data is never uploaded to or processed on any server. Closing the tab clears everything.

What happens to empty cells or missing keys?

When converting JSON to CSV, missing keys in some objects are written as empty cells so every row has the same columns. When converting CSV to JSON, empty cells become null in the output object.

Are there file size limits?

There are no hard limits. Because everything runs in your browser, performance depends on available memory. Files up to a few megabytes convert instantly. For very large datasets above 50 MB, consider splitting the data first.

JSON ↔ CSV conversion: a practical guide

When to convert between JSON and CSV, how nested objects are flattened, and why delimiter choice matters.

Why convert between JSON and CSV?

JSON and CSV occupy opposite ends of the data-portability spectrum. JSON is hierarchical, self-describing, and the native format of every REST API and JavaScript runtime. CSV is flat, universal, and readable by every spreadsheet, database import wizard, and analytics tool on the planet.

The conversion need arises in a handful of predictable situations:

  • API response → spreadsheet: You downloaded data from a REST endpoint and want to share it with a non-technical stakeholder who lives in Excel or Google Sheets.
  • Database export → API payload: A legacy system exports CSV but the new service expects JSON.
  • Data wrangling: You want to apply formulas, pivot tables, or visualizations to data that arrived as JSON.

How JSON→CSV flattening works

The tricky part of JSON→CSV is nested objects. CSV is inherently flat — every row has the same fixed columns. The converter handles nesting with dot notation: {"meta": {"city": "Mumbai"}} becomes a column called meta.city.

Arrays inside objects are serialized as a JSON string in a single cell. This preserves the data without losing it, though deeply-nested structures can produce wide, unwieldy CSV files. For those cases, restructure the JSON before converting or accept that CSV isn't the right output format.

How CSV→JSON works

The first row of a CSV file is treated as the column header. Every subsequent row maps headers to values, producing an array of objects. Values are coerced to their natural types:

  • "true" and "false" become booleans.
  • Integer strings like "42" become numbers.
  • "null" becomes null.
  • Strings that look like JSON arrays or objects are parsed as their native types.
  • Everything else stays as a string.

Type coercion is optional in some tools but on by default here, because the vast majority of CSV exports use bare unquoted numbers and booleans — keeping them as strings would require extra parsing downstream.

Delimiter choice matters

The comma is the default CSV delimiter, but it creates problems when values contain commas — phone numbers in Indian format, addresses, currency values. The standard fix is RFC 4180 quoting: wrap the value in double quotes. But some tools skip the quoting and just change the delimiter to a semicolon or tab.

  • Comma (,): Universal default. Watch out for values with commas.
  • Semicolon (;): Common in European locales where the comma is the decimal separator.
  • Tab (\t): Produces TSV files. Tabs rarely appear in data, making quoting unnecessary in practice.
  • Pipe (|): Used in legacy data pipelines and banking exports.

Match the delimiter to whatever the receiving tool expects. When in doubt, Tab is the safest choice.

Column order and missing values

When converting JSON arrays where different objects have different keys, the converter takes the union of all keys across all objects as the column set. Missing values are written as empty cells. This is the standard behavior and ensures no data is silently dropped.

Size considerations

JSON with indentation can be 30–40% larger than the equivalent CSV. If you're working with large datasets, CSV is the more compact choice for tabular data. For nested data, JSON is the only format that preserves the structure without information loss.