Skip to content
ByteMath

Convert CSV to JSON online with correct quote handling

Paste CSV with a header row and get a JSON array of objects. Quoted commas and doubled quotes are parsed correctly; numbers and booleans are typed.

Last updated:

Inputs

Output

[
  {
    "sku": "A-100",
    "product": "Cable, 3 m",
    "price": 12.9,
    "stock": 140
  },
  {
    "sku": "A-101",
    "product": "Adapter \"USB-C\"",
    "price": 8.5,
    "stock": 0
  },
  {
    "sku": "A-102",
    "product": "Charger 65W",
    "price": 29,
    "stock": 37
  }
]
Input size
112 B
Output size
286 B
Records
3
Output vs input
255 %

Results are engineering estimates for planning. Final designs must follow your local code and be checked by a qualified professional.

This scenario at a glance

Input
ConversionCSV → JSON
CSV delimiterComma (,)
Inputsku,product,price,stock A-100,"Cable, 3 m",12.90,140 A-10…
Calculated
Output[ { "sku": "A-100", "product": "Cable, 3 m", …
Input size112 B
Output size286 B
Records3
Output vs input255 %

Engineering notes for this workload

CSV to JSON is the reverse trip: spreadsheet exports or database dumps that need to feed an API, a test fixture or a JavaScript app. The first row is treated as the header, and each following row becomes an object whose keys are the header names.

Correct parsing is harder than splitting on commas. The sample contains a product name with a comma inside quotes, "Cable, 3 m", and one with doubled quotes, "Adapter ""USB-C""", the RFC 4180 way of writing a literal quote. The parser handles both, as well as line breaks inside quoted fields and Windows CRLF line endings, which naive split-based scripts get wrong.

Values are typed where it is safe. Plain integers and decimals become JSON numbers, true and false become booleans, and null becomes null. Values with leading zeros, such as ZIP codes, article numbers like 007 or phone numbers, stay strings so that the zeros are not lost. Prices such as 12.90 become 12.9 as numbers; if you need exact decimal formatting, keep prices as strings or as integer cents in your application.

Exports from European spreadsheets often use semicolons and decimal commas. Choose the semicolon delimiter for such files. Decimal commas, such as 12,90, stay strings because they are not valid JSON numbers; convert them in your application with the correct locale rules.

Check headers before converting: duplicate column names overwrite each other in the resulting objects, and spaces or special characters in headers make awkward JSON keys. Renaming headers to camelCase or snake_case in the spreadsheet first usually saves a cleanup step.

All processing happens locally in your browser, so customer lists and internal exports stay on your machine.

Validate the result with the JSON formatter before importing it into another system, and spot-check a few rows against the original spreadsheet, especially rows with quotes, empty cells and special characters.

Reference table

Data format reference
FormatStandardKey rules
CSVRFC 4180Fields with delimiter, quote or newline are quoted; quotes doubled ("")
CSV (Excel DE/FR/ES)Locale defaultSemicolon delimiter because comma is the decimal separator
JSONRFC 8259UTF-8, double-quoted keys and strings, no trailing commas, no comments
Base64RFC 4648 §4A–Z a–z 0–9 + /, = padding, 4 characters per 3 bytes (+33 %)
Base64urlRFC 4648 §5- and _ instead of + and /, padding often omitted (JWT)

All conversions on this site run locally in your browser.

Questions about this scenario

How do I convert CSV to JSON?

Paste CSV with a header row. Each row becomes an object with the header names as keys.

Does the converter handle commas inside quotes?

Yes. It follows RFC 4180, including quoted delimiters, doubled quotes and line breaks inside quoted fields.

Why are some numbers kept as strings?

Values with leading zeros or decimal commas stay strings to avoid losing information.