deftools.io Text & Data

CSV ↔ JSON Converter

Convert CSV to JSON and JSON to CSV online. Supports headers, custom delimiters, nested objects, and file upload.

0 chars
0 chars

About this tool

The CSV ↔ JSON Converter translates between two of the most common tabular data formats. Paste CSV on the left to get a JSON array of objects (one per row), or paste a JSON array on the left to get CSV on the right. Everything updates live as you type.

Example CSV input:
name,age,active
Alice,30,true
produces a JSON array with "name":"Alice", "age":30 (number), "active":true (boolean) when Auto-detect numbers & booleans is on. Turn it off and the same row keeps "30" and "true" as strings.

For JSON with nested objects, toggle Flatten nested objects to produce dot-notation column headers like user.name instead of a JSON-stringified cell. Choose comma, semicolon, tab, or pipe delimiters to match what your spreadsheet or database expects.

FAQ

How are numbers and booleans handled in CSV → JSON?

By default the converter detects integers, decimals, and the literal words true/false, and converts them to proper JSON types. Turn off "Auto-detect numbers & booleans" to keep every value as a string — useful when codes like "007" or "1.2.3" must not be reformatted.

What happens with nested objects in JSON → CSV?

CSV is flat, so nested objects need special handling. With "Flatten nested objects" on, {"address":{"city":"NYC"}} becomes a column named address.city. With it off, the entire nested value is written into one cell as a JSON string.

Does it handle quoted fields and commas inside values?

Yes. The CSV parser follows RFC 4180: fields wrapped in double quotes can contain commas, newlines, and escaped quotes (written as two double-quotes). The writer also auto-quotes any value that contains the delimiter, a quote, or a newline.

Can I convert a single JSON object instead of an array?

Yes. A bare object like {"a":1,"b":2} is wrapped into a one-row CSV automatically. A JSON array of objects produces one CSV row per element.

Can I pick which fields to export in JSON → CSV mode?

For field-level control — choose exactly which columns appear in the output — use the dedicated <a href="/tools/json-csv/">JSON to CSV with Field Selection</a> tool. It lets you check/uncheck individual fields before converting.

Related text & data tools

Copied!