CSV to JSON Converter — the delimiter, worked out
Paste a CSV and get a JSON array of objects, ready for an API, an app, or a NoSQL database. The delimiter and the header row are worked out for you. No upload, no sign-up.
What is a CSV to JSON converter?
A CSV to JSON converter takes tabular data — rows and columns from a spreadsheet or CSV file — and turns it into a JSON array of objects. Each row becomes one object. The first row, by convention, is the header: it provides the keys that every object will use. Subsequent rows provide the values.
For example, this CSV:
name,role,city
Alice,Engineer,New York
Bob,Designer,London
becomes this JSON:
[
{ "name": "Alice", "role": "Engineer", "city": "New York" },
{ "name": "Bob", "role": "Designer", "city": "London" }
]
This is the most common shape used by web APIs and JavaScript applications. The conversion is lossless for any data that fits in a table — every column becomes a key, every cell becomes a value. The only thing you lose going CSV → JSON is implicit type information (Excel's cell formats), but HopConvert infers sensible JSON types where it can: numbers, booleans, and null values are detected and emitted as proper JSON types, not strings.
How to convert CSV to JSON in 3 steps
Most conversions take less than a minute. No login, no upload to a server, no installation.
-
Paste or upload
Drop a
.csvfile into the upload zone, or paste CSV text. The converter auto-detects the delimiter (comma, tab, semicolon, or pipe) from the first line. -
Preview
The live preview shows the JSON output as you type. Open the settings cog to set the delimiter manually, change header behaviour, or switch between pretty and minified output.
-
Copy or download
Click Copy JSON to put the result on your clipboard, or Download JSON to save a
.jsonfile. Drop it straight into your app, API, or MongoDB.
Built for the messy CSV you actually have
Real-world CSV has quirks: quoted commas, mixed delimiters, missing headers, BOM markers. HopConvert handles them all.
Auto-detect delimiter
Sniffs the first line and picks the most likely delimiter. Manual override available in settings for tricky files.
Header row handling
First row is used as keys by default. Toggle off for files without a header, or supply custom column names.
Type inference
Numbers, booleans, and null values are auto-detected and emitted as proper JSON types. No more "42" as a string.
Browser-only privacy
Every byte is processed in your browser using JavaScript. Nothing is uploaded, logged, or stored on our servers.
RFC 4180 compliant
Handles quoted values, embedded quotes (""), newlines inside cells, and BOM markers correctly. Same parser as the big libraries.
Pretty or minified
Pick pretty-printed for human reading or minified for production. One click in the settings cog.
CSV vs JSON: what's the difference?
Both store data, but they're designed for very different jobs.
| Aspect | CSV | JSON |
|---|---|---|
| Structure | Flat tabular (rows and columns) | Hierarchical (nested objects, arrays) |
| Best for | Spreadsheets, BI tools, human analysis, databases | APIs, web apps, configuration, machine-to-machine |
| File size | Smaller (compact plain text) | Larger (more syntax overhead) |
| Human readability | High (opens directly in Excel) | Moderate (requires understanding of syntax) |
| Type system | All cells are text (types inferred by application) | Native types: string, number, boolean, null, object, array |
| Nested data | Requires flattening | Native support |
| Editing | Easy in Excel or any text editor | Needs a JSON-aware editor or formatter |
When teams reach for CSV to JSON
The reverse direction is just as important as JSON to CSV. Here are the most common reasons to convert a spreadsheet into structured data.
API ingestion
Many REST APIs accept JSON for bulk operations. Convert a spreadsheet export into the exact JSON shape the API expects.
MongoDB import
MongoDB's native import format is JSON. Run mongoimport against the converted file to populate a collection in seconds.
Frontend data binding
JavaScript apps consume JSON natively. Convert a product catalog or user list and use it directly in a React, Vue, or Svelte component.
Static site data
Jekyll, Hugo, and Astro sites can use JSON data files at build time. Edit in Google Sheets, export as CSV, convert to JSON, drop in.
NoSQL database seed
Need to seed a Firestore, DynamoDB, or CouchDB collection? JSON is the universal interchange format.
Configuration generation
Convert a parameter list maintained in a spreadsheet into a JSON config file your app reads at startup.
CSV to JSON: the complete guide
Everything you need to know about the CSV format, the JSON output shape, and how to handle real-world edge cases.
What shape is the output?
By default, HopConvert produces a JSON array of objects. The first row of your CSV (or the first row you mark as the header) becomes the keys; each subsequent row becomes one object in the array. This is the shape that JSON.parse in JavaScript, json.load in Python, and JSONArray in Java all expect.
If you want a single object instead of an array — useful when your CSV has only one meaningful record — open the settings and switch to "Single object (key = first column, value = rest)". This is rare but supported.
You can also choose the indent style. Pretty-printed output uses 2 spaces and is easy to read; minified output is a single line and is what you want for production use or network transfer.
How are types inferred?
CSV has no native types — every cell is text. But the converter examines each value and emits the most appropriate JSON type:
- Numbers: Any value matching the regex
/^-?\d+(\.\d+)?$/(integers and decimals, including negative) is emitted as a JSON number. Scientific notation (1.5e10) is also supported. - Booleans:
true,false,TRUE,FALSE,Yes,No(case-insensitive) become JSON booleans. - Null: Empty cells and the literal string
null,NULL, orN/Abecome JSONnull. - Everything else: Strings. If the value contains a comma, quote, or newline, it is wrapped in JSON double quotes (escaping inner quotes as
\").
If you'd rather treat all values as strings (e.g., zip codes that look like numbers, IDs that look like booleans), open settings and disable type inference.
How does quoting work?
CSV quoting is the source of most parser bugs in the wild. HopConvert implements RFC 4180 strictly, which means:
- Any field may be wrapped in double quotes.
"hello, world"is one field, not two. - Embedded double quotes are escaped by doubling them:
"she said ""hi"""is a field whose value isshe said "hi". - Newlines inside quoted fields are preserved, not treated as row terminators.
- Unquoted fields stop at the delimiter (or the end of the line).
Files exported from Excel, Google Sheets, Numbers, and most databases all follow these rules. Files exported from some homegrown tools don't — if your input has weird quoting, you'll see an explicit error message rather than silent data corruption.
Which delimiter should I use?
The "right" delimiter depends on where your CSV came from:
- Comma (default): Standard CSV. Used by most US exports, RFC 4180 examples, and most APIs.
- Tab: Common for database exports and Excel paste operations. Avoids the comma-in-value problem entirely.
- Semicolon: Default in many European locales, where the decimal separator is a comma and CSV would otherwise be ambiguous.
- Pipe: Used by some log formats and pipe-separated value (PSV) tools. Useful when your data contains all the other common delimiters.
The auto-detect option sniffs the first line and picks the most likely delimiter based on which character appears most consistently as a separator. It works for >95% of real-world files. For trickier cases, set the delimiter manually in settings.
How are headers handled?
By default, the first row of your CSV is treated as the header — the names used as JSON keys. This matches what every spreadsheet program does on export.
If your file does not have a header row (some database dumps don't), open settings and either:
- Turn on "Auto-generate columns" — the converter will use
col1,col2,col3as the keys. - Enter custom column names — one per line in the settings panel.
You can also strip whitespace from header names and lowercase them with one toggle — useful when you're feeding the output into a JavaScript app that uses camelCase keys.
Common edge cases
Real-world CSV is rarely as clean as the textbook example. Here are the most common gotchas and how HopConvert handles them:
- UTF-8 BOM: The byte-order mark (the invisible
\ufeffat the start of files saved by Excel on Windows) is automatically detected and stripped. - Trailing empty rows: Common in Excel exports. HopConvert ignores empty lines at the end of the file.
- Embedded newlines: Supported via quoting. A field can contain a real newline if it's wrapped in double quotes.
- Mixed line endings: Both CRLF (Windows) and LF (Unix) line endings parse correctly, even in the same file.
- Different number of columns per row: The header row's column count is authoritative. Rows with fewer columns are padded; rows with more have extras dropped (with a warning in the result panel).
- Duplicate column names: Auto-disambiguated as
name,name_2,name_3. - Empty file or only headers: Returns an empty array
[], not an error.
Performance and limits
Because HopConvert runs entirely in your browser, the practical limit is your tab's available memory — typically 200 MB to 2 GB depending on the browser and device. A 50 MB CSV is a few-second conversion; a 200 MB CSV is borderline.
For very large files, the bottleneck is usually memory, not CPU. Close other tabs, use a 64-bit browser (Chrome, Edge, Firefox all qualify), and avoid running on a low-RAM device. The converter streams the file in chunks rather than loading the whole thing at once, so it stays responsive even on large inputs.
The same job, the way you need it
Free tools for the specific version of this conversion you are actually doing.
CSV to JSON type inference
Exactly how numbers, booleans and nulls are detected - and why leading zeros stay text.
Frequently asked questions
Everything you need to know about converting CSV to JSON with HopConvert.
What is a CSV to JSON converter?
Is HopConvert free to use?
Does the first row need to be a header?
Which delimiters are supported?
How are quoted values handled?
What output format options are there?
Can I convert large CSV files?
Does my data leave my browser?
Can I open the resulting JSON in an API or app?
What if my CSV has different numbers of columns per row?
Turn your CSV into an array
Free, instant, and private — your CSV never leaves this tab.