HomeToolsDeveloper Tools › CSV to JSON Converter

CSV to JSON Converter — Free Online Tool

Convert CSV to JSON instantly. Paste or upload a CSV file and get Array of Objects, Array of Arrays, Keyed JSON, or JSONLines output — no sign-up, nothing stored.

Processed on our server — your CSV is never stored or logged.
CSV Input 0 chars
Upload .csv / .tsv / .txt (up to 20 MB)
Output format
Advanced options
Delimiter
Empty cells

About CSV to JSON Converter

CSV to JSON Converter takes any CSV file — from a spreadsheet export, database dump, CRM extract, or analytics platform — and turns it into structured JSON in one step. Paste your data directly or upload a file up to 20 MB. The converter processes everything on the server using PHP's native fgetcsv() function, which handles quoted fields, embedded commas, and escaped quotes correctly. Nothing is stored or logged after the response is sent.

Four output formats

Array of Objects (default): Each row becomes a JSON object with the header row as keys — [{"name":"Alice","age":"30"},{"name":"Bob","age":"25"}]. This is what most REST APIs and JavaScript applications expect.

Array of Arrays: Each row becomes a plain array of values — [["Alice","30"],["Bob","25"]]. Useful when consuming the data in code that already knows the column order.

Keyed JSON: The first column value becomes the object key — {"Alice":{"age":"30"},"Bob":{"age":"25"}}. Ideal for building lookup tables where you want to access rows by identifier.

JSONLines / NDJSON: One JSON object per line, no wrapping array — one line per row. Standard format for streaming ingestion, log pipelines, and ML training data.

Delimiter auto-detection

The Auto delimiter option (default) counts occurrences of commas, tabs, semicolons, and pipes in the first 10 lines and picks the most common one. This handles most CSV and TSV files without any configuration. You can also force a specific delimiter, or enter a custom single character in the Advanced section.

Privacy

Your CSV data is sent to the server only for the duration of the conversion and discarded immediately after. Nothing is written to disk, logged, or retained between requests.

Common use cases

Frequently asked questions

How do I convert CSV to JSON?

Paste your CSV into the text area or upload a .csv/.tsv/.txt file (up to 20 MB). Choose your output format (Array of Objects is the default), then click "Convert to JSON". The result appears in the output panel with Copy and Download buttons.

What's the difference between Array of Objects and Array of Arrays?

Array of Objects uses the header row as keys — each row becomes {"name":"Alice","age":"30"}. Array of Arrays skips the key naming and outputs raw row values — [["Alice","30"]]. Use Array of Objects when your code needs to access values by field name; use Array of Arrays when you control the column mapping in code.

Can I convert a large CSV file (over 10 MB) to JSON?

Yes. The tool accepts files up to 20 MB. Larger files are processed using PHP's stream-based fgetcsv() which reads line by line rather than loading the entire file into memory, so performance stays consistent even for large inputs.

How do I convert CSV to JSONLines (NDJSON)?

Select "JSONLines" in the output format group before clicking Convert. The output will have one JSON object per line with no wrapping array — the NDJSON format used by Elasticsearch bulk API, Kafka Connect, and most ML training pipelines.

Is my CSV data uploaded to a server?

Yes — conversion happens server-side using PHP's native fgetcsv() function. Your CSV is sent over HTTPS and discarded immediately after the response is sent. Nothing is written to disk or retained between requests.

Can I use custom delimiters like tab or semicolon?

Yes. The Auto option (default) detects the delimiter automatically. You can also select comma, tab, semicolon, or pipe explicitly in the Advanced section, or enter any single character as a custom delimiter.

How are CSV files with commas inside quoted fields handled?

Correctly. PHP's fgetcsv() fully supports RFC 4180 — fields containing the delimiter character, newlines, or double quotes are enclosed in double quotes and parsed correctly. For example, "Alice, Bob" in a quoted field is treated as one value, not two columns.

Keep going

More developer tools

LiveDeveloper

JSON to CSV Converter

The inverse tool — convert JSON arrays back to a CSV spreadsheet. Supports Array of Objects, Array of Arrays, and JSONLines input with nested object flattening.

Open tool
LiveDeveloper

JSON Formatter & Validator

Format and validate your converted JSON output — pretty-print or minify and confirm the structure is correct before using it in code or APIs.

Open tool
LiveDeveloper

YAML to JSON Converter

Convert YAML config files to JSON — pairs with this tool for data pipeline work where config is YAML but the API expects JSON.

Open tool
LiveDeveloper

JSON Diff Checker

Compare two JSON arrays side by side — useful for verifying that a CSV-to-JSON conversion produced the expected output vs. a reference file.

Open tool