Skip to content

Free · Reliable output · No signup

Convert CSV to JSON

Turn a CSV into an indented JSON array of objects, with stable keys for blank or duplicate headers.

Add as many files as you need. Up to 1 GiB per file. Keep this tab open until your downloads finish.

Batch conversion uses the standard settings. Open Customize a file below to change them.

Conversion starts as soon as you choose files. Files download automatically when ready. Your browser may ask to allow multiple downloads.

Customize a file · settings, paste and edit

CSV → JSON

Free conversion in your browser. Your file stays on this device.

Local processing
8 fictional sales rows · CC0
  1. Choose your CSV

    Open a file, paste CSV text, or try the sample.

  2. Review the preview

    Adjust available settings and check the output. Edit CSV lets you change source values.

  3. Copy or download

    Save your .json file with the current settings.

Output preview

Example output
[
  {
    "Project": "Website",
    "Status": "Ready"
  },
  {
    "Project": "Docs",
    "Status": "In progress"
  }
]

Preview is limited to the first 20 rows and 16,000 characters. Download includes every row within the tool limits.

Three simple steps

How to convert CSV to JSON

  1. 1. Open your CSV

    Choose several CSV files and convert them together. For column settings, pasted text or editing, open Customize a file. The first row supplies column headers.

  2. 2. Review the output

    Follow each file’s progress. View opens a short preview without leaving the page; use Customize a file when you need different format settings.

  3. 3. Save your result

    Copy the complete output or download a .json file. Downloads start when files are ready, with a Download button for every result. No signup or payment is required.

Output contract

What the JSON converter writes

Each CSV row becomes one JSON object. Column labels become object keys; blank and duplicate source headers receive stable, unique names so no value is overwritten.

The preview is bounded so larger files stay manageable. Downloads use the complete parsed document within the format limits, including changes made in the editor.

Parsing and conversion happen on your device. Your CSV is not uploaded to a conversion server. An error preserves the current input so you can adjust settings or edit the source and try again.

Other ways to convert CSV to JSON

Prefer a script or command line? These examples run on your computer. They create separate files; review their output rules because external tools can handle types and empty values differently from this page.

Convert CSV to JSON with Python

Run this on your own computer using Python 3. Save a UTF-8, comma-delimited input.csv in the same folder as the script. The first record must contain unique, nonempty headers; quoted commas and line breaks are parsed as fields.

Before you start

  • Python 3 installed. Package commands below use a local virtual environment on macOS/Linux; on Windows use .venv\Scripts\python.exe in place of .venv/bin/python.
  • Keep the original CSV. These examples read the complete table into memory and create separate output files.
  1. Save the Python code as convert_csv.py beside input.csv.
  2. Install the listed package when required, then run the script. Check the generated output before using it elsewhere.
Save as convert_csv.py
import csv
from pathlib import Path

with open("input.csv", encoding="utf-8-sig", newline="") as source:
    reader = csv.reader(source, strict=True)
    headers = next(reader)
    rows = list(reader)
if not headers or any(not h for h in headers) or len(set(headers)) != len(headers):
    raise ValueError("Use unique, nonempty column headers")
if any(len(row) != len(headers) for row in rows):
    raise ValueError("Every record must have the same number of fields as the header")

import json
records = [dict(zip(headers, row)) for row in rows]
Path("output.json").write_text(json.dumps(records, ensure_ascii=False, indent=2), encoding="utf-8")

Run the conversion
python3 convert_csv.py

Limits and output

  • Writes one JSON array of objects. All cells remain strings: 001 stays "001", and an empty field stays "" rather than null. Unlike the browser converter, this example rejects blank or duplicate headers instead of renaming them.

Documentation: Python CSV reader and writer; Python JSON serialization

Convert CSV to JSON with DuckDB

Use DuckDB through Python to read local CSV data and write a separate output file. No database server or upload is required.

Before you start

  • Python 3 and the DuckDB Python package. Run beside input.csv with a header record.
Install DuckDB
python3 -m venv .venv
.venv/bin/python -m pip install duckdb

Save as convert_duckdb.py
import duckdb
from pathlib import Path
if "__CSV_NO_NULL__" in Path("input.csv").read_text(encoding="utf-8-sig"):
    raise ValueError("Choose a null marker absent from your input")
with duckdb.connect() as database:
    database.execute("CREATE TABLE source AS SELECT * FROM read_csv('input.csv', header=true, all_varchar=true, nullstr='__CSV_NO_NULL__', delim=',')")
    database.execute("COPY source TO 'output.json' (FORMAT JSON, ARRAY true);")

Run DuckDB conversion
.venv/bin/python convert_duckdb.py

Limits and output

  • All columns are read as text and empty cells remain empty strings. The reserved null marker is checked before parsing. DuckDB can normalize duplicate or blank column names; review the resulting schema.

Documentation: DuckDB CSV reading options; DuckDB COPY exports

Convert CSV to JSON with ClickHouse

clickhouse local runs against files on your computer, without starting or connecting to a ClickHouse server.

Before you start

  • Install the ClickHouse binary using the official installation guide. The command assumes clickhouse is on your PATH and input.csv is in the current directory.
  • Choose a new output filename; INTO OUTFILE refuses to overwrite an existing file.
Convert with clickhouse local
clickhouse local --input_format_csv_use_best_effort_in_schema_inference=0 --schema_inference_make_columns_nullable=0 --query "SELECT * FROM file('input.csv', 'CSVWithNames') INTO OUTFILE 'output.json' FORMAT JSONEachRow SETTINGS output_format_json_array_of_rows=1"

Limits and output

  • These settings disable numeric/date inference and nullable columns, preserving empty fields as strings in this example. ClickHouse still has format-specific null markers such as backslash-N; review null settings and output order for your own data rather than assuming identical output to the browser converter.
  • The JSON array setting wraps objects in a JSON array. Without that setting, JSONEachRow writes JSON Lines instead.

Documentation: ClickHouse installation; clickhouse-local documentation; ClickHouse CSV input format

Plain answers

JSON conversion questions

How can I try a CSV to JSON example with literal values?

Open Customize a file, choose Paste CSV and enter a header line id,status,note followed by a new line 00123,NULL,. Choose Use pasted CSV. The Output preview shows one object with "id": "00123", "status": "NULL" and "note": "". Values such as true, dates and very large identifiers also remain strings; empty cells do not become JSON null. Copy JSON or Download .json creates the complete output. This local customization path accepts one CSV up to 50 MB, subject to browser memory and decoded-table limits. It does not overwrite your source file.

What happens to blank or duplicate CSV headers in JSON?

JSON object keys use the editor’s unique column labels. Outer header whitespace is trimmed, blank headers receive labels such as Column 3, and repeated labels receive suffixes such as id (2), avoiding existing names. For example, headers id,id,,status and data 00123,00456,,true produce keys id, id (2), Column 3 and status with string values "00123", "00456", "" and "true". The JSON therefore keeps separate values but does not preserve the original header spelling or duplicate names. Keep the original CSV when those exact headers matter.

Does JSON export include rows hidden by a filter?

In Customize a file, Copy JSON and Download .json include the complete parsed document, including edits returned with Return to converter. Filters and view sorting in Edit CSV do not limit or reorder this converter output. The Output preview shows at most the first 20 records and 16,000 characters; it can end before the complete JSON. Download the file to inspect every record within the tool limits. Conversion creates a separate file and does not save changes to the original CSV.

Is this a real JSON file?

Yes. The download is valid JSON text created from the parsed CSV table.

When is the download created?

The output preview appears after parsing. Copy and download generate the complete output with your current settings; the preview can show fewer rows than the exported file.

What happens to data types?

Cells stay as text by default, preserving identifiers and leading zeroes. SQL and SQLite allow explicit column types; invalid values are reported before download.