FileCrafty Files never leave your device

CSV to JSON: A Practical Guide (With the Traps to Avoid)

CSV is the language of spreadsheets; JSON is the language of web apps and APIs. Sooner or later you need to move data from one to the other — importing a product list, seeding a database or feeding a script. The conversion looks trivial, but a few details decide whether your data arrives intact.

How CSV becomes JSON

A CSV file is a table. The first row usually holds the column names:

id,name,city,zip
1,Ana,Vilnius,01100
2,Ben,Austin,73301

The most common JSON shape is an array of objects — one object per row, with the column names as keys:

[
  { "id": 1, "name": "Ana", "city": "Vilnius", "zip": "01100" },
  { "id": 2, "name": "Ben", "city": "Austin", "zip": "73301" }
]

That’s what the CSV to JSON converter produces by default.

Trap 1: numbers that aren’t numbers

Notice that id became a number but zip stayed a string. That’s deliberate. Postal codes, phone numbers, account numbers and product codes often start with zero. Treat 01100 as a number and it silently becomes 1100 — a bug that can go unnoticed for months.

FileCrafty decides types per column: a column becomes numbers only if every value in it is a clean number. As soon as one value has a leading zero or isn’t numeric, the whole column stays text.

Trap 2: the wrong delimiter

“Comma-separated” files aren’t always separated by commas. Excel in many European locales saves CSV with semicolons, because the comma is the decimal separator there. Tab-separated files (TSV) are common too. The converter detects the delimiter automatically, so 1;Ana;Vilnius is split correctly.

Trap 3: commas and quotes inside values

A value like "Smith, John" contains a comma, so it’s wrapped in quotes in the CSV. Quotes inside a value are doubled: "He said ""hi""". Naive conversions that just split on commas break these rows. A proper CSV parser — like the one in the converter — handles quoted fields, embedded commas and even line breaks inside a cell.

Trap 4: empty cells

An empty cell can mean “no value” or “empty text”. In JSON, these are different: null versus "". Decide which one the system you’re importing into expects, and check a few records after converting.

Going the other way

Need to turn an API response back into a spreadsheet? JSON to CSV flattens nested objects into columns such as address.city, and JSON to Excel gives you an .xlsx file directly. To check or tidy JSON before using it, paste it into the JSON formatter — it pinpoints the line and column of any syntax error.

Your data stays private

Customer lists and exports often contain personal data. The converter runs entirely in your browser, so the file is never uploaded to a server.

Quick answer

Drop your file into CSV to JSON, check the preview and download. Leading zeros, semicolons and quoted commas are handled for you.

Keep reading

PDF

How to Sign a PDF Without Printing It

Stop printing, signing and scanning. Sign a PDF in a minute by drawing, typing or uploading your signature — on a computer or a phone.

· 2 min read

All guides