ruxox
Start
Start
Data / CSV

JSON ↔ CSV Converter

Convert JSON arrays to CSV and CSV back to JSON in your browser. Handles nested objects, custom delimiters, and header rows. No server required.

JSON ↔ CSV Converter

Runs entirely in your browser — no server calls, no tracking.

Paste data and click Convert.

🔒 Your data never leaves this tab. This tool has no backend.

About this tool

About the JSON ↔ CSV Converter

JSON and CSV are the two most common data interchange formats in web development. JSON is preferred for APIs (nested objects, arrays, typed values), while CSV is preferred for spreadsheets, database exports, and bulk import tools. This converter handles both directions: JSON array to CSV with proper quoting and escape, and CSV back to a JSON array using the header row as keys.

JSON to CSV rules

Only flat JSON arrays are supported (arrays of objects with consistent keys). Nested objects are stringified into the cell value. Values containing the delimiter, quotes, or newlines are automatically wrapped in double quotes per RFC 4180. Missing keys in a row output an empty string for that column.

CSV to JSON rules

The first row is used as property names (headers). All values are treated as strings — the converter does not attempt type inference for numbers and booleans (this avoids incorrectly converting strings like "001" or "true" that should remain as strings). If you need typed values, use the JSON output as a starting point and parse numbers in your application.

The semicolon delimiter option is useful for European locales where comma is the decimal separator (e.g. Excel defaults to semicolons in German, French, and Dutch regional settings). Tab-delimited is the TSV format, often used in data science pipelines and Google Sheets exports.

Conversion notes

Converting CSV to JSON, and JSON back to CSV

The two directions are not symmetrical, and knowing where each one loses information saves a lot of debugging.

CSV to JSON

The header row becomes the object keys and each subsequent row becomes one object in an array. The catch is that CSV has no types — every cell is text. A column of 1,2,3 could be numbers or strings, and true could be a boolean or the word. This converter infers the obvious cases and leaves ambiguous ones as strings, which is the safe default.

JSON to CSV

This works cleanly on an array of flat objects with consistent keys. Nesting is the problem: CSV is a grid and has no way to express an object inside a cell. Nested values are flattened into dotted column names such as address.city, and arrays are joined, because the alternative is silently dropping data.

The details that break conversions

  • Commas inside values — must be quoted, or the row gains a column.
  • Quotes inside values — doubled in CSV (""), backslash-escaped in JSON.
  • Line breaks inside a cell — legal in quoted CSV; naive line-splitting corrupts them.
  • Leading zeros — postcodes and IDs lose them if treated as numbers. Keep those columns as strings.
  • Encoding — save as UTF-8; anything else mangles accented characters and symbols.

Everything converts in your browser, so spreadsheets containing customer data never leave your device.

FAQ

Frequently asked questions

How do I convert CSV to JSON?

Paste or upload the CSV above and the converter turns the header row into object keys, producing one JSON object per data row. Because CSV has no types, numeric and boolean-looking values are inferred where unambiguous and left as strings otherwise, which avoids corrupting IDs and postcodes with leading zeros.

Why did my leading zeros disappear?

Because a value like 01234 was read as a number rather than text. Postcodes, phone numbers, account references and product codes should stay as strings. This converter leaves ambiguous values as strings by default for exactly this reason.

How does nested JSON convert to CSV?

CSV is a flat grid with no way to hold an object inside a cell, so nested values are flattened into dotted column names such as address.city, and arrays are joined into a single cell. The alternative would be silently dropping data. If your structure is deeply nested, CSV may not be the right target format.

Is it safe to convert files containing customer data?

With this tool, yes — conversion happens entirely in your browser and no file is ever uploaded to a server. That is worth checking with any converter, since CSV exports routinely contain names, email addresses and order histories.

Why are values wrapped in double quotes in the CSV output?
RFC 4180 (the CSV standard) requires values containing the delimiter character, double quotes, or newlines to be enclosed in double quotes. Any double quote within the value is escaped by doubling it (""). This ensures the CSV parses correctly in Excel, Google Sheets, and any standards-compliant parser regardless of the cell content.
Can I convert a JSON object (not an array) to CSV?
This tool expects a JSON array of objects — the most common export format for database records, API list responses, and report data. A single JSON object has no rows to convert. To convert a dictionary, wrap it in an array first: [{"key1":"val1","key2":"val2"}].
Does the tool handle nested objects in JSON?
Nested objects are flattened to a string representation in the CSV cell. Deep nesting (multiple levels) is not automatically flattened — you would need to pre-process the JSON to flatten it first. For complex nested structures, consider using jq locally or a dedicated ETL tool.
What is the maximum file size I can convert in the browser?
No server-side limit — processing is entirely in your browser. Very large files (hundreds of thousands of rows) may be slow because JavaScript processes each row synchronously. For production data pipeline use, a server-side or command-line tool (csvkit, jq, pandas) handles large volumes much faster.
Custom software

Need data pipeline or ETL tooling built?

ruxox builds custom data ingestion, transformation, and reporting tools for growing businesses. Free estimate in 48 hours.

Free project estimateNo obligation · reply in 48h
Get estimate