CSV to Excel
Convert CSV text into a downloadable Excel (.xlsx) workbook.
/v1/convert/csv-to-excel
curl -X POST "https://convert.toolkitapi.io/v1/convert/csv-to-excel" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"csv": "name,age,city\nAlice,30,London\nBob,25,Paris", "sheet_name": "People"}'
import httpx
resp = httpx.post(
"https://convert.toolkitapi.io/v1/convert/csv-to-excel",
json={"csv": "name,age,city\nAlice,30,London\nBob,25,Paris", "sheet_name": "People"},
)
print(resp.json())
const resp = await fetch("https://convert.toolkitapi.io/v1/convert/csv-to-excel", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({"csv": "name,age,city\nAlice,30,London\nBob,25,Paris", "sheet_name": "People"}),
});
const data = await resp.json();
console.log(data);
# See curl example
{
"rows": 2,
"columns": 3,
"file_size": 5231,
"file_url": "https://convert.toolkitapi.io/v1/convert/download/abc123.xlsx",
"file_name": "output.xlsx",
"file_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
}
Description
How to Use
1. POST your CSV content in the `csv` field (or pass a public `url`).
2. Optionally set `sheet_name`, `delimiter`, or `has_header` to override defaults.
3. Follow the `file_url` in the response to download the generated `.xlsx`.
About This Tool
CSV to Excel converts a CSV string (or the contents of a public URL) into a native `.xlsx` workbook. The first row is treated as a header row by default, producing a properly-typed Excel sheet that opens cleanly in Microsoft Excel, Google Sheets, Numbers, and LibreOffice.
The response returns a presigned download URL together with row and column counts. For very large inputs, use the async jobs API.
Why Use This Tool
- Report exports — Convert CSV reports generated by data pipelines into analyst-friendly Excel workbooks
- Customer deliverables — Transform CSV extracts into branded `.xlsx` attachments
- Spreadsheet migration — Move legacy CSV data into modern Excel-based workflows
- Data sharing — Package CSV datasets as Excel files for stakeholders who prefer spreadsheets
Frequently Asked Questions
How big can the CSV be?
Are cell types inferred?
How long are download URLs valid?
Start using CSV to Excel now
Get your free API key and make your first request in under a minute.