Convert CSV to JSON, or JSON to CSV.
Drop in a CSV and get clean JSON, or drop in a JSON file and get a spreadsheet-ready CSV for Excel or Google Sheets. The direction follows your file, and nothing leaves your device. CSV values come out as text; nested JSON fields stay as JSON text in one cell.
CSV to JSON and JSON to CSV: quick facts
CSV becomes JSON using the header row as field names; a JSON list of records becomes a CSV for Excel or Google Sheets.
Updated
- Price
- Free. No sign-up, no watermark.
- Handles
- Quoted fields with commas, line breaks and quotes; empty cells become "".
- Values
- Kept as text, so leading zeros in codes and phone numbers are safe.
- Input
- Comma-separated .csv saved as UTF-8 (not .xlsx or semicolon files), or a .json file. JSON Lines (.jsonl) needs wrapping in [ ] first.
- JSON to CSV
- One column per field seen across all records; missing fields are left empty and nested data is kept as JSON text in the cell.
- Privacy
- Your file is processed in your browser and never uploaded.
How to convert CSV to JSON (or JSON to CSV)
Drop in a .csv file and Altto turns each row into a JSON object, using your header row for the field names, then saves it as a neatly indented .json file. Drop in a .json file instead and it makes one row per record and one column per field.
- 01
Add your file
A .csv with a header row, or a .json list of records.
- 02
Convert
Altto works out the direction from the file and converts it, locally.
- 03
Save the result
A clean .json file, or a .csv ready to open in a spreadsheet.
Tips for clean JSON from a spreadsheet
A little tidying before you export saves fixing field names in your code later.
- Make row 1 your headingsField names come from the first row, so a title or blank line above your headings ends up as the field names. Delete anything above the real header row before exporting.
- Keep headings code-friendlyHeadings become keys, so “Order date” gives a key with a space in it. Short names such as order_date are easier to use in code, and Case Converter can turn a list of headings into snake_case.
- Export as CSV UTF-8In Excel, use Save As and choose “CSV UTF-8 (Comma delimited)”; in Google Sheets, download as .csv. Both keep accents and symbols intact and use commas, which is what this tool reads.
- Check it by converting backTo see that nothing was lost, drop the JSON back in here to make a CSV and compare the result with your original spreadsheet.
Like every Altto tool, this runs on your device — nothing you add is uploaded. How Altto works
of indentation lay out the JSON, one field per line, so it’s easy to read through and check before you use it.
Turning JSON into a tidy spreadsheet
JSON can hold shapes a spreadsheet can’t, so a little preparation gives you cleaner columns.
- Fix the file if it won’t loadOne missing comma or quote makes a whole JSON file unreadable. If yours is rejected, open it in a code editor such as VS Code, which underlines the exact spot that’s broken.
- Bring nested fields up a levelNested objects and lists are kept as JSON text inside a single cell, so nothing is lost, but you can’t sort or filter by them. If you need a nested value such as a city in its own column, move it to the top level of each record first.
- Expect columns in first-seen orderColumns appear in the order fields first turn up, so a field that only appears in the 50th record becomes the last column. Rearrange columns in your spreadsheet afterwards if the order matters.
is how the CSV is saved, with the marker Excel looks for, so names with accents and symbols such as £ open correctly instead of turning into odd characters.
What your JSON will look like
Each row of the CSV becomes one object in a JSON array, and the header row supplies the field names.
name,city,orders
Alice,Leeds,3
"Smith, Bob",Birmingham,12[
{
"name": "Alice",
"city": "Leeds",
"orders": "3"
},
{
"name": "Smith, Bob",
"city": "Birmingham",
"orders": "12"
}
]Things worth knowing before you convert
- Every value comes out as text.
3becomes"3", not the number 3. That's deliberate: it keeps leading zeros in things like phone numbers, postcodes and product codes ("0121","007") exactly as they were. If you need real numbers, convert those fields in your own code afterwards — for example withNumber()in JavaScript orint()in Python. - Headers become keys exactly as written. A column called
Order IDbecomes the key"Order ID", spaces and capitals included. If you want code-friendly keys likeorder_id, rename the header cells in your spreadsheet before exporting. - It expects comma-separated files. Some European versions of Excel save “CSV” files with semicolons instead. If your file looks like
name;city;orders, re-save it with commas: in Google Sheets, File → Download → Comma-separated values always uses commas. - Excel's “CSV UTF-8” exports work as-is. Excel adds a hidden marker to the start of those files; Altto strips it, so your first field name comes out clean instead of with an invisible character in front of it.
- Completely blank lines are skipped, so a stray empty row at the end of an export won't turn into an empty object.
What people use it for
- Loading spreadsheet data into a website or app that reads JSON.
- Seeding a database or test environment from a sheet someone else maintains.
- Turning a list of products, locations or contacts into a config or data file for a developer.
- Sending sample data to an API with a tool like Postman.
The output is a single JSON array, indented with two spaces so it's easy to read, and ready to load with JSON.parse(), Python's json.load() or most import tools.
Frequently asked questions
How your rows and columns are turned into JSON, and what to do when a file won’t convert cleanly.
How does it decide the field names?
Does it handle commas and quotes inside a field?
What if two rows have different numbers of columns?
Is there a file size limit?
Why are my numbers in quotes in the JSON?
My CSV uses semicolons instead of commas. Will it work?
Can I convert an Excel file directly?
Will accents and symbols come through?
What do empty cells become?
What kind of JSON works best?
[{"name":"Alice","age":30}] — converts cleanly into rows and columns. A single object is treated as one row.