JSON ↔ CSV Converter

Convert between JSON and CSV formats instantly. Transform JSON objects to CSV tables or CSV data to JSON arrays with automatic type detection.

Quick Guide

JSON to CSV:

  1. 1.Paste your JSON array or upload a JSON file
  2. 2.Choose delimiter and formatting options
  3. 3.Click "Convert to CSV" to generate your table
  4. 4.Download or copy the CSV result

CSV to JSON:

  1. 1.Paste your CSV data or upload a CSV file
  2. 2.Configure header and type detection options
  3. 3.Click "Convert to JSON" to generate the array
  4. 4.Download or copy the JSON result

JSON Input

CSV Output

Your converted CSV will appear here

Instant Conversion

Convert between JSON and CSV formats in milliseconds with no server delays

Smart Detection

Automatically detects data types, headers, and optimal formatting options

Data Integrity

Preserves data types and handles special characters without data loss

Multiple Formats

Support for various delimiters, nested objects, and custom formatting

Common Conversion Scenarios

JSON → CSV API Data to Spreadsheet

Converting JSON API responses to CSV for analysis in Excel or Google Sheets:

[
  {"id": 1, "name": "Product A", "price": 29.99},
  {"id": 2, "name": "Product B", "price": 39.99}
]

Perfect for data analysis, reporting, and sharing with non-technical teams.

CSV → JSON Spreadsheet to API

Converting CSV exports to JSON for web applications and APIs:

id,name,price
1,Product A,29.99
2,Product B,39.99

Ideal for importing spreadsheet data into databases or web services.

Nested Data Complex JSON Structures

Handling nested objects and arrays with automatic flattening:

{
  "user": {
    "name": "John",
    "address": {
      "city": "New York"
    }
  }
}

Intelligently flattens nested structures for CSV compatibility.

Type Safety Automatic Type Detection

Preserves data types during conversion with smart detection:

"123" → 123 (number)
"true" → true (boolean)
"2024-01-01" → date handling

Maintains data integrity across format conversions.

Flattening Nested JSON for CSV

CSV is a flat, two-dimensional grid: rows and columns, with no concept of a nested object. JSON, by contrast, routinely nests objects inside objects. To bridge the two, this converter flattens nested objects using dot notation. A field like {"user": {"address": {"city": "New York"}}} becomes a single column headed user.address.city. Because each record may contain different keys, the converter scans every object, collects the full union of flattened keys, sorts them, and uses that as the header row, so records missing a particular field simply leave that cell empty rather than shifting columns out of alignment.

Arrays are handled differently from objects. Rather than exploding an array across many columns, the converter joins array values into a single cell separated by ;. So "tags": ["a", "b"] becomes one column containing a; b. This keeps the table readable, but it does mean deeply structured arrays of objects lose some fidelity. If you need every nested record as its own row, restructure the JSON into a flat array of objects first.

Delimiter, Quoting, and Escaping Pitfalls

The single most common cause of a mangled CSV is a value that itself contains the delimiter. If a product name is "Chair, Oak" and your delimiter is a comma, a naive converter would split it into two columns. Following RFC 4180, this tool automatically wraps any value containing the delimiter, a double quote, or a line break in double quotes, and it escapes embedded quotes by doubling them (" becomes ""). When reading CSV back into JSON, the parser respects those quotes so a quoted comma stays inside one field.

A few practical tips: if your data contains commas, switch to a semicolon or tab delimiter to keep the raw output easier to inspect. European spreadsheets often default to semicolons, so choose the delimiter your target program expects. When converting CSV to JSON, enabling auto-detect data types turns "123" into a number and "true" into a boolean. That is convenient, but disable it if you have identifiers like ZIP codes or phone numbers that must keep leading zeros and stay as strings.

Frequently Asked Questions

How does the converter handle nested JSON objects?

Nested objects are flattened using dot notation, so {"user": {"city": "NYC"}} becomes a column named user.city. The converter scans every record, builds the union of all flattened keys as the header row, and leaves cells empty where a record lacks that key. Arrays are joined into a single cell with semicolons rather than being split across columns.

Why does my CSV wrap some values in double quotes?

Following RFC 4180, any value that contains the delimiter, a double quote, or a line break is wrapped in double quotes so it stays inside a single field. Embedded quotes are escaped by doubling them. This prevents a value like "Chair, Oak" from being split into two columns when the delimiter is a comma.

Should I keep auto-detect data types on when converting CSV to JSON?

Leave it on when you want numbers and booleans typed correctly: "123" becomes 123 and "true" becomes true. Turn it off when you have identifiers like ZIP codes, phone numbers, or account numbers with leading zeros, because type detection would strip the zeros and store them as numbers.

Which delimiter should I choose?

Use a comma for most tools and general compatibility. Switch to a semicolon if your data itself contains commas or if you are targeting a European spreadsheet locale, and use tab-separated values when pasting into applications that expect TSV. The converter escapes values correctly regardless of which delimiter you pick.

Is my data uploaded to a server?

No. Both conversions run entirely in your browser using JavaScript. The JSON parsing, flattening, CSV escaping, and type detection all happen on your device, so your data is never sent to Fix42 or any third party.

What happens if my JSON is a single object instead of an array?

The converter wraps a single object in an array automatically, producing a one-row CSV. To convert many records at once, provide a top-level JSON array of objects: each object becomes one row and its keys define the columns.

Try it now!

Click "Load Sample" above to see the converter in action with example data. Perfect for testing API responses, database exports, or spreadsheet data.

Discussion

Start the conversation

Leave a comment

For notifications only, never displayed

Markdown supported0/2000

Be respectful and constructive

Loading comments...