CSV to JSON

Convert CSV data to a JSON array. First row is used as headers.

Input CSV
1
JSON Output
Output appears here…
2sp · 14px · UTF-8

What is CSV?

CSV (Comma-Separated Values) is a plain-text format for storing tabular data. Each line represents one row, and columns are separated by a delimiter — usually a comma, but sometimes a semicolon, tab, or pipe character. The first row typically contains column headers.

CSV is the most universal data exchange format. Every spreadsheet tool (Excel, Google Sheets, LibreOffice), database (PostgreSQL, MySQL, SQLite), and analytics platform (BigQuery, Redshift, Snowflake) can import and export CSV. JSON is the standard format for REST APIs, NoSQL databases, and modern JavaScript applications. Converting between the two is a daily task in data engineering and API development.

CSV to JSON Conversion Example

Input CSV:

name,city,age,active
Ravi,Surat,28,true
Priya,Ahmedabad,24,false

Output JSON (array of objects):

json
[
  { "name": "Ravi",  "city": "Surat",     "age": 28, "active": true  },
  { "name": "Priya", "city": "Ahmedabad", "age": 24, "active": false }
]

Automatic Type Detection

The converter automatically infers value types instead of treating everything as strings:

CSV valueJSON typeExample
123, 3.14number"price": 3.14
true, falseboolean"active": true
null, NULL, (empty)null"note": null
"quoted string"string (quotes removed)"name": "John"
everything elsestring"city": "Surat"

Delimiter Support

DelimiterWhen to use
Comma (,)Default — standard CSV files from Excel and Google Sheets
Semicolon (;)European locales where comma is the decimal separator
Tab (\t)TSV files — data exported from databases or spreadsheets
Pipe (|)Data that contains commas and semicolons in values

Common Use Cases

  • Data migrationConvert exported database CSVs to JSON for import into MongoDB, Firestore or REST APIs.
  • Frontend mockingTurn a spreadsheet of sample data into a JSON fixture for UI development.
  • API payload buildingUpload a CSV, convert to JSON, then paste directly into Postman or curl.
  • ETL pipelinesFirst step in transforming flat CSV exports into structured JSON for further processing.

Frequently Asked Questions

Yes. The converter treats the first row as field names (keys) for every JSON object. If your CSV has no headers, add a header row before converting.

Missing cells are set to null in the output. Extra cells beyond the header count are ignored.

Yes. Fields wrapped in double quotes are unquoted, and escaped quotes ("") inside fields are converted to a single ".

Yes — use the JSON to CSV tool. It flattens nested objects using dot-notation.

No. All conversion happens in your browser using JavaScript. Your data never leaves your device.

Related Tools