🧩

CSV to Excel

Convert CSV text into a downloadable Excel (.xlsx) workbook.

POST 1 credit /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
Response 200 OK
{
  "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

Convert CSV text into a downloadable Excel (.xlsx) workbook.

How to Use

1

1. POST your CSV content in the `csv` field (or pass a public `url`).

2

2. Optionally set `sheet_name`, `delimiter`, or `has_header` to override defaults.

3

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

Frequently Asked Questions

How big can the CSV be?
Synchronous requests accept up to the server-configured payload limit (typically a few MB). For larger workbooks, submit the job via the async endpoint and poll `/convert/jobs/{job_id}`.
Are cell types inferred?
Numeric-looking values are stored as strings to preserve input fidelity. Apply type coercion before conversion if you need native number or date cells.
How long are download URLs valid?
Presigned URLs are short-lived (typically 1 hour). Download the file promptly or call the endpoint again to regenerate.

Start using CSV to Excel now

Get your free API key and make your first request in under a minute.