CSV is how spreadsheets export data; JSON is how APIs and JavaScript apps consume it. Converting between them is an everyday developer task.
Step-by-Step Instructions
- Export your sheet as CSV (Excel: Save As → CSV UTF-8; Google Sheets: File → Download → CSV).
- Paste or upload it into CSV to JSON.
- Check that the header row became the keys.
- Copy or download the JSON; validate it with the JSON Formatter.
Example
name,age
Ava,31
Leo,27
→ [{"name":"Ava","age":"31"},{"name":"Leo","age":"27"}]Watch Out For
- Commas inside values must be wrapped in quotes.
- Numbers may come through as strings — convert types in your code if needed.
- Use UTF-8 to keep accents and symbols intact.
Going the Other Way
Need a spreadsheet from an API response? Use JSON to CSV.
How Do I Export a Clean CSV From Excel?
In Excel choose File → Save As → CSV UTF-8 (Comma delimited). The UTF-8 option keeps accented letters and symbols intact. In Google Sheets use File → Download → Comma-separated values.
Why Are My Numbers in Quotes?
CSV has no data types – everything is text. A converter can guess numbers and true/false values, but values like ZIP codes (02134) or phone numbers should stay as text so leading zeros aren't lost. Check the output before importing it into an app.
Can CSV Become Nested JSON?
A flat CSV maps to an array of flat objects, one per row. For nested data, use column names with dots (for example address.city) and transform them in code, or keep the data flat – most APIs and databases accept flat records.
How Do I Convert CSV to JSON in Code?
In Python: import csv, json; rows = list(csv.DictReader(open('data.csv', encoding='utf-8'))); json.dump(rows, open('data.json', 'w'), indent=2). In JavaScript, libraries such as Papa Parse read CSV into objects that you can pass to JSON.stringify.
Frequently Asked Questions
Get new free tools in your inbox
One short email a month with new tools, guides and productivity tips. No spam — unsubscribe anytime.
By subscribing you agree to receive emails from ToolsPoint Online. See our Privacy Policy.