Paste CSV or drop a file and get JSON as you type: an array of objects, arrays, objects keyed by a column, or JSON Lines. Numbers and true/false become real JSON types, and headers like address.city become nested objects. It runs in your browser.
Free CSV to JSON converter that runs in the browser. Paste CSV or upload a .csv file and get an array of objects, an array of arrays, an object keyed by a chosen column, or JSON Lines (NDJSON). Detects numbers, booleans and empty cells as null per column, turns dot-notation headers into nested objects, and lets you choose the indent.
An array with one object per row, keyed by the header. The shape most APIs, JavaScript code and MongoDB imports expect.
Your JSON shows up here
Paste CSV or drop a file. Pick a shape above and the output updates as you type.
Was this tool helpful?
Three lines of CSV in each shape the converter writes. The empty seats cell becomes null, 12 becomes a number, and address.city turns into a nested object.
In
id,name,seats,address.city 1,Maya,12,Toronto 2,Luis,,Madrid
Out
[ { "id": 1, "name": "Maya", "seats": 12, "address": { "city": "Toronto" } }, { "id": 2, "name": "Luis", "seats": null, "address": { "city": "Madrid" } } ]
Objects. APIs, JavaScript, MongoDB and most JSON imports.
[ ["id", "name", "seats", "address.city"], [1, "Maya", 12, "Toronto"], [2, "Luis", null, "Madrid"] ]
Arrays. Charts and compact payloads. Header comes first.
{ "1": { "id": 1, "name": "Maya", "seats": 12, "address": { "city": "Toronto" } }, "2": { "id": 2, "name": "Luis", "seats": null, "address": { "city": "Madrid" } } }
Keyed by id. Lookups by id, SKU or email in a config or cache.
{"id":1,"name":"Maya","seats":12,"address":{"city":"Toronto"}} {"id":2,"name":"Luis","seats":null,"address":{"city":"Madrid"}}
JSON Lines. jq, log pipelines and BigQuery-style bulk loads.
Exports from Excel, Google Sheets, Shopify or a database all work. The delimiter is detected for you.
Objects for most uses, Keyed for lookups, JSON Lines for streaming. Keep types on to get real numbers and null.
The file keeps its original name as .json, or .jsonl for JSON Lines.
For a script or a scheduled job, pandas does it in two lines. The csv module needs no install and never changes your values, because it reads every cell as a string.
import pandas as pd
df = pd.read_csv("data.csv")
df.to_json("data.json", orient="records", indent=2, force_ascii=False)import csv
import json
with open("data.csv", newline="", encoding="utf-8") as f:
rows = list(csv.DictReader(f))
with open("data.json", "w", encoding="utf-8") as f:
json.dump(rows, f, indent=2, ensure_ascii=False)| pandas | This converter | |
|---|---|---|
| Objects | orient="records" | Objects |
| Arrays | orient="values", without the header row | Arrays, header row first |
| Keyed | set_index("id") then orient="index", which moves id out of each object | Keyed, id stays in each object |
| JSON Lines | orient="records", lines=True | JSON Lines |
| Blank cell in a number column | The column turns to floats, so 12 is written as 12.0 | null, and 12 stays 12 |
| ZIP code 02134 | 2134, unless you read with dtype=str | "02134" |
| address.city header | A flat "address.city" key | Nested address object |
Indented JSON costs more tokens than minified. Check the count, and pick a model that handles structured data well.
Paste your CSV into the converter or drop a .csv file on it. The JSON appears as you type. Pick a shape (objects, arrays, keyed or JSON Lines), choose the indent, then copy the result or download a .json file. The delimiter is detected for you, and the conversion runs in your browser.
With pandas, run pd.read_csv("data.csv").to_json("data.json", orient="records", indent=2). Without pandas, read the file with csv.DictReader and write the list of rows with json.dump. pandas guesses number types, while the csv module keeps every value as a string. The Python section on this page has both scripts and the pandas option for each JSON shape.
Four. Objects gives an array with one object per row, keyed by the header. Arrays gives one array per row with the header first. Keyed stores each row under the value of a column you pick, such as id. JSON Lines writes one compact object per line for streaming tools. All of them can be minified or indented with 2 spaces, 4 spaces or tabs.
Yes, with Numbers, true/false and null turned on. A column becomes numbers only when every filled cell is a plain number, so a ZIP code column with 02134 stays text and keeps its leading zero. Columns of true and false become booleans, and empty cells become null. Turn the switch off to keep every value as a string.
Use dots in the header names. With Nest dot keys on, columns called address.city and address.zip become "address": {"city": ..., "zip": ...} in every row. You can nest as deep as you like, for example billing.address.city. If another column is already called address, those keys stay flat so no value is overwritten.
JSON Lines, also called NDJSON, puts one complete JSON object on each line with no surrounding array. Tools can read it one row at a time, which is why jq, log pipelines and data warehouse loaders such as BigQuery use it. Choose JSON Lines as the output and the download is saved as a .jsonl file.
Yes, export it as CSV first. In Excel use File, Save As, CSV UTF-8. In Google Sheets use File, Download, Comma-separated values. Then drop the .csv here. Semicolon-separated exports from European Excel settings and tab-separated files are detected automatically, and quoted cells with commas or line breaks stay in one piece.
Your data stays on your device. The file is read and converted in your browser, nothing is uploaded, and there's no signup. Files up to 10 MB work. For very large files the output panel shows the first part of the JSON, while Copy and Download still include every row.
Everything from model picks to CSV converters, with no account needed.