Developer Tools

CSV vs JSON – the Differences and How to Convert Without Losing Data

Spreadsheets speak CSV; apps and APIs speak JSON. Moving data between them is a daily job – and a few small traps can quietly damage your data.

In this article
  1. Two formats, two strengths
  2. CSV to JSON: getting spreadsheet data into an app
  3. JSON to CSV: getting API data into a spreadsheet
  4. Traps that damage data
  5. Large files
  6. Check the result
  7. Choosing column names
  8. Cleaning before converting

Two formats, two strengths

CSVJSON
ShapeFlat table: rows and columnsNested objects and lists
Opens inExcel, Google Sheets, NumbersCode editors, apps, APIs
Data typesEverything is textText, numbers, true/false, null
Best forLists people edit and analyseData that programs exchange
CSV to JSON ConverterConvert CSV to JSON and JSON to CSV in your browser. Detects commas, semicolons and tabs, handles quoted fields, converts numbers, and flattens nested JSON.
Open the free tool

CSV to JSON: getting spreadsheet data into an app

  1. In Excel choose File → Save As → “CSV UTF-8”; in Google Sheets, File → Download → CSV.
  2. Open the file or paste its contents into the CSV ⇄ JSON Converter.
  3. Keep “First row is the header” on – column names become keys.
  4. Decide whether to convert numbers and true/false into real JSON types.
  5. Copy or download the JSON array.

The converter follows the CSV standard: quoted fields can contain commas, quotes and line breaks, and the delimiter (comma, semicolon, tab or pipe) is detected automatically.

JSON to CSV: getting API data into a spreadsheet

Switch the direction and paste a JSON array of objects. Every key becomes a column. Nested objects are flattened into dotted names – {"address": {"city": "Lahore"}} becomes a column called address.city – and any value containing commas or quotes is quoted correctly so it opens cleanly in Excel.

Traps that damage data

TrapWhat happensPrevention
Leading zerosPostcode 01234 becomes 1234Turn off number conversion for codes and phone numbers
Long numbersExcel shows card or ID numbers as 1.23E+15Format the column as Text before pasting
Accents and UrduShow as garbled charactersExport “CSV UTF-8”, not plain CSV
Semicolon CSVsEverything lands in one columnLet the converter detect the delimiter
DatesExcel changes 03-04 into a date or flips day/monthUse ISO dates: 2026-04-03

Large files

A CSV with tens of thousands of rows converts fine in a modern browser, but very large exports (hundreds of megabytes) are better handled with command-line tools or a database import. If a spreadsheet export is huge, check whether you need every column – deleting unused columns before export makes everything faster.

Check the result

Paste the JSON into the JSON Validator to confirm it is valid, and skim a few records in the JSON Formatter. For CSV, open it in your spreadsheet and check that columns line up and special characters look right.

Choosing column names

Column headers become JSON keys, so short, consistent names save trouble later. Prefer first_name or firstName over “First Name (as on ID)”, avoid duplicates, and do not leave a header cell empty. If several systems will use the data, agree on one naming style and convert headers with the Case Converter.

Cleaning before converting

Remove duplicate rows with Remove Duplicate Lines and stray spaces with Remove Extra Spaces – clean data in, clean data out.

Conversion runs entirely in your browser, so customer lists and exports never leave your computer.

CSV to JSON ConverterConvert CSV to JSON and JSON to CSV in your browser. Detects commas, semicolons and tabs, handles quoted fields, converts numbers, and flattens nested JSON.
Open the free tool
Keep reading

Related articles

All articles
Dev

How to Read JSON – A Beginner’s Guide to API Responses

Almost every app and website exchanges data as JSON. Once you can read its structure, error messages and API responses stop looking like noise.

3 min read
Dev

The Most Common JSON Errors – and How to Fix Each One

“Unexpected token” tells you something is wrong, not what. These are the mistakes behind almost every JSON error, with quick fixes.

3 min read
Text

How to Alphabetize Lists – and Why “Item 10” Comes Before “Item 2”

Sorting a list sounds trivial until numbers, capitals and accents get involved. Here is how to get the order you actually expect.

3 min read