CSV to JSON Converter – Turn CSV into Valid JSON Instantly
Paste CSV data and convert it to clean JSON with header row detection, custom delimiters, type inference, and pretty printing. Choose between an array of objects or an array of arrays. No signup, no uploads — everything runs in your browser.
Configure
Set up your conversionJSON Output
ResultsYour JSON will appear here
Paste some CSV, choose a delimiter, then click Convert to JSON.
What does the CSV to JSON converter do?
This free online tool takes comma-separated (or tab, semicolon, pipe, or custom-delimited) CSV data and turns it into well-formed JSON. With header detection on, the first row of your CSV becomes the keys and every following row becomes a JSON object. With header detection off (or Arrays mode), you get a nested array of arrays instead.
Unlike a naive string-replace, this converter handles the messy parts of real CSV: quoted fields containing commas, escaped double quotes, CRLF line endings, blank rows, and mixed numeric/string data. When type inference is on, values like 42, true, and empty cells become native JSON numbers, booleans, and nulls instead of strings.
Everything runs locally in your browser. Your data never leaves your device — no server upload, no logging, no tracking. Close the tab and it's gone.
How to convert CSV to JSON — step by step
- Paste your CSV: Drop comma, tab, semicolon, pipe, or space-separated rows into the input box above.
- Pick the input delimiter: Auto-detect works for most CSVs. If your data uses semicolons or tabs, pick them manually.
- Choose the output format: Objects uses your header row as keys (recommended when your CSV has headers). Arrays produces nested arrays with no keys.
- Set the toggles: Enable or disable header detection, type inference, pretty printing, whitespace trimming, and blank-line skipping.
- Click Convert to JSON: The output appears instantly, with record and key counts.
- Copy or download: Use the Copy JSON button or download the result as a
.jsonfile ready for APIs, MongoDB, config files, or anything else.
Shortcut: Press Ctrl + Enter (or Cmd + Enter on Mac) inside the input box to convert instantly.
Example: before and after
Input (CSV with header row)
Name,Age,City,Active
Alice,30,New York,true
Bob,25,London,false
Output (Array of objects, type inference on)
[
{
"Name": "Alice",
"Age": 30,
"City": "New York",
"Active": true
},
{
"Name": "Bob",
"Age": 25,
"City": "London",
"Active": false
}
]
Same input as Array of arrays (no keys)
[
["Alice", 30, "New York", true],
["Bob", 25, "London", false]
]
Notice that 30 and true are stored as native JSON types, not strings — that's type inference at work. Disable it if your downstream system expects everything as a string.
When would you need to convert CSV to JSON?
API payloads
Build JSON request bodies for REST APIs from spreadsheet data. Convert a product catalog or user list into JSON your backend expects.
Database imports
MongoDB, Firebase, and CouchDB all import JSON natively. Convert CSV exports into import-ready JSON documents.
Static config files
Turn a spreadsheet of feature flags, translations, or SEO metadata into a JSON file your app can read at build time.
Data analysis
Convert CSV into JSON for Python, JavaScript, or R scripts that expect structured objects with named keys rather than positional arrays.
NoSQL seeding
Seed a Firestore, MongoDB, or DynamoDB collection from CSV test data by converting to JSON first.
Quick prototyping
Mock an API response by converting sample CSV into JSON you can paste into a mock server or inline in code.
Type inference reference
When Infer types is enabled, each cell is examined and converted from string to its best-fit JSON type. Here's what the converter does:
| Input value | JSON type | Output |
|---|---|---|
42 | number | 42 |
3.14 | number | 3.14 |
-7 | number | -7 |
true / false | boolean | true / false |
| (empty) | null | null |
007 | string | "007" (leading zero preserved) |
hello | string | "hello" |
1,234 | string | "1,234" (comma breaks number parsing) |
If you need everything as a string (for example, a system that rejects numbers), just turn type inference off.
Tips and best practices
- Check your header row. If your CSV has a header, leave First row is header on. If it doesn't, either turn it off or the first row of data will be silently used as keys.
- Use Arrays mode when keys would be misleading. If your CSV has no header and you don't want to invent column names, Arrays output is the honest choice.
- Watch out for duplicate column names. Two columns named the same in Objects mode will overwrite each other — the last value wins. Rename them in the CSV first.
- Leading zeros matter. Postal codes and phone numbers like
007or0800are kept as strings by default so Excel-style number coercion doesn't strip the zeros. - Pretty print for humans, compact for machines. Turn pretty print off when you're embedding the JSON in a URL, a script, or a storage system where size matters.
- Need the reverse? Try the JSON to CSV tool to go the other way.
- Need to clean up the CSV first? Run it through the Whitespace Cleaner or Remove Empty Lines tool.
Related tools you might need
- JSON to CSV — reverse of this tool.
- CSV to Text — flatten CSV to plain text.
- Text to CSV — convert plain text to CSV.
- JSON Formatter — prettify and validate any JSON.
- JSON Validator — check JSON syntax.
- JSON Minifier — shrink JSON payloads.
- Whitespace Cleaner — clean up messy CSV before converting.
Privacy, accuracy, and limits
Privacy: Nothing you paste into this converter is sent to a server. The whole CSV parser and JSON generator is JavaScript running in your browser tab. There is no upload, no analytics event containing your data, and no server-side log.
Accuracy: The parser follows RFC 4180, so quoted fields with commas, newlines, and escaped quotes are handled correctly. Type inference covers the common cases (numbers, booleans, nulls) and preserves strings that would be ambiguous — like 007 or 1,234. Auto-detect picks the delimiter that appears most consistently across the first few lines.
Limits: There is no hard limit on input size. Since everything runs in-browser, the practical limit is your device's memory. A CSV with tens of thousands of rows converts in well under a second. Very large pastes (multiple megabytes) may take a moment.
Frequently asked questions
42 becomes a number, true becomes a boolean, and an empty value becomes null..json file. It works with any tool that consumes JSON — APIs, MongoDB import, config files, and more.