Spreadsheets speak CSV; APIs and apps speak JSON. Converting between them is a daily task for developers, marketers and analysts – importing product lists, preparing test data, or turning an API response into something you can open in Excel. Here is how to do it cleanly.
Page Contents
A quick example
This CSV:
name,city,activePriya,Pune,trueTom,Leeds,false
becomes this JSON (array of objects):
[{"name":"Priya","city":"Pune","active":true},{"name":"Tom","city":"Leeds","active":false}]
The first row becomes the keys; each following row becomes one object.
Choose the right JSON shape
| Output | Looks like | Best for |
|---|---|---|
| Array of objects | [{“name”:”Priya”}, …] | APIs, apps, most uses |
| Array of arrays | [[“name”],[“Priya”]] | Compact data, charts |
| Object keyed by first column | {“SKU-1”: {…}} | Fast lookups by ID |
Delimiters
CSV means “comma-separated”, but not always:
- Comma – the default in the US and UK.
- Semicolon – Excel uses it in many European locales where the comma is the decimal separator.
- Tab – what you get when you copy cells from Excel or Google Sheets.
- Pipe – some exports and legacy systems.
Our CSV to JSON converter detects the delimiter automatically.
Quotes and line breaks
Values that contain the delimiter, quotes or line breaks are wrapped in double quotes, and quotes inside are doubled: a value of 5" screen is written as "5"" screen". A good converter follows these rules (RFC 4180) instead of simply splitting on commas.
Numbers, booleans and empty values
- Numbers like
42and3.5can become JSON numbers. trueandfalsecan become booleans.- Be careful with IDs, phone numbers and postcodes:
007or+44…should stay strings, or leading zeros and plus signs are lost. - Empty cells can become empty strings or null – decide what your app expects.
JSON back to CSV
- Each object becomes a row; keys become the header.
- Nested objects and arrays do not fit a flat table – flatten them first or store them as JSON text in one column.
- Objects with different keys: the converter collects all keys, leaving blanks where a value is missing.
Opening CSV in Excel correctly
- Save as UTF-8 so accents and non-Latin text display correctly.
- If everything lands in one column, Excel expected a different delimiter – use Data › From Text/CSV and choose it.
Next steps
Validate and format the result with the JSON Formatter – and if you hit errors, see common JSON errors. Building an Android app? Turn the JSON into Kotlin data classes.
FAQ
How do I convert Excel to JSON?
Copy the cells from Excel, paste them into the converter (it detects tabs) and copy the JSON.
Why are my leading zeros missing?
The value was converted to a number. Keep IDs, phone numbers and postcodes as text.
Can CSV contain commas inside values?
Yes, if the value is wrapped in double quotes.
What happens to nested JSON when converting to CSV?
It must be flattened or stored as text, because CSV is a flat table.
Is my data uploaded?
No. The conversion runs in your browser.
Need a website or app for your business? Talk to Techpass Master – we design and build websites and apps for clients worldwide.
