JSON ↔ CSV

Convert JSON to CSV or CSV to JSON. JSON values that aren't flat objects (a single object, primitives, mismatched keys) are normalized into rows; nested values are JSON-stringified into their cell. CSV values always come back as strings — there's no type inference. Everything runs in your browser; nothing is uploaded.

0 chars0 lines0 bytes
0 chars0 lines0 bytes

What is JSON ↔ CSV?

JSON ↔ CSV is a browser-based converter that turns a JSON array of objects into comma-separated (or semicolon/tab-separated) rows, and turns CSV back into structured JSON. It handles the awkward parts: non-tabular JSON is normalized into rows, nested values are JSON-stringified into a single cell, and a configurable delimiter matches the CSV flavor your spreadsheet expects.

CSV is the lingua franca of spreadsheets and data imports — Excel, Google Sheets, database bulk loaders, and analytics tools all speak it. JSON is the language of APIs and applications. Moving data between the two is a constant need: exporting an API response into a spreadsheet for a stakeholder, or importing a spreadsheet of records into a JSON-based system.

Because CSV has no type system, values converted from CSV always come back as strings — there is no automatic number or boolean inference. This is a best-effort structural conversion, and everything runs locally in your browser, so your data is never uploaded.

Why use JSON ↔ CSV?

Handing a JSON API response to a non-technical colleague is far easier as a CSV they can open in Excel. Conversely, when someone gives you a spreadsheet of data to load into an application, converting it to JSON in one step saves you from writing a parser. This tool covers both directions with the delimiter and header options real spreadsheets use.

The delimiter choice matters more than people expect. Many European locales use semicolons because the comma is a decimal separator, and tab-separated values are common for data with embedded commas. Selecting the right delimiter ensures your CSV opens cleanly in the target spreadsheet without mangled columns.

Converting locally keeps tabular data private. Exported datasets frequently contain personal information, financial figures, or business metrics. This tool processes everything in your browser and makes no network requests — you can verify that in the Network tab while you convert.

Features

  • Convert a JSON array of objects into CSV rows
  • Convert CSV back into a JSON array of objects
  • Choose comma, semicolon, or tab as the delimiter
  • Toggle whether the first CSV row is a header
  • Normalizes non-tabular JSON and stringifies nested values into cells
  • One-click copy of the result to your clipboard
  • Download the result as .csv or .json
  • Runs entirely in your browser — no uploads, works offline

How to use JSON ↔ CSV

  1. Choose JSON → CSV to produce a spreadsheet-friendly file, or CSV → JSON to structure a spreadsheet as JSON.
  2. Select the delimiter (comma, semicolon, or tab) that matches your target spreadsheet or source file.
  3. In CSV → JSON mode, tick or untick "First row is headers" depending on whether your CSV has a header row.
  4. Paste your source data into the input panel and the converted result appears automatically.
  5. Copy the result to your clipboard, or download it as a .csv or .json file.

Example 1 — JSON array to CSV

Paste a JSON array of objects to get a CSV with a header row derived from the object keys.

Input

[{"a":1,"b":2}]

Output

a,b
1,2

Example 2 — CSV to JSON

Switch to CSV → JSON with the header option on to turn rows into objects. Note values come back as strings.

Input

a,b
1,2

Output

[
  {
    "a": "1",
    "b": "2"
  }
]

Common Mistakes

  • Expecting types to survive CSV: CSV values always convert to JSON strings. A cell containing 42 becomes "42", and true becomes "true". Cast numbers and booleans explicitly in your code after conversion.
  • Wrong delimiter causing one giant column: if your file uses semicolons but you select comma (or vice versa), every row collapses into a single mangled column. Match the delimiter to the actual file.
  • Forgetting the header toggle: if your CSV has no header row but the header option is on, the first data row is consumed as column names. Turn the toggle off for headerless data.
  • Deeply nested JSON does not flatten into columns: nested objects and arrays are JSON-stringified into a single cell rather than expanded into multiple columns. Flatten your JSON first if you need nested fields as separate columns.
  • Inconsistent object keys across an array: when JSON objects have different keys, the CSV header is derived from the combined set and missing values become empty cells. Verify the resulting columns match your expectation.
  • Embedded commas, quotes, or newlines in values: these require proper CSV quoting. If your source CSV is not correctly quoted, fields can split incorrectly — make sure values with special characters are wrapped in quotes.

Developer Tips

  • Choose the tab delimiter when your data contains commas inside values — TSV avoids the quoting headaches that comma-delimited files run into.
  • Use semicolon delimiters when preparing CSV for spreadsheets in European locales, where the comma is often the decimal separator and would otherwise break columns.
  • Flatten nested JSON before converting to CSV if you want nested fields as their own columns; otherwise they land as JSON strings inside single cells.
  • After CSV → JSON conversion, add a mapping step in your code to cast string values into the numbers, booleans, and dates your application actually expects.
  • Round-trip a small sample first (JSON → CSV → JSON) to confirm the delimiter and header settings produce the structure you need before processing a large dataset.

Frequently Asked Questions

Why do all my values become strings when converting CSV to JSON?
CSV is a plain-text format with no type system — every cell is just text. When converting to JSON, there is no reliable way to know whether "1" was intended as the number 1, the string "1", or something else, so the converter preserves every value as a string to avoid guessing wrong. If you need typed data, cast the strings explicitly in your code after conversion, for example with Number() for numeric columns.
Which delimiter should I choose?
Use comma for standard CSV, which most tools default to. Choose semicolon when working with spreadsheets in locales that use the comma as a decimal separator (common in much of Europe), since a comma delimiter would clash with the numbers. Choose tab for TSV files or when your data contains many commas inside values, because tabs rarely appear in data and avoid quoting problems. The key is matching the delimiter your source file or target spreadsheet actually uses.
What happens to nested JSON objects and arrays?
CSV is inherently flat — it only represents rows and columns — so nested objects and arrays cannot expand into a two-dimensional grid. Instead, the converter JSON-stringifies each nested value into a single cell, preserving the data as text. If you need nested fields as separate columns, flatten your JSON structure before converting. The tool normalizes non-tabular JSON into rows as best it can, but deeply nested data is not automatically spread across columns.
Is my data uploaded anywhere?
No. All conversion happens locally in your browser using JavaScript. Your data — which often includes personal information, financial figures, or business metrics in exported datasets — is never sent to a server, logged, or stored. You can confirm this by opening your browser's Network tab while converting: there are zero outbound requests, and the tool works even offline.
What does the "First row is headers" option do?
When enabled (in CSV → JSON mode), the converter treats the first CSV row as column names and uses them as the keys in each JSON object. When disabled, there are no named columns, so rows are returned as arrays of values or keyed by column index instead. Match this setting to your file: turn it on for CSVs that begin with a header row, and off for raw data files that start immediately with values.
What if my JSON objects have different keys?
When converting a JSON array whose objects do not all share the same keys, the CSV header is built from the union of all keys found across the objects. Objects missing a particular key simply produce an empty cell in that column. This keeps the CSV rectangular and complete, but it means you should review the generated header row to confirm the columns match what you expect, especially for sparse or irregular data.
How are commas and quotes inside values handled?
When converting JSON to CSV, values containing the delimiter, quotes, or newlines are automatically wrapped in quotes and escaped according to CSV conventions, so they stay in the correct column. When converting CSV to JSON, the parser respects standard CSV quoting to split fields correctly. If a source CSV is not properly quoted, fields with embedded delimiters may split incorrectly — in that case, fixing the quoting in the source, or switching to a tab delimiter, resolves the problem.