PDF to DOCX API — Free Tier + Pay-As-You-Go
Convert PDF to editable Word DOCX via API. pdf2docx layout reconstruction, automatic OCR pre-pass on scans, LibreOffice fallback.
What it does
The PDF to DOCX API converts a PDF into an editable Word document through `POST /v1/convert` with `targetFormat=docx`. The primary engine is pdf2docx, built on PyMuPDF, which reconstructs paragraphs, tables and images as native DOCX elements instead of dropping each page into a drawing canvas the way a naive PDF import does. Scanned PDFs are handled automatically, with no flag to set: before conversion the API runs pdftotext across the source, and when the text layer is effectively empty it runs the same Tesseract pipeline that backs the OCR tool to build one, then feeds the OCR'd PDF to pdf2docx.
Use `language=eng` — or a `+`-joined list such as `language=eng+fra` — to choose the model from the 17 installed language packs. The automatic OCR pre-pass is capped at 50 pages; longer scans convert directly and the job comes back with an explicit warning that text may be missing, which is the signal to run the OCR tool first and convert its output instead. pdf2docx is a layout reconstructor and it does give up on heavily overlapping layouts, so any failure falls through to LibreOffice's writer_pdf_import, which always returns a file but a far less editable one. There are no mode, page-range or layout-preservation switches — the pipeline chooses its own path per document.
Supported formats
Source formats (1)
Target formats (2)
- docx
- doc
Quick start
Every sample posts the job, then polls /v1/status/{jobId} until it finishes, with your API key in the X-Api-Key header. The parameter names below are the ones the endpoint actually accepts — anything else is dropped rather than rejected.
curl -X POST https://api.convertintomp4.com/v1/convert \
-H "X-Api-Key: ck_your_api_key" \
-F "file=@input.pdf" \
-F "targetFormat=docx"
-F "language=eng"import { readFileSync } from "node:fs";
import { ConvertIntoMP4Client } from "convertintomp4";
const apiKey = process.env.CIM4_API_KEY;
const client = new ConvertIntoMP4Client({ apiKey });
// Presigned direct-to-R2 upload, then queue the conversion.
const { jobId } = await client.uploadDirect(
readFileSync("input.pdf"),
"input.pdf",
"application/octet-stream",
{ targetFormat: "docx" },
);
// Poll until the job reaches a terminal state.
let job;
do {
await new Promise((r) => setTimeout(r, 2000));
job = await fetch(`https://api.convertintomp4.com/v1/status/${jobId}`, {
headers: { "X-Api-Key": apiKey },
}).then((r) => r.json());
} while (job.status !== "completed" && job.status !== "failed");
console.log("Download URL:", job.result?.downloadUrl);import time, requests
from convertintomp4 import Client
api_key = "ck_your_api_key"
client = Client(api_key=api_key)
# Presigned direct-to-R2 upload, then queue the conversion.
with open("input.pdf", "rb") as f:
job = client.upload_direct(
f, "input.pdf", "application/octet-stream", "docx"
)
# Poll until the job reaches a terminal state.
while True:
status = requests.get(
f"https://api.convertintomp4.com/v1/status/{job['jobId']}",
headers={"X-Api-Key": api_key},
).json()
if status["status"] in ("completed", "failed"):
break
time.sleep(2)
print("Download URL:", status.get("result", {}).get("downloadUrl"))Features
- pdf2docx (PyMuPDF) reconstructs paragraphs, tables and images as native DOCX
- Automatic OCR pre-pass when the source has no text layer — nothing to enable
- `language` selects the OCR model from 17 installed Tesseract packs
- Auto-OCR capped at 50 pages; longer scans convert directly with an explicit warning
- LibreOffice fallback on any pdf2docx failure, so a hard layout still returns a file
Pricing
From $9.99/mo (Pro) or $24.99/mo (Business) — or pay-as-you-go on the API plan.
Free tier: 5 conversions/day, 100 MB file size, no API key required (IP-gated). Pro $9.99/mo: 100/day (2,000/month), 2 GB files. Business $24.99/mo: 1,000/day (20,000/month), 10 GB files, GPU encoding, dedicated support.
See full pricing breakdown →Built for production
99.9% uptime SLA
Multi-region failover, transparent status page, 60-second response-time guarantee on Business.
Encryption + auto-delete
TLS 1.2+ in transit, AES-256 at rest. Files deleted after 1h / 24h / 7d depending on plan, or instantly via DELETE endpoint. See the security page.
~7s median latency
Most sub-100 MB jobs complete in 6-9 seconds. Webhook-driven async for heavier workloads; waitForJob for synchronous flows.
Frequently Asked Questions
How accurate is PDF to DOCX conversion?
Born-digital PDFs — exports from Word, InDesign or LaTeX — come through well because pdf2docx has a real text layer and structural hints to work from. Scanned PDFs are only as good as the OCR pass that precedes them, so resolution and skew matter more than anything else. Multi-column and heavily overlapping layouts are the weak spot, and there is no layout-preservation switch to trade off against; if pdf2docx cannot cope, the job silently falls back to LibreOffice and the output will be visibly less editable.
Do scanned PDFs work?
Yes, and there is nothing to switch on. The API checks the text layer with pdftotext, and when it is effectively empty it OCRs the document first and converts the OCR'd version. The only limit is length: scans over 50 pages skip the OCR pre-pass and convert directly, and the job returns a warning telling you to run the OCR tool separately and convert its output.
Are tables in the PDF converted to editable Word tables?
Yes — pdf2docx's table detector reconstructs row and column structure and emits native Word table XML with individually editable cells. Heavily nested or merged-cell tables can flatten, so check a sample before bulk-processing. Note that if pdf2docx fails and the LibreOffice fallback runs, table fidelity drops sharply — that path is a rendering import, not a structural one.
What about PDFs with custom fonts?
The output DOCX references fonts by name, so Word substitutes anything the reader does not have installed and the layout can shift. There is no font-embedding option on this endpoint — an `embedFonts` parameter would be dropped rather than rejected. If exact typography matters more than editability, keep the PDF.
Can the API convert encrypted PDFs?
Not in one call — the PDF-to-DOCX path never reads a `password` field. Decrypt first with `toolOperation=decrypt-pdf` and `password=<secret>` on a PDF target, then send the decrypted output through the conversion. Feeding an encrypted PDF straight in fails in the engine rather than producing usable output.
Related APIs
- MP4 to MP3 APIExtract MP3 audio from MP4 video programmatically. Per-job bitrate and sample rate, ID3 tag injection, fast remux mode.
- PDF to JPG APIRender PDF pages to JPG images programmatically. Per-page DPI, page-range selection, batch ZIP output, ImageMagick + pdftoppm pipeline.
- JPG to PNG APIConvert JPG to PNG with optional transparency, lossless compression, and EXIF preservation via API. Sharp-backed.
- MP4 to GIF APIConvert MP4 video to animated GIF programmatically. Per-job width, fps, palette mode, and start/end trim controls.
- DOCX to PDF APIConvert Word DOCX to PDF programmatically. LibreOffice-rendered with font fallback, headers/footers, and PDF/A archival output.
- HEIC to JPG APIConvert iPhone HEIC and HEIF photos to JPG via API. EXIF rotation, ICC profile, Live Photo frame selection.
Or browse the full catalogue of 23 API products →
Get an API key
Start integrating the PDF to DOCX API in five minutes. Read the docs, grab a key, and ship your first conversion before the trial coffee cools.