Convert CSV to JSON
Turn a .csv file into structured, valid JSON — right in your browser. The tool auto-detects the real delimiter, uses your header row as each object's keys, and lets you download the result. Nothing is uploaded to a server.
Convert a CSV File to JSON
Drop a .csv file below. It's parsed as real tabular data right in your browser using the same delimiter-detection and quote-aware parsing as our CSV viewer tool — then converted to JSON, previewed, and ready to download.
Before you use this tool: The first row supplies the property names and cell values are stored as JSON strings, including numbers. For example, a price of 19.99 becomes "price": "19.99". This protects identifiers such as 007; use the methods below if your application needs numeric or nested values.
🔒 Nothing is uploaded — your file never leaves this deviceJSON preview
On this page
How the CSV-to-JSON conversion works
CSV is flat, plain-text tabular data with no defined data types and no nesting. JSON is structured and can express both. Converting from one to the other means making a couple of real decisions, which this tool makes transparently rather than silently:
- Delimiter detection — the tool tests comma, semicolon, tab and pipe against the file's own first lines and uses whichever produces a consistent column count, since many CSV exports (especially from European-locale software) use a semicolon, not a comma.
- Header detection — if the first row looks like column names (mostly non-numeric, with the row below it containing numbers), it's used as the key for every JSON object. If it doesn't look like a header, the tool falls back to an array of arrays instead of guessing wrong keys.
- Quoted fields — a field wrapped in double quotes can safely contain commas, line breaks or an escaped quote (
""), per RFC 4180. This is parsed with a proper state machine, not a naive split on the delimiter.
Why convert CSV to JSON
JSON is the format nearly every API, web app and modern database (document stores in particular) expects. If you exported a report or a spreadsheet as CSV and now need to feed it into code, an API request body, or a NoSQL database, converting it to an array of well-formed objects is usually the very next step — and doing it by hand for anything beyond a few rows is slow and error-prone, especially once quoted fields or inconsistent delimiters are involved.
Edge cases this tool handles
Semicolon-delimited CSV (common in Europe)
Detected automatically — no need to pre-convert the file or tell the tool which delimiter to expect.
Quoted fields containing commas or line breaks
Parsed correctly per RFC 4180, rather than being split into the wrong number of columns.
Missing values
A row with fewer values than the header still produces a valid JSON object — missing fields are simply empty strings, not null or omitted keys, so every object in the output has the same shape.
No header row
If the first row doesn't look like column names, the tool outputs an array of arrays rather than inventing or misusing column names.
Other ways to convert CSV to JSON
Neither Excel nor Google Sheets can save a sheet as JSON — JSON isn't in Excel's Save As list or in Sheets' File > Download menu, and Excel's Power Query can import JSON but not export it. So once you go beyond this page, the realistic options are a short script or a command-line tool. All of the commands below were run against a sample file named orders.csv.
Python, with nothing to install
Python's standard library can do it in one line. utf-8-sig silently strips the byte-order mark Excel adds to "CSV UTF-8" files, so your first key doesn't come out as order_id:
py instead of python3.Python with pandas
pd.read_csv("orders.csv", dtype=str, keep_default_na=False).to_json("orders.json", orient="records", indent=2, force_ascii=False) produces the same array of objects. dtype=str keeps ZIP codes like 02134 intact, keep_default_na=False stops empty cells and the text "NA" from turning into null, and force_ascii=False writes "Zoë" instead of "Zoë". Leave out dtype=str if you want pandas to guess numeric columns for you.
PowerShell on Windows
Import-Csv .\orders.csv | ConvertTo-Json | Set-Content .\orders.json -Encoding utf8 works out of the box. Add -Delimiter ';' to Import-Csv for semicolon files. One quirk: a CSV with a single data row becomes a single JSON object rather than an array — in PowerShell 7 add -AsArray to ConvertTo-Json to always get an array.
csvkit on macOS or Linux
If you already use csvkit, csvjson orders.csv > orders.json converts in one step. Unlike this tool, csvkit guesses column types, so numbers and booleans come out unquoted; check ID-like columns afterwards.
Numbers, nulls and nested JSON
This converter writes every value as a JSON string — "price": "19.99", not "price": 19.99. That's deliberate: CSV has no data types, and guessing is how ZIP code 02134 becomes 2134 and a 17-digit order number quietly changes its last digits (JavaScript numbers can't hold integers above 9,007,199,254,740,991 exactly). If you need real numbers, convert only the columns you know are numeric. With jq:
- Make a column numeric —
jq 'map(.price |= (tonumber? // null))' orders.jsonturns"19.99"into19.99and an empty price intonullinstead of failing. - Empty strings to null everywhere —
jq 'map(with_entries(if .value == "" then .value = null else . end))' orders.json. - Nested objects from dotted headers — a CSV can't nest, but headers like
customer.nameandcustomer.citycan be folded into"customer": {"name": …, "city": …}withjq 'map(reduce to_entries[] as $e ({}; setpath($e.key | split("."); $e.value)))' orders.json. This tool itself keeps the dotted names as flat keys.
Accented letters turn into � after converting
The tool reads the file as UTF-8, which is what Google Sheets, Numbers and Excel's "CSV UTF-8" option all write. Excel for Windows' plain CSV (Comma delimited) option instead saves in the old Windows code page, so letters like é or ñ arrive as invalid bytes and show up as the � replacement character. Re-save from Excel with File > Save As > CSV UTF-8 (Comma delimited) (*.csv) and convert again — the XLSX to CSV page explains the difference between the two options.
Frequently asked questions
Does converting CSV to JSON upload my file anywhere?
No. This tool parses and converts the file entirely inside your browser using JavaScript — the file's contents never leave your device or touch a server. That's true of every tool on this site.
How does the converter decide the JSON keys?
It uses your CSV's first row as the header, and turns each subsequent row into one JSON object with those header values as keys. If the tool detects the first row doesn't actually look like a header (e.g. it's all numeric, same as the rows below it), it outputs an array of arrays instead so no data is silently mislabeled.
What if my CSV uses semicolons instead of commas?
That's handled automatically. The tool tests comma, semicolon, tab and pipe against the file's own first several lines and uses whichever one produces a consistent column count — very common with CSV exports from European-locale spreadsheet software, where a comma is the decimal separator.
Is there a file size limit?
There's no hard limit enforced by the tool, since it runs in your own browser rather than a server with a fixed quota — very large files (tens of thousands of rows) will simply take a little longer and use more of your device's memory.
Can Excel save a spreadsheet directly as JSON?
No. Excel's Save As list has no JSON option, and Power Query can read JSON but can't write it. Save the sheet as CSV UTF-8 (Comma delimited) and drop that file into this converter, or use one of the Python or PowerShell one-liners above.
Why are the numbers in my JSON wrapped in quotes?
Because CSV doesn't record whether a value is a number or text, the tool keeps every value as a string so codes like 02134 or long IDs are never altered. To turn specific columns into numbers afterwards, run something like jq 'map(.price |= (tonumber? // null))' orders.json.
How do I turn a CSV into nested JSON?
Name the columns with dots, such as customer.name and customer.city, convert here, then fold the dotted keys into nested objects with jq 'map(reduce to_entries[] as $e ({}; setpath($e.key | split("."); $e.value)))' orders.json. The converter on its own produces flat objects, one key per column.
Why do accented characters show up as question marks or boxes after converting?
Your CSV was most likely saved by Excel for Windows with the plain CSV (Comma delimited) option, which uses the legacy Windows code page instead of UTF-8. Re-export it with CSV UTF-8 (Comma delimited) and convert again.
Last updated October 1, 2026.