How to Convert a CSV to JSON in Your Browser (No Upload)
A 4-step workflow to convert a CSV file to JSON in your browser: paste the CSV, pick the delimiter, pick the conversion mode (array of objects, array of arrays, or keyed object), copy the JSON. The whole thing takes 30 seconds, runs entirely in the browser, and never sends your data to a server. Works for any CSV up to a few MB.
4-step workflow using the <a href="/csv-json-converter">CSV to JSON Converter</a> on this site: (1) open the CSV file in a text editor, select all, copy. (2) paste into the converter. (3) pick the delimiter (comma for most CSVs, tab for TSV, semicolon for European Excel exports). (4) pick the output mode (array of objects is the most useful), copy the JSON, paste into your tool. The whole conversion takes 30 seconds, runs entirely in the browser, and never sends your data anywhere. For very large CSVs (10+ MB), use a script in your terminal (Python, Node, etc.) — the browser-based converter works but is slower for huge files.
Converting a CSV to JSON is one of the most common data tasks in modern web work. The data is in a spreadsheet or a database export (CSV), and you need it in a JavaScript app, an API, or a config file (JSON). Most online converters work, but they upload your data to a server, which is a problem for sensitive files (financial data, customer lists, internal metrics). The free, no-upload alternative is a browser-based converter that does the work locally.
This is the 4-step workflow to convert a CSV to JSON in your browser, without uploading anything. The whole thing takes 30 seconds for a typical CSV.
Step 1: Open the CSV and copy the contents (10 seconds)
Open the CSV file in any text editor. Notepad on Windows, TextEdit on Mac (in plain text mode), VS Code, Sublime Text, vim, nano — any of them work. CSV is plain text, and any text editor can open it.
Once it is open, select all (Ctrl+A or Cmd+A) and copy (Ctrl+C or Cmd+C). The CSV contents are now in your clipboard, ready to paste.
If the CSV is too large to copy-paste (10+ MB), the browser-based converter is not the right tool. Use a script in your terminal instead (see Step 5 below). For typical CSVs (a few hundred KB to a few MB), copy-paste works fine.
Step 2: Open the CSV to JSON Converter (5 seconds)
Open the CSV to JSON Converter on this site. The page has two main areas: a text area for the CSV input, and an area for the JSON output.
Paste the CSV into the input area (Ctrl+V or Cmd+V). The converter reads the CSV in your browser and shows the JSON output in real time as you paste.
Step 3: Pick the delimiter (5 seconds)
The delimiter is the character that separates the columns. The default is comma, which is correct for most CSVs. But not every CSV uses a comma. Common alternatives:
- Comma (
,) — the default, correct for most CSVs. - Tab (
) — for TSV files (tab-separated values). Common in database exports and Unix tools. - Semicolon (
;) — for European Excel exports. In German and French locales, Excel defaults to semicolon because the decimal separator is a comma. - Pipe (
|) — for some legacy systems.
How to tell which one your CSV uses: open the CSV in a text editor and look at the separator between the values in the first row. If you see commas, it's comma. If you see semicolons, it's semicolon. The CSV to JSON Converter on this site has a dropdown to pick the delimiter; the default is comma, and you can switch to tab, semicolon, or pipe if your CSV uses one of those.
Step 4: Pick the output mode and copy the JSON (10 seconds)
The converter offers 3 output modes for the JSON:
- Array of objects (the most useful for most cases): each row becomes an object, with the header row providing the keys. Example:
[ {"name": "Alice", "age": 34, "city": "Seattle"}, {"name": "Bob", "age": 29, "city": "Austin"} ] - Array of arrays: each row is an array of values, with the header as a separate property. Example:
{ "headers": ["name", "age", "city"], "rows": [ ["Alice", 34, "Seattle"], ["Bob", 29, "Austin"] ] } - Keyed object: each row is an object keyed by a column you choose. Example (keyed by name):
{ "Alice": {"age": 34, "city": "Seattle"}, "Bob": {"age": 29, "city": "Austin"} }
Array of objects is the most useful for 90% of cases. It is the format most APIs and JavaScript apps expect. Array of arrays is useful if you have very large data and want to minimize the JSON size. Keyed object is useful if you have a natural unique key (like an ID or a name) and want fast lookup.
Once you pick the mode, the JSON appears in the output area. Copy it (Ctrl+A to select all, Ctrl+C or Cmd+C to copy) and paste it into your tool.
Step 5: For very large files, use a terminal script (5 lines)
For CSVs larger than a few MB, the browser-based converter works but is slow (the browser has to parse and render all the JSON in the DOM, which becomes the bottleneck around 10 MB+). For these, use a terminal script. Here are 3 one-liners for the common languages:
# Python (built-in csv module, no install)
python3 -c "import csv, json; print(json.dumps([dict(r) for r in csv.DictReader(open('data.csv'))]))" > data.json
# Node.js (with papaparse, install with npm)
node -e "const p=require('papaparse'),fs=require('fs');console.log(JSON.stringify(p.parse(fs.readFileSync('data.csv','utf8')).data))" > data.json
# jq (Unix tool, install with brew or apt)
jq -Rs '[split("
")[] | split(",") | {(.[0]): .[1:]}] | add' data.csv > data.json
Each does the same thing: reads the CSV, converts to JSON, writes to a file. The Python and Node versions handle quoted fields correctly; the jq version is a one-liner that works for simple CSVs but breaks on quoted fields with commas inside them.
For one-time conversion of a large file, the Python one-liner is the easiest. The csv module is in the standard library, so no install. The output is valid JSON that you can pipe into other tools.
Common gotchas when converting CSV to JSON
Number vs. text
CSV does not distinguish between text and numbers — they are all strings. The converter infers types based on the content: a field that looks like a number (e.g., 34, 3.14, -42) becomes a number in JSON; a field that looks like text stays a string. A field with mixed types (e.g., 34 in some rows and N/A in others) is treated as text to avoid data loss.
Watch out for:
- Numbers with leading zeros:
01234becomes1234in JSON. If the leading zero matters (postal codes, IDs), force the field to be treated as text. - Numbers with currency symbols:
$1,234.56becomes1234.56(the dollar sign and comma are stripped). If the original format matters, clean the data before converting. - Boolean-like values:
TRUEandFALSEmay or may not be converted to JSON booleans, depending on the converter. Check the output to make sure.
Empty fields and NULL
An empty cell in a CSV (e.g., Alice,,Seattle) is converted to an empty string in JSON by default. Some converters allow NULL, null, or N/A to be treated as the JSON null value. Pick the option that matches your data — the convention is empty string for "no value provided" and null for "value is missing or unknown."
Quoted fields with newlines
A field can contain a newline if it is wrapped in double quotes. The converter handles this correctly (it knows to keep reading until the closing quote). If you see the JSON output cut off in the middle of a row, you have a malformed CSV — the quoting is broken somewhere in the file. Open the CSV in a text editor and check the field that ends at the cut-off point.
Encoding (UTF-8 vs. Windows-1252)
If the CSV has non-ASCII characters (e.g., José, naïve, Müller) and the encoding is not UTF-8, the JSON output will have garbled characters. The fix is to convert the CSV to UTF-8 before pasting it in. Most modern tools save as UTF-8 by default; the issue is usually with older Excel files exported on Windows.
What to do with the JSON after conversion
Once you have the JSON, the common next steps are:
- Paste into a JavaScript app: the JSON is valid JS. You can paste it into a
const data = [...]or fetch it from a file. - Save to a .json file: most editors can save the pasted output as a .json file. Make sure the file has valid JSON before using it in production.
- Validate the JSON: paste into the JSON Validator on this site to make sure it is well-formed. Malformed JSON will crash whatever tool tries to parse it.
- Format the JSON: if the JSON is minified, paste into the JSON Formatter to make it readable. Useful for debugging and for pasting into documentation.
- Explore the structure: if the JSON is nested, paste into the JSON Tree Viewer to see the structure visually.
For most data work, the pipeline is: CSV → JSON → validate → format → paste into your app. Each step has a tool on this site that runs in the browser, no upload.
The honest summary
Converting a CSV to JSON in your browser, without uploading, takes 30 seconds: open the CSV in a text editor, copy, paste into the CSV to JSON Converter on this site, pick the delimiter, pick the output mode (array of objects is the most useful), copy the JSON. The conversion runs entirely in your browser, so the data never leaves your device. For very large files (10+ MB), use the Python one-liner: python3 -c "import csv, json; print(json.dumps([dict(r) for r in csv.DictReader(open('data.csv'))]))" > data.json. The common gotchas are number-vs-text inference (a leading zero in 01234 is stripped to 1234), empty fields (default to empty string, may need to be null), quoted fields with newlines (handled correctly by all good converters, but check the output for cut-off rows), and encoding (UTF-8 by default, Windows-1252 for older Excel files). For one-off conversions of typical CSVs, the browser tool is faster than any terminal script. For batch or very large files, the script is the right tool.