CSV ↔ JSON Converter

Convert CSV to JSON or JSON arrays to CSV instantly in your browser — no upload, no server required.

Free up to 1 MB. Pro unlocks unlimited file sizes and file download. Go Pro →

CSV and JSON – Two Worlds, One Converter

CSV (Comma-Separated Values) is the oldest and most widely supported format for tabular data: simple, human-readable, and accepted by virtually every spreadsheet application, database and data pipeline tool. The format is described in RFC 4180 (published 2005), which defines the rules for quoting (fields containing commas, line breaks or quotation marks must be wrapped in double quotes; literal quotes are escaped by doubling them as ""), line endings (CRLF is the standard, though LF is widely accepted), and the optional first-row header. Delimiters vary by locale: English-locale systems use comma (,); many European systems — particularly Excel in German, French and Spanish locales — default to semicolon (;) to avoid conflict with the decimal comma.

JSON (JavaScript Object Notation) is the standard format for structured data in web APIs, configuration files, and modern databases such as MongoDB, PostgreSQL JSONB columns, and AWS DynamoDB. A JSON array of objects — a list in square brackets whose elements are curly-brace key-value maps — is the direct equivalent of a CSV table: each object is a row, and the keys are the column headers. JSON natively distinguishes types (string, number, boolean, null, array, object), which CSV cannot do — a fact that makes the CSV → JSON conversion step particularly valuable when loading data into typed systems.

This converter runs entirely client-side using PapaParse, a battle-tested open-source library that handles CSV edge cases in full compliance with RFC 4180: quoted fields containing commas or newlines, escaped double quotes, mixed line endings (CRLF/LF), BOM (byte-order mark) at the start of UTF-8 files, and auto-detection of the delimiter from the first few rows. Your data never leaves your browser — conversion works offline once the page is loaded, and no data is transmitted to any server at any point.

CSV → JSON conversion is useful when you need to load tabular data from Excel, Google Sheets or a database export into a web API, JavaScript frontend, or NoSQL database. JSON → CSV conversion is the right choice when you want to flatten API responses, log data or MongoDB exports into a spreadsheet — to analyse in Excel, share with non-technical colleagues via email, or import into another system. Both directions support file upload and direct text paste.

The tool is free and requires no account. Pro users additionally get file download (CSV or JSON as a named file) and can convert files of unlimited size — the free tier caps input at 1 MB, which covers the vast majority of everyday tasks. For data engineering pipelines handling hundreds of MB, the Pro tier removes that constraint with no file-size cap other than available browser memory.

How to Use the Converter

The converter has two modes: CSV → JSON and JSON → CSV. Select the mode you need and follow these steps:

  1. Choose a modeClick on 'CSV → JSON' or 'JSON → CSV'. Both modes support direct text paste and file upload. All processing runs locally in your browser — you can even use the tool offline after the page has loaded once.
  2. Paste data or upload a filePaste your CSV or JSON text into the input field, or click 'Upload' to open a local file (up to 1 MB free, unlimited for Pro). For CSV, the tool auto-detects the delimiter from the first few rows — you can override it manually if needed. UTF-8 encoded files with or without BOM are handled correctly.
  3. Adjust optionsIn CSV → JSON mode, specify whether the first row contains column headers (default: yes). Without headers, columns are named field_1, field_2, etc. In JSON → CSV mode, choose the output delimiter — comma for international use, semicolon for European Excel, tab for direct paste into spreadsheets. Both settings take effect immediately in the preview.
  4. ConvertClick 'Convert' or press Ctrl + Enter. The result appears instantly in the output area, along with a row and column count. In CSV → JSON mode, numeric strings are automatically coerced to JavaScript numbers and true/false strings to booleans — matching the type inference that most REST API consumers expect.
  5. Copy or download the resultClick 'Copy' to send the result to your clipboard — paste directly into an editor, IDE or terminal. Pro users can additionally download the result as a properly named .json or .csv file with a single click.

All data is processed exclusively in your browser using PapaParse. Nothing is sent to any server at any point, including during file upload.

Under the Hood: Delimiters, Headers, Type Coercion and Escaping

CSV sounds simple — but it has well-known edge cases. RFC 4180 specifies the rules precisely: (1) fields containing commas, double quotes or newlines must be wrapped in double quotes; (2) literal double quotes inside a quoted field are escaped by doubling them (""); (3) line endings are CRLF in strict RFC 4180, but LF-only files are accepted by most parsers in practice; (4) the first row may optionally be a header. PapaParse handles all these cases correctly, including multi-line field values, mixed line endings, and BOM-prefixed UTF-8 files produced by Windows tools. The auto-detect mode analyses the first five rows, counts candidate delimiter characters, and selects the most frequent one — this is correct for over 95% of real-world exported files.

In CSV → JSON mode, all values are initially read as strings. PapaParse's type coercion then applies: if a value consists only of digits with an optional decimal point and/or leading sign, it is converted to a JavaScript number (e.g., '28' → 28, '3.14' → 3.14). The strings 'true' and 'false' (case-insensitive) are converted to JavaScript booleans. Empty fields are represented as empty strings or null depending on the parser option. To prevent unwanted coercion — for example, for ZIP codes like '01234' or IBAN numbers — wrap the value in double quotes in the CSV source (e.g., "01234"). In JSON → CSV mode, all values are serialised to UTF-8 CSV; the tool automatically adds quoting wherever the RFC 4180 rules require it.

JSON → CSV only supports flat arrays of objects (arrays of primitives and single JSON objects are not supported). Column names are derived from the union of all keys across all objects in the array, using the first object's key order; missing values in subsequent objects are output as empty fields. Nested objects or arrays within a value are serialised as a compact JSON string into a single cell — no data is silently dropped. For deeply nested structures (e.g., MongoDB documents or API responses with embedded objects), consider flattening with a tool like jq before converting, so that each nested property becomes its own column.

Use Cases

Load Excel Exports into a Web API

Export data from an Excel spreadsheet or Google Sheets as CSV (File → Download → CSV), then convert it to a JSON array in seconds — no Python script, no Excel formula magic. The result can be pasted directly into a REST API body, a JavaScript const data = [...] import, or a database seed file. Type coercion ensures that numeric cells arrive as numbers, not strings.

Open API Responses in Spreadsheets

Copy a JSON array from a REST API response, a database tool output (MongoDB Compass, DBeaver, Postman), or a log file, convert it to CSV with tab delimiter, and paste directly into an open Excel or Google Sheets tab without any import dialog. Column headers are auto-generated from the JSON object keys.

Data Migration and ETL

Migrate between systems: read source data from a legacy CSV export (from CRM, ERP or accounting software) and import it as JSON into modern cloud services, NoSQL databases, or REST APIs. The browser-local processing means even confidential customer records or financial data can be transformed without touching a cloud conversion service.

Tabular Configuration Files

Maintain configuration data — price lists, product catalogues, feature flags, permission matrices — as CSV for easy editing in spreadsheet applications, then convert to JSON on demand for direct consumption by the application. This round-trip works in both directions: edit the JSON directly, convert back to CSV to update the spreadsheet master.

Example: CSV → JSON

A typical CSV file with three columns and two records is converted to a JSON array of objects. Numbers and booleans are automatically coerced to the correct type:

Input (CSV):
name,age,active
Anna,28,true
Ben,34,false

Output (JSON):
[
  { "name": "Anna", "age": 28, "active": true },
  { "name": "Ben", "age": 34, "active": false }
]

PapaParse automatically detects the header row, converts '28' and '34' to numbers, and 'true'/'false' to booleans — no manual configuration needed.

Tips & Limitations

Tips

  • If your CSV has no header row, turn off 'First row is header' — columns will be named field_1, field_2, etc.
  • European CSV files from Excel usually use semicolon as the delimiter. Select 'Semicolon' or let auto-detect handle it.
  • For JSON → CSV: the JSON must be a flat array of objects. Use the JSON Formatter to inspect complex structures before converting.
  • Copy tab-delimited CSV results directly into Excel or Google Sheets — they paste without any import dialog.

Limitations

  • JSON → CSV only supports flat arrays. Deeply nested JSON structures are serialized into string cells.
  • The free tier limits input to 1 MB. Larger files require Pro.
  • File download is a Pro feature. In the free tier, results can only be copied to clipboard.
  • Circular references in JSON cannot be serialized and will produce an error.

Frequently Asked Questions

Is my data sent to a server?

No. Conversion happens entirely in your browser using PapaParse. Neither your CSV nor your JSON leaves your device. The tool even works offline once the page has loaded.

Which delimiters are supported?

Comma (,), semicolon (;), tab (\t), and pipe (|). With 'Auto-detect', PapaParse analyzes the first few rows and picks the most frequent character — reliable for the vast majority of real-world files.

What happens if my CSV has no header row?

Disable 'First row is header'. Columns will automatically be named field_1, field_2, etc. You can rename them in the JSON output afterwards.

What JSON format is required for CSV export?

The JSON must be an array of objects: [{...}, {...}]. A single object or an array of primitives (numbers, strings) is not supported.

Are numbers and booleans detected correctly?

Yes. In CSV → JSON mode, PapaParse automatically detects numeric values and true/false and converts them to the appropriate JavaScript type. To keep everything as strings, wrap numbers in quotes in your CSV (e.g. "28").

What is the maximum file size?

The free tier supports files up to 1 MB. Pro users can process files of any size — limited in practice only by the browser's available memory.

Can I download the result as a file?

File download is a Pro feature. In the free tier you can use the copy button to put the result in your clipboard, then paste it into any editor or spreadsheet.

What happens to nested JSON when exporting to CSV?

Nested objects or arrays within a JSON object are serialized as a JSON string into a single CSV cell. No data is lost, but the cell will contain JSON rather than a plain value. For deeply nested structures, consider flattening them first.

Does the tool support UTF-8 and special characters?

Yes. The converter handles UTF-8 encoded text including accented characters, umlauts, and other special characters. Downloaded files are always UTF-8 encoded.

How should I handle very large files?

PapaParse supports streaming processing. For very large files (several MB), the Pro tier is recommended as it removes the size limit. Process large files in a single pass rather than repeatedly, since the browser holds the data in memory.

Why does Excel produce a semicolon-delimited file instead of a comma-delimited one?

Excel uses the list separator configured in your operating system's regional settings as the CSV delimiter — not necessarily a comma. On systems with a German, French, Spanish or many other European locales, the decimal separator is a comma, so Excel defaults to semicolon (;) as the list separator to avoid ambiguity. When opening a semicolon CSV in Excel on an English locale machine, use the 'Get Data from Text/CSV' import wizard rather than double-clicking the file. This converter handles both automatically via the auto-detect or manual semicolon option.

How do I prevent ZIP codes or IBAN numbers from losing their leading zeros?

PapaParse's type coercion converts values that look like numbers to JavaScript numbers, which drops leading zeros. To preserve leading zeros, wrap the value in double quotes in your CSV source — e.g., "01234" instead of 01234. The double-quoted value is treated as a string and passed through unchanged. In JSON → CSV output, string values are always written as strings with their leading zeros intact.

Can I convert JSON that comes from a REST API directly?

Yes, as long as the top level is an array of objects: [{...}, {...}]. Many REST APIs return this format directly. If the API wraps the array in an envelope object (e.g., {"data": [{...}]}), you need to copy just the inner array. You can use your browser's developer tools or a JSON formatter to extract it. Paste the array into the JSON input field, choose your delimiter, and convert.

Related Tools