CSV to JSON Converter.

Convert CSV or TSV into clean JSON in one click. Choose your output shape, let the tool detect the delimiter, infer numbers and booleans, and copy or download the result — all in your browser.

No signup · No uploads · No file-size cap

JSON output

Convert CSV to JSON online — free and private

A CSV to JSON converter turns spreadsheet-style rows and columns into structured JSON that APIs, databases, and JavaScript can consume directly. Paste your CSV above, press Convert to JSON, and the tool reads your header row, maps each data row to an object, and infers real types. Because everything runs client-side, you can convert CSV to JSON online without uploading a single byte.

How to convert CSV to JSON in three steps

  1. Paste your CSV into the input, or click “Load sample” to see the format.
  2. Choose your options — output shape, delimiter (or auto-detect), whether the first row is a header, and whether to infer types.
  3. Convert and export — copy the JSON or download it as data.json.

Pick the output shape your code needs

Most converters give you exactly one shape. This one offers three. Array of objects produces one object per row keyed by your headers — the shape almost every REST API and JavaScript app expects. 2D array returns the raw grid as an array of arrays, ideal for spreadsheets, charts, and table libraries. Keyed by column returns a column-oriented object ({ "name": [...], "age": [...] }) that maps cleanly onto a pandas DataFrame or a columnar store.

Delimiter detection, TSV, and type inference

The converter automatically detects whether your data is separated by commas, semicolons, tabs, or pipes — so TSV to JSON and European semicolon files just work — and you can always override it. With type inference on, numbers become numbers, true/false become booleans, and null is recognised, while identifiers with leading zeros stay as strings so you never lose a ZIP code or product code. Turn inference off for fully lossless string output.

Convert CSV to JSON in Python, JavaScript, or the terminal

If you need this inside a script rather than as a one-off export, these are the standard approaches. The tool above produces the same results — it is simply quicker when you only need the file once.

Python (pandas)orient maps directly onto the three output shapes offered above:

import pandas as pd

df = pd.read_csv("data.csv")
df.to_json("data.json", orient="records", indent=2)  # array of objects
df.to_json("data.json", orient="values")             # 2D array
df.to_json("data.json", orient="list")               # keyed by column

Python (standard library)DictReader reads the header row for you, though every value stays a string:

import csv, json

with open("data.csv", newline="") as f:
    records = list(csv.DictReader(f))

with open("data.json", "w") as f:
    json.dump(records, f, indent=2)

JavaScript / Node.js — fine for simple, well-formed CSV. Note it will break on quoted fields that contain commas, which is exactly why a real parser matters:

const [head, ...lines] = input.trim().split("\n");
const cols = head.split(",");

const rows = lines.map((line) =>
  Object.fromEntries(line.split(",").map((v, i) => [cols[i], v]))
);

Command line (jq) — useful in a shell pipeline:

jq -R -s -f csv2json.jq data.csv > data.json
# or, with Miller:
mlr --icsv --ojson cat data.csv > data.json

The naive versions above all share one weakness: they split on commas blindly. The converter on this page uses a full RFC 4180 parser, so quoted fields, embedded commas, and line breaks inside a cell are handled correctly.

Common CSV to JSON problems (and fixes)

“My values with commas are splitting into extra columns.” That is a naive splitter, not a parser. A value like "Smith, John" must stay in one field — the RFC 4180 parser here does that automatically.

“My numbers came out as strings.” Turn on Infer types and numeric values become real JSON numbers, with true, false, and null recognised too.

“My ZIP codes lost their leading zeros.” The opposite problem — inference being too eager. This tool keeps leading-zero identifiers as strings by design, but you can switch inference off entirely for lossless output.

“My file is semicolon-separated.” Common in European locales. Auto-detect picks it up, and you can force the delimiter if the guess is wrong — the same goes for TSV.

“I actually have an Excel file.” Skip the CSV export and use the Excel to JSON converter, which reads .xlsx workbooks and multiple worksheets directly.

Why use this CSV to JSON tool?

Unlike converters that upload your file to a server and cap large inputs, this one parses everything locally with no file-size limit. Its RFC 4180 parser correctly handles quoted fields, commas inside values, and line breaks within a cell — the cases that break naive splitters. Going the other way? Use the JSON to CSV converter, explore data with the JSON viewer, or tidy output with the JSON formatter. Once your CSV is JSON, you can generate TypeScript interfaces from it, build a JSON Schema to validate future rows, load it into a database with the JSON to SQL converter, or preview it as a sortable grid in the JSON to table tool. Learn more in our guide on how to convert CSV to JSON.

FAQ

CSV to JSON, answered.

How do I convert CSV to JSON online? +

Paste your CSV (or TSV) data into the converter above and press Convert to JSON. The tool reads the first row as column names, turns each remaining row into an object, and shows formatted JSON instantly. You can copy it or download a .json file. Everything runs in your browser, so nothing is uploaded.

What output shapes can I choose? +

Three. Array of objects gives one object per row keyed by the header (the most common shape for APIs). 2D array returns an array of arrays — the raw grid, useful for spreadsheets and plotting. Keyed by column returns a column-oriented object where each key maps to an array of that column's values, handy for data frames and analytics.

Does it detect the delimiter automatically? +

Yes. By default the converter sniffs whether your file uses commas, semicolons, tabs, or pipes and tells you which it found. You can also force a specific delimiter — choosing tab handles TSV files, and Custom lets you enter any character.

How are numbers and booleans handled? +

With Infer types on (the default), values that look like numbers, true, false, or null are converted to real JSON types instead of strings, while IDs with leading zeros like 007 are kept as strings. Turn inference off to keep every value as a string — useful when you need exact, lossless text.

Can my CSV contain commas and line breaks inside a field? +

Yes. The parser follows RFC 4180, so quoted fields can contain the delimiter, line breaks, and escaped double quotes (""). A value like "Smith, John" stays in a single field rather than splitting into two columns.

Is there a file size limit, and is my data safe? +

There is no size cap — conversion happens entirely on your device, so the only limit is your browser's memory, and large CSVs that server-based tools reject convert fine here. Your data is never uploaded, stored, or seen by any server, making it safe for exports and private records.

How do I convert a large CSV file to JSON? +

Paste or drop it in and convert — there is no size cap. Server-based converters typically reject files above about 10 MB because they must upload and process them first; this tool never uploads anything, so large exports convert as long as your browser has the memory available.

What if my CSV has no header row? +

Turn the header toggle off. The converter then treats every line as data and keys each column generically (column1, column2, and so on) for the array-of-objects shape, or you can switch to the 2D array shape to keep the raw grid exactly as it appears.

Why are my leading zeros disappearing? +

That is type inference turning a value like 007 into the number 7. This converter guards against it — identifiers with leading zeros are deliberately kept as strings. If you want every value preserved exactly as written, switch type inference off for fully lossless string output.

Can I convert Excel to JSON as well? +

Yes, but use the Excel to JSON converter for that — it reads .xlsx workbooks directly, including multiple worksheets, so you do not have to export to CSV first. This page is for CSV and TSV text. Both run entirely in your browser.