What the conversion does
CSV to JSON Converter turns each row of a CSV file into a JSON object, using the header row as the keys:
101,Pro Laptop,1299.99
→ [{"id": "101", "product": "Pro Laptop", "price": "1299.99"}]
It also works the other way: a JSON array of objects becomes CSV that opens in Excel or Google Sheets, with the columns taken from the keys of the first object. Conversion runs in your browser; paste the data or load a .csv or .json file. Empty cells in a CSV row become empty strings ("") in JSON rather than null, so your downstream code can always expect string values for every column present in the header row.
Step by step
- In Excel, save the sheet as CSV UTF-8 (Comma delimited) (File → Save As). The converter reads plain CSV, not
.xlsx, and UTF-8 keeps Arabic, Spanish and accented letters intact instead of turning them into question marks. - Make sure the first row holds unique column names with no blank trailing rows below your data. Column names become your JSON keys, so short names without spaces (
unit_pricerather thanUnit Price (SAR)) are much easier to use in code. - Choose CSV to JSON, paste or load the file, and copy or download the result.
- Paste the output into JSON Formatter & Validator to confirm it is valid JSON, check the array length against your spreadsheet row count, and read it comfortably.
Why every value is a string
CSV has no data types: 00123, 1299.99 and TRUE are all just text. The converter keeps every value as a string on purpose, because guessing would damage data that only looks numeric:
- Postal codes, product codes and employee IDs such as
00123would lose their leading zeros. - Phone numbers like
+966500000000could turn into numbers in scientific notation. - Long account numbers would lose precision beyond about 15 digits.
Convert the fields that really are numbers in your own code, where you know which ones they are. For example, parse price with Number(row.price) after checking for empty strings, while leaving id, sku and postal_code as strings so formatting and leading zeros never change. Booleans and dates follow the same rule: normalize "TRUE", "true" or "1" explicitly in your importer instead of relying on automatic type guessing.
Quotes, commas and other traps
| In your CSV | What happens | What to do |
|---|---|---|
"Riyadh, KSA" | Stays one field, because it is quoted | Nothing |
"He said ""hi""" | Doubled quotes become one quote | Nothing |
| Semicolons between fields (common in Europe) | Not split, since fields are separated by commas | Replace the semicolons with commas first, or export with a comma delimiter |
| A line break inside a quoted cell | Not supported; each line is treated as a row | Remove line breaks in that column before exporting |
| Duplicate column names in the header row | Later columns overwrite earlier ones with the same key | Rename duplicate headers before converting |
| Blank trailing rows from a spreadsheet | Produces empty objects with blank string values | Delete empty rows below your table before saving CSV |
Going from JSON back to CSV
Choose JSON to CSV and paste a JSON array of objects (wrapped in square brackets [...]). The columns come from the keys of the first object, so if later objects have extra keys, put an object with every key first, or add the missing keys with empty values.
Nested objects and arrays do not map cleanly to flat spreadsheet columns: an address object like {"address": {"city": "Riyadh"}} will serialize as [object Object] or a raw string unless you flatten it first into top-level keys such as address_city. Do that flattening in your script or API export before converting to CSV, and verify that any fields containing commas or quotes look right when opened in Excel or Google Sheets.
Before you import the JSON
Before sending converted JSON into an API, database seed script or analytics pipeline, run two quick checks:
- Check the shape: Describe what your importer expects with JSON Schema Generator: paste a sample object and it creates a Draft 7 schema you can use to validate future files and catch missing required fields early.
- Check edge rows: Inspect the first row, the last row and any row that had commas, quotes or non-Latin characters in the original sheet.
- Config vs. data: If you are converting settings or deployment manifests rather than spreadsheet rows, YAML to JSON Converter handles the YAML files many developer tools use.