Free tool

CSV to JSON converter

Paste CSV, cells copied from Excel or Google Sheets, or a .csv file, and get JSON as you type. The header row becomes the keys, the delimiter is detected for you, and numbers and booleans become real JSON types without mangling zip codes or long IDs.

Free · no sign-up · runs in your browser, nothing is uploaded

CSV
Drop a .csv or .tsv file, or click to choose one

JSON appears here as you type.

Output shape

Values

Empty cells:
Indent:

How CSV values become JSON types

CSV has no types: every field is text. With type detection on, the converter turns a value into a JSON number, boolean or null only when that loses nothing. Everything else stays a string.

CSV valueJSONWhy
4242Plain number
-3.5e2-350Decimal and exponent forms are numbers
true / TRUEtrueBooleans, any case
null / NULLnullThe word null
02134"02134"A leading zero would be lost
+44"+44"Phone numbers and codes keep their plus
1,000"1,000"Thousands separators are not JSON numbers
12345678901234567890"12345678901234567890"Above 2^53 - 1, JavaScript cannot store it exactly
(empty)"" / null / left outYour choice under Empty cells

Types are also checked per column. If one value in a column has to stay text, such as the zip code 04050, every number in that column stays text too. So a zip column gives "04050" and "78701", never a mix of strings and numbers that breaks code expecting one type.

Many converters, including Papa Parse with dynamicTyping, turn 007 into 7. That breaks zip codes, SKUs and account numbers, which is why this tool keeps them as text.

Five JSON shapes, and when to use each

ShapeLooks likeGood for
Array of objects[{"sku": "A-100", "price": 49.9}]APIs, fixtures, most code
Array of arrays[["sku","price"], ["A-100", 49.9]]Small payloads, spreadsheets libraries
NDJSON{"sku": "A-100", ...}\n{"sku": "A-101", ...}Streaming, logs, bulk imports
Keyed by first column{"A-100": {"price": 49.9}}Lookups by ID
Columns{"sku": ["A-100"], "price": [49.9]}Charts, dataframes

With "Keyed by first column", rows that share a key overwrite each other; the tool tells you how many did.

Convert CSV to JSON in JavaScript, Python or the shell

JavaScript with Papa Parse, the parser this page uses. Splitting on commas by hand breaks on quoted fields like "Desk lamp, brass", so use a real parser:

import Papa from 'papaparse';

const { data, errors } = Papa.parse(csvText, {
  header: true,          // first row = keys
  skipEmptyLines: true,
  dynamicTyping: true,   // "42" -> 42, "true" -> true (also "007" -> 7)
});
const json = JSON.stringify(data, null, 2);

Python with the standard library. utf-8-sig drops the byte order mark Excel adds to UTF-8 CSV files, so your first key is not \ufeffsku:

import csv, json

with open("products.csv", newline="", encoding="utf-8-sig") as f:
    rows = list(csv.DictReader(f))      # values stay strings

with open("products.json", "w", encoding="utf-8") as f:
    json.dump(rows, f, indent=2, ensure_ascii=False)

pandas infers types per column, so pass dtype=str for columns with leading zeros:

import pandas as pd

df = pd.read_csv("products.csv", dtype={"zip": str})   # keep leading zeros
df.to_json("products.json", orient="records", indent=2, force_ascii=False)

Miller on the command line converts between CSV, TSV, JSON and JSON Lines:

# Miller: CSV in, JSON out
mlr --icsv --ojson cat products.csv > products.json

# One JSON object per line instead
mlr --icsv --ojsonl cat products.csv > products.jsonl

CSV rules the parser follows

  • A field with the delimiter, a double quote or a line break must be wrapped in double quotes (RFC 4180).
  • A double quote inside a quoted field is written twice: "Cable tray ""XL""" reads as Cable tray "XL".
  • Line breaks may be CRLF (Windows, the RFC) or LF (Unix); both work, and blank lines are skipped.
  • The header row is optional. Without it, keys are column_1, column_2 and so on; blank headers get the same names and repeated ones get _2, _3.
  • Rows with more or fewer fields than the header are listed with their row number, so you can find the stray comma or quote.

Need the reverse? JSON to CSV flattens nested JSON back into columns. To check the JSON you get, use the JSON formatter, and for config files try JSON to YAML. Building on top of data? See database tools on DevHunt.

FAQ

How do I convert CSV to JSON?+

Paste the CSV, or drop a .csv file, into the box above. The first row becomes the keys, and every other row becomes one JSON object with those keys. The JSON updates as you type; copy it or download a .json file. In code, the usual route is a CSV parser (Papa Parse in JavaScript, csv.DictReader in Python) followed by JSON.stringify or json.dump.

Can I paste data straight from Excel or Google Sheets?+

Yes. When you copy cells from a spreadsheet, the clipboard holds them as tab-separated text. Paste it in and the tab delimiter is detected automatically, so you get the same JSON as from a .csv file.

Does it convert numbers and true/false to JSON types?+

Yes, with "Detect numbers" on. Plain numbers like 42 or -3.5 become JSON numbers, true and false become booleans, and null becomes null. Values that would change if converted stay strings: numbers with leading zeros such as zip codes (02134), numbers with a plus sign, thousands separators, and integers too large for JavaScript to hold exactly. When one value in a column has to stay a string, the whole column does, so a column never mixes types.

How do I get nested JSON from CSV?+

Name the columns with dot paths, like ship.city and ship.zip, and turn on "Nest dotted headers". Those columns become {"ship": {"city": ..., "zip": ...}}. Bracketed or numbered parts, like tags[0] and tags[1], become an array.

What if my CSV uses semicolons instead of commas?+

The delimiter is detected from the data: comma, semicolon, tab or pipe. Semicolons are common in files saved by Excel in European locales, where the comma is the decimal separator. If the guess is wrong, pick the delimiter by hand.

Can a CSV cell hold a JSON array or object?+

Yes. With "Parse JSON in cells" on, a cell such as ["S","M"] or {"w": 40} becomes a real JSON array or object instead of a string. This is how JSON to CSV writes nested arrays, so a file can go JSON to CSV and back without losing structure. A cell that only looks like JSON but does not parse stays text.

Why use JSON instead of CSV?+

CSV is a flat grid of text, which suits spreadsheets and bulk imports. JSON has types (numbers, booleans, null) and nesting (objects and arrays), so it suits APIs, config and data with a tree shape. Many workflows use both: CSV for the people editing data, JSON for the code reading it.

Is my CSV file uploaded?+

No. The file is read and converted in your browser; nothing is sent to a server. Large files are converted from memory rather than shown in the editor, so the page stays responsive.

Sources: RFC 4180 (CSV) · RFC 8259 (JSON) · Papa Parse docs · Python csv module · pandas.DataFrame.to_json · Miller file formats · JSON Lines · MDN: Number.MAX_SAFE_INTEGER. Checked 2026-10-29.