# Excel to CSV: Convert All Sheets of XLSX & XLS (`ucchiii/excel-to-csv`) Actor

Convert Excel workbooks (XLSX, XLSM, XLS) to CSV: every sheet of every file in one run, one CSV per sheet with a download link. Pick sheets, header row, ISO dates, delimiter and UTF-8 BOM for Excel. Formulas become their values. Empty input = free demo.

- **URL**: https://apify.com/ucchiii/excel-to-csv.md
- **Developed by:** [Actor Factory](https://apify.com/ucchiii) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.05 / 1,000 converted rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

**Turn Excel workbooks into CSV files: every sheet at once, one CSV per sheet**

**For anyone who gets Excel files and needs plain CSV: analysts loading reports into a database, developers feeding a pipeline, teams whose supplier or accounting system sends multi-sheet workbooks.** Give this Actor links to `.xlsx`, `.xlsm` or old `.xls` files. It reads **all sheets of each workbook in one run** and saves **one CSV file per sheet**, with a download link for each in the result table.
**$0.0015 per converted workbook plus $0.00007 per converted row ($0.07 per 1,000 rows), header row not counted.** **The $5 monthly free credit covers about 70,000 rows in 1,000-row workbooks.** Failed files and the demo are free. No scraping, no API keys.

**Try it free: leave the file list empty and press Start** (clear the prefilled URL first). The demo converts a built-in two-sheet workbook, is not charged and every result row carries `_demo: true`.

### The problems it solves

- **A workbook has many sheets and you need each one as a CSV.** Here every sheet becomes its own file in a single run, or only the ones you name.
- **The report has a title block above the column names.** Say which row holds the header (`Header row: 4`) and the rows above it are left out.
- **Dates come out as numbers like 46083, or in a format your database rejects.** Dates are written as ISO 8601 (`2026-03-02`, or `2026-03-02T09:30:00` when the cell has a time).
- **Formulas show up empty or as `=A2*3`.** You get the value Excel last calculated and saved.
- **Excel garbles accents or Japanese text when you open the CSV.** Turn on the UTF-8 BOM and it opens correctly by double-click. European Excel wants semicolons: pick the semicolon delimiter.
- **Old `.xls` files from legacy systems.** They are read too.

### What it does

- **All sheets by default**; or choose sheets by name (case-insensitive) or by position (`2` = second sheet). Hidden sheets are skipped unless you turn them on.
- **Header row choice**, including "no header row" (every row is data).
- **Skips empty rows** and trailing empty columns. Turn it off to keep blank lines between data rows.
- **Cached values for formulas.** Numbers come out clean (`0.3`, not `0.30000000000000004`; `3`, not `3.0`), booleans as `TRUE` / `FALSE`, Excel error cells as their text (`#N/A`).
- **Delimiter**: comma, semicolon, tab or pipe. Cells with the delimiter, quotes or line breaks are quoted.
- **Encoding**: UTF-8, with or without a BOM. **Line endings**: LF or CRLF.
- **Several workbooks per run**, each sheet gets its own result row.

### Input example

```json
{
  "fileUrls": ["https://example.com/exports/monthly-report.xlsx"],
  "sheets": [],
  "headerRow": 1,
  "delimiter": ",",
  "utf8Bom": true
}
```

Workbooks that an earlier step produced can come from an Apify dataset: use `datasetIds` with items like `{"fileName": "report.xlsx", "contentBase64": "..."}`.

### Output

- **Dataset**: one row per sheet (and one row for a file that failed).
- **Key-value store**: each CSV under `csvKey` (for example `monthly-report--01-Sales.csv`). `csvUrl` is Apify's signed public link, so you can share the file without sharing your token.
- **STATS** record: files and sheets converted, files failed, rows converted and rows charged.

```json
{
  "file": "https://example.com/exports/monthly-report.xlsx",
  "sheet": "Sales",
  "sheetIndex": 1,
  "hidden": false,
  "status": "ok",
  "rows": 2500,
  "columns": 8,
  "csvKey": "monthly-report--01-Sales.csv",
  "csvBytes": 214930,
  "csvUrl": "https://api.apify.com/v2/key-value-stores/…/records/monthly-report--01-Sales.csv?signature=…",
  "chargedRows": 2500,
  "chargedFiles": 1
}
```

`status` is `ok` (CSV saved), `empty` (the sheet has no data rows; nothing is saved or charged), `failed` (the file could not be converted; the `error` says why) or `skipped` (your maximum charge was reached).

### Limits (cannot be raised by input)

- 50 MB per workbook; 50 files per run (200 MB in total for files read from datasets)
- Up to 1,500,000 data rows per workbook across the selected sheets. A bigger workbook fails with a clear message instead of being cut; select fewer sheets
- A download is tried up to 3 times when the server is slow or answers with a temporary error (HTTP 429, 5xx); a clear error such as 404 is not retried. The timeout is 60 seconds per request
- Source URLs must be public `http` or `https` links. Addresses on internal networks (localhost, private ranges, cloud metadata) are blocked, also after redirects
- Not supported: password-protected workbooks, binary `.xlsb`, and Google Sheets links (download the sheet as .xlsx first)
- Cell values are written as stored, not as displayed: a cell formatted as `25%` is written as `0.25`, and currency symbols are not added

### Pricing

Pay per event: **$0.0015 per converted workbook** (event `file`) **plus $0.00007 per converted row** (event `row`). The header row is not counted. A workbook with 1,000 rows costs $0.0715. A file that fails, a sheet with no data rows and the demo are not charged. Set a maximum charge per run to cap spend; a workbook that does not fit in the remaining budget is skipped whole, never cut. If none of the files fit, nothing is converted or charged and the run ends as Failed ("No sheet could be converted. See the dataset rows for the reason."); each skipped file's row in the dataset says "Max charge reached before this file; it was not converted."

### FAQ

**Which sheets are converted if I choose none?** All visible sheets. Hidden sheets need "Include hidden sheets", or name them in "Sheets to convert".
**What if a formula shows up empty?** Files written by a script without Excel (for example by some export libraries) hold formulas but no calculated results. Open and save the file once in Excel and the values are stored. Files saved by Excel, LibreOffice or Google Sheets always have them.
**Why is a sheet marked `empty`?** It has no rows below the header row (or nothing at all). Check "Header row" if you expected data.
**Are merged cells filled in?** No. Only the top-left cell of a merged range holds a value; the other cells stay empty.
**Does it change my source?** No. It only reads the file and writes new CSV files.
**Is the file link private?** Anyone holding the signed link can download that file; it gives no access to anything else in your account.

If this Actor saved you time, a rating on the Store helps others find it.

### More tools from the same developer

- [CSV to Excel Converter](https://apify.com/ucchiii/csv-xlsx-converter) — convert CSV, TSV, Excel XLSX, JSON and NDJSON files or Apify datasets into each other
- [Excel to JSON](https://apify.com/ucchiii/excel-to-json) — turn Excel (XLSX) sheets into JSON rows, or a JSON file into an Excel sheet
- [CSV Encoding Converter](https://apify.com/ucchiii/csv-encoding-converter) — detect the encoding of CSV and text files and convert them to UTF-8 (or another encoding)
- [JSON to CSV Converter](https://apify.com/ucchiii/json-to-csv) — turn nested JSON files or datasets into one flat CSV file
- [Dataset Transform](https://apify.com/ucchiii/dataset-transform) — flatten, filter, rename and convert any Apify dataset, export CSV / JSON / JSONL with a link

# Actor input Schema

## `fileUrls` (type: `array`):

Public http(s) links to Excel files (.xlsx, .xlsm or .xls), one per entry (up to 50 files and 50 MB each). Links to internal networks are blocked. Leave this AND 'Apify datasets with files' empty to run a free demo on a built-in sample (not charged).

## `datasetIds` (type: `array`):

Optional. Dataset IDs whose items each hold one workbook: 'contentBase64' (the file bytes, base64-encoded) and optionally 'fileName'. Use this when an earlier step produced the Excel file. Each item becomes one converted workbook. You can paste a dataset URL from Apify Console too.

## `sheets` (type: `array`):

Optional. Names of the sheets to convert (case-insensitive), or their position counted from 1 (2 = the second sheet). Leave empty to convert ALL sheets. If a name is also a number, the name wins. A workbook that has none of the listed sheets fails for free and the error lists the available sheet names.

## `headerRow` (type: `integer`):

Row number (counted as in Excel, from 1) that holds the column names. Rows above it, such as report titles, are left out of the CSV. Use 0 when the sheet has no header row: then every row is data. The header row itself is not charged. Default: 1.

## `includeHiddenSheets` (type: `boolean`):

On: sheets hidden in Excel are converted too. Off: hidden sheets are skipped (a sheet you name in 'Sheets to convert' is always converted). Default: off.

## `skipEmptyRows` (type: `boolean`):

On: rows without any value are left out, and so are empty rows at the end. Off: empty rows between data rows stay as empty lines (empty rows at the end are still dropped). Default: on.

## `dateFormat` (type: `string`):

How date and date-time cells are written. Times without a date are written as 09:30:00. Numbers and percentages are written as their stored value (0.25, not 25%). Default: iso.

## `delimiter` (type: `string`):

Column separator of the CSV files. Cells that contain the separator, quotes or line breaks are quoted. Default: comma.

## `utf8Bom` (type: `boolean`):

On: each CSV starts with a UTF-8 byte-order mark, so Excel opens accented and Japanese or Chinese text correctly by double-click. Off: plain UTF-8, which databases and scripts expect. Default: off.

## `lineEnding` (type: `string`):

Line ending of the CSV files. Default: lf.

## Actor input object example

```json
{
  "fileUrls": [
    "https://raw.githubusercontent.com/fenago/datasets/main/Financial%20Sample.xlsx"
  ],
  "headerRow": 1,
  "includeHiddenSheets": false,
  "skipEmptyRows": true,
  "dateFormat": "iso",
  "delimiter": ",",
  "utf8Bom": false,
  "lineEnding": "lf"
}
```

# Actor output Schema

## `results` (type: `string`):

One row per sheet: file, sheet name, rows, columns, the CSV file key and its public URL (csvUrl), or the error. Download as CSV, JSON, Excel and more.

## `stats` (type: `string`):

Record STATS: files and sheets converted, files failed, rows converted and rows charged.

## `files` (type: `string`):

The key-value store that holds the converted CSV files.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fileUrls": [
        "https://raw.githubusercontent.com/fenago/datasets/main/Financial%20Sample.xlsx"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("ucchiii/excel-to-csv").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "fileUrls": ["https://raw.githubusercontent.com/fenago/datasets/main/Financial%20Sample.xlsx"] }

# Run the Actor and wait for it to finish
run = client.actor("ucchiii/excel-to-csv").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fileUrls": [
    "https://raw.githubusercontent.com/fenago/datasets/main/Financial%20Sample.xlsx"
  ]
}' |
apify call ucchiii/excel-to-csv --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,ucchiii/excel-to-csv"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/dZVqs554D4mPJAnlT/builds/CdVkJlz0LV38BIK2s/openapi.json
