← All tools
// Converter

CSV to JSON online

Convert CSV data to JSON array format with automatic header detection

CSV to JSON Converter logo
by
CHUNKY
MUNSTER
// CSV Input
// JSON Output
Output will appear here...

How to Use csv-to-json

  1. Paste your CSV data (with headers in row 1) into the input.
  2. The tool automatically detects the delimiter (comma or tab) and parses the headers.
  3. The JSON array appears in the output — each row becomes an object keyed by column name.
  4. Use the options to output a flat array or a nested structure with a custom root key.

Converting CSV to JSON is a daily task for developers working with data exports, API integrations, and database migrations. This converter parses the header row as object keys and maps each subsequent row to a JSON object — handling quoted fields, special characters, and numeric type detection automatically.

CSV to JSON Structure

Given a CSV with headers "id, name, email" and two data rows, the output is an array of objects: [{"id":"1","name":"Alice","email":"a@example.com"},{"id":"2",...}]. By default, all values are strings to preserve exactly what was in the CSV. Enable "Auto-type numbers and booleans" to convert obvious numbers (no quotes, valid numeric) and "true"/"false" strings to their JSON native types.

Frequently Asked Questions

What happens if a row has fewer columns than the header?

Missing fields are included as null in the output object so the key is present in every object — making downstream JSON processing predictable.

What if my CSV has no header row?

Enable the "No header row" option. Column keys become positional: "col1", "col2", etc. You can rename them in the output options.

How are numeric values handled?

By default, all CSV values are output as JSON strings. Enable "numeric inference" to convert unquoted, valid numeric values to JSON numbers. This is off by default because CSV numbers that look like IDs or codes (leading zeros, phone numbers) should remain strings.

Can I convert the output back to CSV?

Use the JSON to CSV tool (or CSV to JSON's reverse mode). The round-trip is lossless as long as all values are strings and the column order is preserved.

See also JSON to CSV, JSON Formatter, and the full data-format converter suite.