CSV ↔ JSON Converter

Convert CSV to JSON and JSON to CSV with custom delimiters, header detection, and data preview. Upload files or paste data directly. Download results as .json or .csv.

What is CSV ↔ JSON Converter?

A CSV ↔ JSON Converter transforms data between two of the most universally important data formats in software and data work. CSV (Comma-Separated Values) is the lingua franca of tabular data—virtually every spreadsheet application (Excel, Google Sheets, LibreOffice), database (MySQL, PostgreSQL, SQLite), data analytics platform (Tableau, Power BI, Pandas), and data export tool can read and write CSV. JSON (JavaScript Object Notation) is the universal format for web APIs, NoSQL databases (MongoDB, Firebase, DynamoDB), configuration files, and frontend applications. The need to convert between them is constant: a data analyst exports a report from Excel as CSV and needs to load it into a MongoDB collection as JSON documents; a developer receives a JSON API response with hundreds of records and needs to open it in a spreadsheet for inspection; a data engineer needs to transform a database export CSV into JSON for an ETL pipeline; or a product manager needs to convert a JSON config into a CSV for a business team to edit in Excel. This tool handles the tricky edge cases that simple converters miss: fields containing the delimiter character (comma in a comma-delimited file), fields containing newlines, quoted fields with escaped quotes inside, and headers with special characters.

How to Use CSV ↔ JSON Converter

Select the conversion direction at the top: CSV → JSON (for turning spreadsheet data into structured JSON objects) or JSON → CSV (for flattening JSON records into a spreadsheet-compatible table). For CSV to JSON: paste your CSV data into the input area or click Upload to select a .csv or .tsv file from your computer. Choose the delimiter that matches your file (comma for .csv, tab for .tsv, semicolon for European-format CSVs, or pipe for custom formats). Toggle 'First row is header' to use the first row as the JSON property names—without this, column names default to col1, col2, col3. Click Convert to generate the JSON array of objects. For JSON to CSV: paste a JSON array of objects (e.g., [{"name":"Alice","age":30}]) or upload a .json file. The tool reads the keys of the first object as CSV headers and maps each object as a row. Click Convert to generate the CSV, then use Copy or Download to save the result.

FAQ

What delimiters are supported?

The tool supports comma (standard CSV), tab (TSV—Tab-Separated Values), semicolon (common in European CSV exports from Excel where commas are used as decimal separators), and pipe | (used in some database exports and log files). When you upload a file, the tool auto-detects the likely delimiter from the file extension (.csv vs .tsv) and the first few rows of content. You can override the auto-detected delimiter using the selector.

How does it handle fields that contain commas or newlines?

Fields containing the delimiter character are wrapped in double quotes in proper CSV format. For example, a field containing 'Smith, John' in a comma-delimited file appears as '"Smith, John"'. Fields containing newlines are similarly quoted. The converter correctly parses these quoted fields during CSV → JSON conversion, so the value in the resulting JSON object will be 'Smith, John' without the quotes. Double quotes inside fields are escaped as two consecutive double quotes ("") in CSV format.

What JSON structure is expected for JSON → CSV conversion?

The converter expects a JSON array of objects where each object represents a row and has consistent keys: [{"name":"Alice","age":30,"city":"Seoul"},{"name":"Bob","age":25,"city":"Tokyo"}]. The keys of the first object become the CSV column headers, and all subsequent objects are mapped to rows. If objects have different keys (sparse data), missing values appear as empty cells. Arrays of arrays are also supported, generating CSV with generic column headers (col1, col2, etc.).

Can I convert large CSV files with thousands of rows?

Yes. The tool processes data entirely in your browser using efficient JavaScript parsing, handling files up to several MB without issues. For very large files (tens of MB or hundreds of thousands of rows), performance depends on your device's memory and browser. For truly large datasets (millions of rows), command-line tools like csvkit or Python's pandas library are better suited. The tool shows a row count after conversion so you can verify all records were processed.

How do I convert a CSV exported from Excel to JSON?

Export your Excel file as CSV (File > Save As > CSV UTF-8). If the file was created on a European locale, Excel may use semicolons as delimiters instead of commas—select Semicolon in the delimiter dropdown. Paste the CSV content or upload the file. Enable 'First row is header' to use your column names as JSON keys. Click Convert. The resulting JSON array can be directly used in a REST API, imported into MongoDB with mongoimport, or used with JavaScript's fetch API.