Excel to CSV
Convert an Excel (.xlsx) workbook into CSV text.
POST
1 credit
/v1/convert/excel-to-csv
curl -X POST "https://convert.toolkitapi.io/v1/convert/excel-to-csv" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"file": "UEsDBBQAAAAIA...", "sheet_name": "Sheet1"}'
import httpx
resp = httpx.post(
"https://convert.toolkitapi.io/v1/convert/excel-to-csv",
json={"file": "UEsDBBQAAAAIA...", "sheet_name": "Sheet1"},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/excel-to-csv", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"file": "UEsDBBQAAAAIA...", "sheet_name": "Sheet1"}),
});
const data = await resp.json();
console.log(data);
# See curl example
Response
200 OK
{
"csv": "name,age,city\nAlice,30,London\nBob,25,Paris\n",
"rows": 2,
"columns": 3,
"sheet_name": "Sheet1",
"file_url": "https://convert.toolkitapi.io/v1/convert/download/abc123.csv",
"file_name": "output.csv",
"file_type": "text/csv"
}
Description
Convert an Excel (.xlsx) workbook into CSV text.
How to Use
1
1. POST the workbook as base64-encoded `file`, or pass a `url` to a publicly accessible `.xlsx`.
2
2. Optionally set `sheet_name` to target a specific worksheet.
3
3. Read the `csv` string inline or follow `file_url` for a downloadable copy.
About This Tool
Excel to CSV extracts a single worksheet from a `.xlsx` file and returns it as a CSV string plus a downloadable file. Pass the workbook as base64 in `file` or point to a public URL via `url`.
You can choose which sheet to export by name; if omitted, the first sheet is used. Formulas are evaluated to their last-saved value.
Why Use This Tool
- Data extraction — Pull tabular data out of analyst workbooks for downstream pipelines
- Backup and archival — Convert `.xlsx` into plain-text CSV for long-term storage
- Tooling interop — Feed Excel data into Unix tooling (`awk`, `grep`, `cut`)
- Database imports — Turn workbooks into CSV for bulk-load utilities
Frequently Asked Questions
Are formulas preserved?
No — formulas are evaluated to their cached values. If a workbook has not been recalculated, cells may return stale or empty values.
What about multi-sheet workbooks?
Only one sheet is exported per call. To export multiple sheets, call the endpoint once per `sheet_name`.
Are merged cells flattened?
Yes. The value of a merged region is written to the top-left cell and other cells are left blank.
Start using Excel to CSV now
Get your free API key and make your first request in under a minute.