# PDF to Word & Excel Converter (Bulk DOCX, XLSX) (`toowl/pdf-to-word-excel`) Actor

Convert PDFs to editable Word (DOCX) and Excel (XLSX) in bulk from URLs: paragraphs with fonts, bold and italic kept; tables to spreadsheet cells with real numbers and dates. No Microsoft Office or LibreOffice needed. Pay per page.

- **URL**: https://apify.com/toowl/pdf-to-word-excel.md
- **Developed by:** [Chalid Ade](https://apify.com/toowl) (community)
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 pdf pages converted

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/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

## PDF to Word & Excel Converter — bulk DOCX and XLSX

Turn PDFs into files you can actually edit: **Word (.docx)** with the text flow, fonts, bold and italic kept, and **Excel (.xlsx)** with tables split into real cells. Numbers and dates come out as real values, so your formulas work straight away.

Give it a list of PDF URLs (invoices, bank statements, reports, price lists, contracts) and get one Word and/or Excel file per PDF, with download links in the dataset. No Microsoft Office, no LibreOffice, no upload to a third-party converter.

### What you get

- **Word (.docx)**: paragraphs rebuilt from the PDF lines (not one text box per line), headings and body sizes, bold/italic, centred titles, indents, right-aligned "label ⇥ date" lines and a page break per PDF page
- **Excel (.xlsx)**: tables detected from column positions, header rows bold, borders, column widths, and loose text lines kept in order around the tables
- **Real numbers**: `1.234,56`, `1,234.56`, `12%` and dates become numeric cells (decimal style detected per file); switch it off to keep text as-is
- **One sheet or one per page**: in one-sheet mode a table header repeated at the top of every page is kept once, which is great for multi-page statements
- **Both at once**: `"output": "both"` writes the .docx and the .xlsx from a single read of the PDF
- Password-protected PDFs and scans are reported per file (and not charged). Scans: run the [OCR Actor](https://apify.com/toowl/ocr-image-pdf-to-text?fpr=toowl) first

### Input

```json
{
  "files": [
    { "url": "https://example.com/invoice-1042.pdf" },
    { "url": "https://example.com/bank-statement-october.pdf" }
  ],
  "output": "both",
  "sheets": "merge",
  "convertNumbers": true
}
```

### Output

One dataset row per PDF:

```json
{
  "name": "bank-statement-october.pdf",
  "title": "Account statement",
  "pages": 4,
  "paragraphs": 61,
  "docxUrl": "https://api.apify.com/v2/key-value-stores/…/records/0002-bank-statement-october.docx",
  "tables": 4,
  "sheets": 1,
  "rows": 132,
  "xlsxUrl": "https://api.apify.com/v2/key-value-stores/…/records/0002-bank-statement-october.xlsx"
}
```

The files themselves sit in the run's key-value store, with a `SUMMARY` record.

### Pricing

Pay per event: one `pdf-page-converted` per PDF page (Word, Excel or both, same price). Files that fail (locked, scanned, not a PDF) are free. Cap spending with "Max cost per run" and limit long files with `maxPages`.

### Good to know

Word output follows the text flow, so it is easy to edit; it does not copy pictures or exact positions. If you need text as Markdown for an LLM instead, use [PDF to Markdown](https://apify.com/toowl/pdf-to-markdown?fpr=toowl).

### Free browser version

Converting one file? [PDF to Word](https://toowl.my.id/en/pdf-to-word/) and [PDF to Excel](https://toowl.my.id/en/pdf-to-excel/) on toowl.my.id run the same engine in your browser for free, without uploading the file.

### Call it from your code

```bash
curl -X POST "https://api.apify.com/v2/acts/toowl~pdf-to-word-excel/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"files":[{"url":"https://example.com/invoice.pdf"}],"output":"both"}'
```

The same call works from Python (`apify-client`), JavaScript, Make, Zapier and n8n (Apify app/node or a plain HTTP request).

### Use it from AI agents (MCP)

Add this Actor as a tool to Claude, Cursor, VS Code or any MCP client through Apify's MCP server:

```
https://mcp.apify.com/?actors=toowl/pdf-to-word-excel
```

The agent can then pass file URLs and read the results itself.

### More toowl file APIs

Speech to text & subtitles, AI vocal remover, text to speech, AI object remover, PDF to Markdown, PDF to Word & Excel, HTML/URL to PDF, OCR, Office to PDF, PDF compressor, PDF merge/split, PDF password protect, PDF to image, image to PDF, bulk watermark, image converter and compressor, background remover, AI upscaler, image to SVG, QR code and barcode generators, QR/barcode reader, favicon generator, video compressor, frame extractor and audio converter. All pay per file, all batch-friendly: [toowl.my.id/en/api](https://toowl.my.id/en/api/).

Questions or a format that fails? Open an issue on the Actor's **Issues** tab.

# Actor input Schema

## `files` (type: `array`):

Direct links to digital PDFs (reports, invoices, bank statements, contracts). Scanned PDFs need the OCR Actor first.

## `output` (type: `string`):

Word keeps the text flow (paragraphs, fonts, bold/italic). Excel puts tables into cells, with numbers and dates as real values.

## `sheets` (type: `string`):

One sheet for the whole PDF (a table header repeated on every page is kept once), or one sheet per page.

## `convertNumbers` (type: `boolean`):

Turns 1.234,56 / 1,234.56, percentages and dates into real Excel numbers (decimal style detected per file), so formulas work.

## `maxPages` (type: `integer`):

Only the first pages are converted; each page is charged.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped with an error (not charged).

## Actor input object example

```json
{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/report.pdf"
    }
  ],
  "output": "docx",
  "sheets": "merge",
  "convertNumbers": true,
  "maxPages": 200,
  "maxFileSizeMb": 50
}
```

# Actor output Schema

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

One row per input PDF, with download links for the Word and/or Excel file.

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

Result files in the default key-value store, plus a SUMMARY record.

# 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 = {
    "files": [
        {
            "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/report.pdf"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("toowl/pdf-to-word-excel").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 = { "files": [{ "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/report.pdf" }] }

# Run the Actor and wait for it to finish
run = client.actor("toowl/pdf-to-word-excel").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 '{
  "files": [
    {
      "url": "https://raw.githubusercontent.com/chalidade/tools/main/apify/samples/report.pdf"
    }
  ]
}' |
apify call toowl/pdf-to-word-excel --silent --output-dataset

```

## MCP server setup

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

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/fbfxVl0V4MiBgCzsZ/builds/TredJhTere8FwdpHE/openapi.json
