🔄 CSV to JSON Converter

Convert CSV to JSON in your browser, with control over type inference so leading zeros survive. Covers the Excel BOM and semicolon-delimiter traps.

Free No Signup Required Browser-Based

What CSV to JSON Converter Does

CSV looks simple and is not. There is no binding standard — RFC 4180 is an informational memo describing common practice, and real files violate it routinely. Converting to JSON forces every ambiguity in a CSV file to be resolved, which is why conversion is where data quietly breaks.

The two hard problems are quoting and typing. Quoting decides where a field ends when the field itself contains a comma, a quote or a newline. Typing decides whether the text 007 becomes the string "007" or the number 7 — and if it is a product code, that conversion has destroyed it.

This converter parses quoted fields, handles embedded delimiters and newlines, and lets you control type inference. The sections below cover what to check before trusting any CSV conversion, including yours.

How to Use CSV to JSON Converter

  1. Paste your CSV text or JSON array in the input box
  2. Choose whether to convert CSV to JSON or JSON to CSV
  3. Click Convert to generate the formatted output
  4. Click Copy Output to paste into your code editor or workflow

Type Inference Hazards

What naive numeric conversion does to values that look like numbers but are not. Verified against the JavaScript engine.

CSV valueBecomesWhy it matters
0077Product codes, US ZIP codes and account numbers lose leading zeros permanently
0123123Same problem; the original cannot be recovered
1e5100000A gene name, part number or ID read as scientific notation
+11A phone country code becomes the number one
1,234NaN or "1,234"Thousands separators are not numbers
TRUEstring or booleanDepends entirely on the parser
2026-09-06stringJSON has no date type; it stays text

Quoting Rules (RFC 4180)

SituationCorrect CSVResulting value
Field contains a comma"Smith, John"Smith, John
Field contains a quote"He said ""hi"""He said "hi"
Field contains a newline"line one⏎line two"A single field with a line break
Empty fielda,,cThe middle value is an empty string
Field with leading spaces" padded"Spaces inside quotes are significant

Source: RFC 4180 — Common Format and MIME Type for CSV Files

Why a File That Looks Fine Fails

CauseSymptomFix
UTF-8 BOM from ExcelFirst column name has an invisible prefix, so row.name is undefinedStrip the BOM before parsing the header
Semicolon delimiterEvery row becomes one fieldEuropean Excel uses ; when the decimal separator is a comma
CRLF vs LFTrailing \r on the last field of every rowNormalize line endings first
Duplicate column namesOne column silently overwrites the otherJSON object keys must be unique — rename first
Ragged rowsSome objects missing keys, or extra values droppedRows must have the same field count as the header
Mixed encodingsAccented characters become mojibakeConfirm the file is UTF-8, not Latin-1

How to Read Your Result

The BOM is the bug you cannot see

Excel writes a UTF-8 byte order mark at the start of the file. A naive parser makes the first header "\uFEFFname" rather than "name", so every lookup on that column returns undefined while the data looks perfect in the output. This is one of the most time-consuming CSV bugs precisely because the character is invisible. Strip a leading U+FEFF before splitting the header row.

Turn type inference off for identifiers

Any column that is an identifier rather than a quantity — SKU, ZIP code, phone number, account reference — should stay a string. The damage from converting "007" to 7 is irreversible once the original file is gone, and it usually surfaces weeks later when a join stops matching.

Semicolons are not a broken file

In locales where the comma is the decimal separator, Excel exports semicolon-delimited files and still calls them CSV. If every row parses as a single field, check the delimiter before concluding the file is corrupt.

JSON arrays versus newline-delimited JSON

A single JSON array is convenient for small data and awkward for large data, because the whole document must be parsed at once. NDJSON — one JSON object per line — streams and appends, which is why log pipelines and data warehouses prefer it. For a large export, NDJSON is usually the better target.

Limitations & Accuracy Notes

  • Conversion runs in your browser, so file size is bounded by available memory. Multi-hundred-megabyte files need a streaming parser rather than a web page.
  • CSV has no standard for representing null. An empty field could mean empty string, null or missing, and the converter has to pick one — check which convention your consumer expects.
  • Column order is preserved in the output, but JSON objects are formally unordered and a consumer is free to ignore it.
  • Nested JSON cannot be inferred from a flat CSV without a naming convention for the headers. This converter produces flat objects.
  • Very large integers beyond ±(2^53 − 1) lose precision if converted to numbers, exactly as they do anywhere else in JSON. Keep long IDs as strings.

Frequently Asked Questions

How does CSV to JSON conversion work?
The tool parses the first CSV row as object keys/headers and creates a JSON array of structured objects corresponding to each subsequent data row.
Is my data private and secure?
Yes, all conversion runs 100% in your browser using client-side JavaScript. No data is sent over the network.
How are commas inside a field handled?
A field containing a comma has to be wrapped in double quotes in the source CSV — that is what the format requires. A quoted field is read as a single value regardless of what is inside it, including commas and line breaks.
What happens to the header row?
It becomes the object keys, so each subsequent row converts to one object. If your file has no header row, the first data row will be consumed as one, which is usually obvious in the output.
Are numbers converted to JSON numbers or left as strings?
CSV has no type information — everything in the file is text. Any conversion to numbers or booleans is a guess made by the parser, and it is worth checking the output for fields like postal codes or product IDs with leading zeros, which lose them if treated as numbers.
Is my file uploaded?
No. The conversion runs in your browser, which matters because CSV exports are so often customer lists, transaction records or other data you would not want to hand to a third party.
Does it handle semicolon-separated files?
Semicolons are common in locales where the comma is the decimal separator, and a file using them will not parse as comma-separated. Replacing the delimiter before converting is the simplest fix.
Why do some rows have missing keys?
Because those rows had fewer fields than the header row. A ragged CSV — rows of differing length — is malformed, and the usual cause is an unescaped comma or quote somewhere earlier in the file.

References & Further Reading

By OnlineToolHubs Team • September 2026