CSV to JSON Converter Guide
Convert CSV to JSON offline on your desktop. No file-size limit. Files never leave your device. Free for Mac and Windows.
What is CSV to JSON conversion?
CSV (Comma-Separated Values) is a flat tabular format — one record per line, columns separated by commas. JSON (JavaScript Object Notation) is a hierarchical key/value format that natively supports nested objects, arrays, and typed values. Converting CSV to JSON turns each CSV row into a JSON object whose keys are the column headers and whose values are the row's cells.
Almost every modern system that consumes data prefers JSON. REST APIs return JSON. NoSQL databases like MongoDB, DynamoDB, and CouchDB store JSON-shaped documents. Postgres can ingest JSON via COPY. BigQuery, Spark, and Snowflake all accept JSON loads. JavaScript frontends parse JSON natively with JSON.parse. CSV is the universal export format; JSON is the universal consumption format. The conversion sits between the two.
The non-obvious part is that the output shape matters as much as the conversion itself. JSON Array (one big array of objects) is the default and works everywhere a JavaScript runtime can hold the file in memory. JSONLines (NDJSON, one object per line) is what MongoDB mongoimport, BigQuery LOAD, and Spark expect for parallel ingestion. Nested JSON (where slash-delimited column headers like address/city become object trees) is the right shape when your CSV columns already encode hierarchy. Picking the wrong shape costs you a pipeline rewrite later — so the next section covers which to choose.
Which JSON output shape do you actually need?
Three output shapes are common in practice. The right one depends on the system that will read your file.
JSON Array
Best for:
- •REST API responses
- •fs.writeFileSync, frontend bundlers, single-file imports
- •Datasets small enough to fit in memory (under ~1 GB)
- •General-purpose JSON consumption
FileHop outputs this shape today.
JSONLines / NDJSON
Best for:
- •MongoDB mongoimport
- •BigQuery LOAD jobs
- •Spark and Databricks parallel ingestion
- •Streaming consumers and files larger than 1 GB
FileHop does NOT ship JSONLines mode today. Use ConvertCSV.com's JSONLines option, or post-process the array output with jq -c '.[]' < output.json > output.jsonl.
Nested JSON via slash-headers
Best for:
- •CSV columns that already encode hierarchy (address/city, address/zip)
- •API payloads expecting nested objects
- •Document stores where flatness is awkward
FileHop outputs FLAT objects today — no slash-header nesting. Use ConvertCSV.com or a small jq script if you need this shape.
Naming what we don't ship is what builds trust. If you need JSONLines or nested output, the right answer is to use the tool that already does it well.
How to convert CSV to JSON in FileHop
Four steps. Works on a 10-row sample CSV and a 10-million-row CSV the same way.
Open FileHop
Launch the FileHop desktop app on Mac or Windows. The data converter is on the home screen.
Drag your .csv file in
Drop the CSV onto the data converter panel, or use File → Open. DuckDB's read_csv_auto detects the delimiter, quoting style, and column types automatically.
Select Convert to JSON
Pick JSON from the output-format dropdown. There's no extra configuration to choose — type inference, header parsing, and streaming are all default behaviors.
Click Convert
FileHop writes the .json file next to your source CSV. If the target name already exists, the filename is auto-uniquified with _1, _2, etc. The conversion is streamed end-to-end through DuckDB, so 10M+ row files complete without loading into RAM.
Numbers stay numeric. Booleans stay boolean. Nulls stay null. Column headers become object keys. The file never leaves your device.
Why offline beats online for CSV → JSON
Browser-based converters dominate the search results, but every one of them fails on at least one of the three things below. This is the editorial case for converting on your own machine.
Privacy: PII and sensitive CSVs
Customer lists, financial exports, healthcare records, payroll data — these are the CSVs people most often want to convert, and they are the same CSVs that should never touch a third-party server. Browser tools that claim 'client-side processing' still load third-party JavaScript (analytics, CDN scripts, ad scripts, framework runtimes). Any of those can change in a future page load. Offline desktop conversion has no JavaScript surface and no remote dependencies — disconnect from the network and the conversion still runs. That is the only verifiable guarantee.
File size: streaming vs the browser sandbox
Browser sandboxes cap RAM at roughly 2-4 GB and crash converters around 50-100 MB of input. FileHop's converter is a single DuckDB COPY query — COPY (SELECT * FROM read_csv_auto('input.csv')) TO 'output.json' (FORMAT JSON, ARRAY true). DuckDB streams the read and the write, so a 10-million-row CSV converts in seconds without memory pressure. There is no upload step, no chunking, no 'try again with a smaller file' message.
Type fidelity: leading zeros, dates, nulls
Naive converters string-ify everything. DuckDB's read_csv_auto honors leading zeros (when a column has any non-numeric value), preserves ISO dates as strings, distinguishes NULL from empty string, and keeps numbers numeric and booleans boolean. The result is JSON your downstream actually consumes — no second pass to fix the type of every field.
If your bottleneck is file size more than format, two related guides go deeper:
FileHop vs the SERP: how the desktop converter compares
Eight tools, six dimensions. FileHop is highlighted in blue. Honest about what we don't ship.
| Tool | Type | Offline | Price | File-size limit | Output shapes | Type inference | Privacy |
|---|---|---|---|---|---|---|---|
| FileHop | Desktop (Mac, Windows) | Yes | Free | No practical limit | Array only | DuckDB read_csv_auto | Fully local |
| ConvertCSV.com | Browser | No | Free | Browser-bound (~50-100 MB) | Array, JSONLines, Nested | Manual | No stated policy |
| CSVJSON | Browser | No | Free | Browser-bound | Array | Basic | Claims confidential |
| Jam.dev | Browser | No | Free | Browser-bound | Array | PapaParse | No stated policy |
| Easy Data Transform | Desktop (Mac, Windows) | Yes | Paid (free trial) | No practical limit | Array | Yes | Fully local |
| Vovsoft CSV to JSON | Desktop (Windows only) | Yes | Paid | No practical limit | Array | Basic | Fully local |
| convert-csv-to-json (npm) | CLI / library | Yes | Free OSS | No practical limit | Array, JSONLines | Configurable | Fully local (requires Node) |
| jq | CLI | Yes | Free OSS | Streaming, no limit | Anything you script | Manual | Fully local |
If you need JSONLines, nested output, or a CLI for Linux, ConvertCSV.com, jq, or DuckDB CLI are honest recommendations. For desktop GUIs on Mac or Windows with no file-size cap and full local processing, FileHop is free where Easy Data Transform and Vovsoft are paid.
Three pitfalls that break naive converters
Leading-zero corruption
Zip codes ('00123'), some country codes, phone numbers, and account IDs that start with zeros silently become integers in naive converters — '00123' becomes 123. DuckDB's read_csv_auto preserves these as strings IF the column contains any non-numeric value. If you have a pure-numeric column where leading zeros matter, quote the values in the source CSV before converting.
NULL vs empty string vs missing
JSON has three distinct ways a value can be absent: null, '', and key-not-present. CSV doesn't distinguish them at all. FileHop follows DuckDB's defaults: empty unquoted cells in numeric columns become null, empty quoted cells in string columns become '', and the key is always present. If your downstream pipeline depends on the distinction, normalize the CSV first or post-process the JSON with jq.
Sensitive CSV pasted into a browser tool
If your CSV contains customer emails, payment data, healthcare records, or anything covered by GDPR / HIPAA / PCI, do not paste it into a browser converter. Even tools that claim 'client-side processing' load third-party JavaScript that can change without notice. Use a desktop tool you can audit and run offline.
Which output shape per downstream system
A practical mapping of common downstreams to the JSON shape they actually want.
- 1 Building a REST API response → JSON Array. FileHop's default output works directly.
- 2 Importing to MongoDB → JSONLines (NDJSON). Use mongoimport --type=json with --jsonArray for arrays, or convert to NDJSON first with jq -c '.[]'.
- 3 Importing to Postgres → JSON Array via COPY ... FROM ... WITH (FORMAT json), or ndjson via line-delimited reads from psql.
- 4 Importing to BigQuery → JSONLines required (NEWLINE_DELIMITED_JSON source format). FileHop's array output needs jq -c '.[]' as a post-processing step.
- 5 Importing to Spark / Databricks → JSONLines preferred for parallel ingestion. spark.read.json defaults to NDJSON.
- 6 Frontend bundling (Webpack, Vite, esbuild) → JSON Array. Bundlers tree-shake and import the whole array as a JS object.
- 7 Files larger than 1 GB → JSONLines for streaming consumers, or skip JSON entirely and convert to Parquet (10x smaller, queryable without loading into memory).
- 8 Sensitive PII or regulated data → always local desktop conversion. Never paste it into a browser tool.
Free. Offline. No file-size limit. Mac and Windows desktop app.
Open the CSV to JSON Converter