CSV ↔ JSON Converter

Convert CSV and JSON array data bidirectionally.

Category: Converters

When to use?

Use it to convert CSV exported from Excel or a spreadsheet into JSON for an API request, or to export a JSON API response as CSV that opens in Excel.

How to use

  • Choose the direction (CSV → JSON or JSON → CSV).
  • Paste the data.
  • Review and copy the result.

Input Explanation

CSV is comma-separated text; the first line is used as the header (column names). JSON supports an array of objects ([{...}, {...}]).

Calculation Basis

A CSV parser like PapaParse recognizes commas, line breaks, and quote escapes to build a 2D array, then maps rows to JSON objects using the header row keys, or the reverse.

Usage Examples

  • Tidy spreadsheet data - Convert CSV into a JSON array for an API request.
  • Export a JSON response - Convert an object-array JSON to CSV to open in Excel.
  • Migrate data - Convert spreadsheet data to JSON to move to another system.

Examples

  • CSV: name,age\nJohn,30 → JSON: [{"name":"John","age":"30"}]
  • Enter a JSON array and pick CSV → reverse into a CSV with a header row

Cautions

  • Malformed source data can cause parsing errors or broken output.
  • A wrong delimiter (comma, tab, semicolon) or mixed line breaks can misalign columns.

Guides

Meaning of the CSV first line

When converting CSV to JSON, the first line is usually used as field names. If the first line is data, adjust the header option.

Values containing commas

If a value contains a comma or line break, wrap it in quotes so the CSV parses correctly.

FAQ

Does it handle CSV with quotes?

Yes, it handles quoted fields and escaped quotes inside fields.

Does it do JSON ↔ CSV both ways?

Yes, choose CSV → JSON or JSON → CSV on the same screen.

Is the first line used as the header?

For CSV → JSON, the first line is used as the object keys (header).

Can values contain commas?

Yes. A comma inside a quoted field is treated as part of the value, not a delimiter.

Related Tools