---
title: "Convert PDF to XLSX, DOCX & TXT API"
slug: convert-pdf-to-excel-word-txt
url: https://apyhub.com/martin10291/service/convert-pdf-to-excel-word-txt
provider: Martin Petrov
categories: [Ingestion Kit, Document Intelligence Kit, Output Kit]
tags: [pdf-conversion, document-conversion, ocr, pdf-extraction, excel-export, word-export]
auth: api_key
version: 1.0
service_type: sync
endpoints: 1
atoms: 100
mcp: true
---

# Convert PDF to XLSX, DOCX & TXT API

Scanned PDF to Excel API: send a text or scanned PDF and get back XLSX, DOCX or TXT output, with OCR in English, German or Bulgarian. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/martin10291/convert-pdf-to-excel-word-txt` | What it does Converts one PDF, or up to 10 PDFs, into an Excel, Word or plain text result. Text pag… | 100 |

## Endpoint reference

### PDF to Excel / Word API - tables and text out of PDFs

`POST https://api.eu.apyhub.com/martin10291/convert-pdf-to-excel-word-txt` · 100 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `files` | body | array of object | no | Use instead of fileContent to convert several PDFs in one call. Max 10 items, with 10 pages and 20 MB in total. If fileContent is also sent, all PDFs are converted. |
| `files[].fileName` | body | string | no | Name of this PDF. Example: `a.pdf`. |
| `files[].fileContent` | body | string | yes | This PDF as base64 or a data URI. Example: `JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqCjI…`. |
| `format` | body | string | no | Output format: xlsx (Excel), docx (Word) or txt (text returned in the JSON). One of: xlsx, docx, txt. Default: `xlsx`. Example: `xlsx`. |
| `fileName` | body | string | no | Name of the PDF, e.g. report.pdf. Used to name the output file. Default: file. Example: `sample.pdf`. |
| `language` | body | string | no | Language of the text on scanned pages, used by OCR. OCR reads up to 5 scanned pages per call. One of: eng, deu, bul, eng+deu+bul. Default: `eng`. Example: `eng`. |
| `onOneSheet` | body | boolean | no | Excel only. true puts all pages on one sheet; false gives one sheet per page. Default: `false`. Example: `false`. |
| `fileContent` | body | string | no | Required unless files is sent. The PDF as base64; a data URI is also accepted. Max 10 pages and 20 MB per call. Example: `JVBERi0xLjQKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZyAvUGFnZXMgMiAwIFIgPj4KZW5kb2JqC… |

#### Quickstart

Convert a local PDF to an Excel workbook (the default output).

```bash
curl -X POST "https://api.eu.apyhub.com/martin10291/convert-pdf-to-excel-word-txt" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"fileName": "sample.pdf", "fileContent": "'"$(base64 -w0 sample.pdf)"'"}'
```

#### What you'll get back

Returns a JSON object with `count` and `items`. For one PDF, the item holds the converted file as base64 in `fileBase64`, a preview of the extracted `rows`, and the number of pages converted in `stats`. For two or more PDFs, the item holds a `files` array with one output file per converted PDF.

```json
{
  "count": 1,
  "items": [
    {
      "columns": [],
      "fileBase64": "UEsDBBQAAAAIAPdBgV1Gx01IlQAAAM0AAAAQAAAA...",
      "fileName": "sample.xlsx",
      "mime": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
      "rows": [
        ["Invoice 2026-001 Example Ltd"],
        ["Total 120.00 EUR"]
      ],
      "stats": { "Pages done": 1 },
      "title": "sample.pdf converted to Excel"
    }
  ]
}
```

## About

## What it does
Convert PDF to XLSX, DOCX & TXT API is a scanned PDF to Excel API. Send a PDF and get back an XLSX workbook, a DOCX document or TXT text in one JSON response. It reads text PDFs directly and runs OCR on scanned pages.

Send the file as base64 in `fileContent` with its `fileName`, or send up to 10 PDFs in `files`. Choose the output with `format`: `xlsx` (default), `docx` or `txt`. Set `language` to match the text on scanned pages: `eng` (default), `deu`, `bul` or `eng+deu+bul`. In Excel output each page gets its own sheet. Set `onOneSheet` to `true` to put all pages on one sheet.

The response holds the converted file as base64, a preview of the extracted rows, and a page count. Teams use this scanned PDF to Excel API to move invoice and report tables into spreadsheets, turn scanned letters into editable Word files, and pull PDF text into search indexes.

Each call takes up to 10 files, 10 pages and 20 MB, counted across all files. Calls over these limits return a 400 error. OCR reads up to 5 scanned pages per call. For longer files, cut them into parts with the [Split PDF by Page Range API](https://apyhub.com/freedailypro/service/split-pdf-by-page-ranges) first. Shrink heavy scans with the [Compress PDF File API](https://apyhub.com/freedailypro/service/compress-pdf-file), or combine photos into one PDF with the [Merge Files to PDF API](https://apyhub.com/apyhub/service/merge-files-to-pdf) before you convert.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/martin10291/service/convert-pdf-to-excel-word-txt
