PDF to DOCX API
Convert PDFs to editable DOCX preserving layout, text, images, and tables with password, page ranges, layout mode, and OCR.
PDFs are great for sharing documents and terrible for editing them. When the data your application needs is locked inside a PDF - a contract to revise, a report full of tables, a deck to update - you need to convert it back into an editable format programmatically.
This guide shows how to convert PDF to Word, Excel, and PowerPoint files with a REST API: PDF to DOCX for editable documents, PDF to XLSX for extracting tables into spreadsheets, and PDF to PPTX for presentations - including scanned PDFs via built-in OCR.
curl -X POST https://v2.convertapi.com/convert/pdf/to/docx \
-H "Authorization: Bearer api_token" \
-F "File=@/path/to/document.pdf"
The response is an editable DOCX that preserves the original layout. Swap docx for xlsx or pptx in the URL and the same call produces a spreadsheet or a presentation.
The PDF to DOCX converter rebuilds the document so you can edit, amend, and share it without retyping anything. The Layout parameter controls how faithfully it follows the original:
flowing (default) - natural text flow that is easiest to editcontinuous - looser layout with fewer text boxesexact - pixel-faithful positioning when visual fidelity matters mostAnnotations can be carried over or skipped with the Annotations parameter, and PageRange converts only the pages you need (for example 1,5,7-10).
Tabular data locked in PDFs - invoices, financial reports, data sheets - becomes usable again once it lands in a spreadsheet. The PDF to XLSX converter detects tables and extracts them into rows and columns, with parameters built for real-world data work:
SingleSheet - combine every extracted table into one sheet instead of one sheet per tableIncludeFormatting - also carry over non-table content like images and paragraphs (off by default, so you get clean data)DecimalSeparator and ThousandsSeparator - resolve 1.250,00 vs 1,250.00 ambiguity when processing documents from different localescurl -X POST https://v2.convertapi.com/convert/pdf/to/xlsx \
-H "Authorization: Bearer api_token" \
-F "File=@/path/to/report.pdf" \
-F "SingleSheet=true"The PDF to PPTX converter turns each page into an editable slide - useful for reviving old decks that only survive as PDFs. Fonts can be embedded into the output so slides render identically on machines without the original fonts installed.
All three converters share the same OCR engine for image-based documents, controlled by OcrMode:
auto (default) - text-based pages are converted directly, and scanned pages go through OCRforce - OCR everything, useful when the embedded text layer is brokennever - skip OCR entirely for guaranteed-digital documentsSet OcrLanguage when your documents are not in English, and pass Password for protected files - both work across DOCX, XLSX, and PPTX targets.
pip install convertapiimport convertapi
convertapi.api_credentials = 'api_token'
convertapi.convert('docx', {
'File': '/path/to/contract.pdf',
'Layout': 'exact'
}, from_format = 'pdf').save_files('/path/to/editable')import convertapi
convertapi.api_credentials = 'api_token'
convertapi.convert('xlsx', {
'File': '/path/to/invoice.pdf',
'SingleSheet': True,
'DecimalSeparator': 'comma'
}, from_format = 'pdf').save_files('/path/to/data')Install the ConvertAPI .NET SDK from NuGet:
dotnet add package ConvertApiusing ConvertApiDotNet;
var convertApi = new ConvertApi("api_token");
var result = await convertApi.ConvertAsync("pdf", "docx",
new ConvertApiFileParam(@"C:\docs\contract.pdf"),
new ConvertApiParam("OcrMode", "auto")
);
await result.SaveFilesAsync(@"C:\docs\editable");
The same pattern works in PHP, Java, Node.js, Go, and Ruby - every SDK exposes the identical parameters.
We ran three real documents through the converters with default settings - no tuning - each matched to the format it is typically converted to. Every download below is an actual input or output of the API.
Word demo: a two-page operations report - headings, paragraphs, lists, and a data table - the kind of document you get as a PDF but need back in Word:

Excel demo: a one-page invoice with three tables - the classic table-extraction case:

SingleSheet=true to merge them)PowerPoint demo: a four-slide business deck that exists only as a PDF - the everyday case for PDF to PPTX:

Post the file to the pdf/to/xlsx endpoint. Tables are detected and extracted into spreadsheet rows and columns automatically. Use SingleSheet to merge them and DecimalSeparator to handle regional number formats. For scanned documents, OCR kicks in automatically.
Yes. OCR is built into all three converters and enabled by default (OcrMode=auto). Set OcrLanguage for non-English documents.
Yes. Pass the document password in the Password parameter with any of the three converters.
Yes. PageRange accepts single pages, ranges, and combinations like 1,5,7-10 on all three endpoints.
For DOCX you choose the trade-off yourself with Layout: flowing optimizes for easy editing, exact for visual fidelity. Try your own documents in the interactive demo on each converter page to judge the quality first-hand.
Converting PDFs back into editable Word, Excel, and PowerPoint files is a single HTTP call per format - with OCR, table extraction, and layout control handled by parameters instead of your own parsing code. Start with the PDF to DOCX, PDF to XLSX, or PDF to PPTX page - each generates a working code snippet for your language while you experiment.
Convert PDFs to editable DOCX preserving layout, text, images, and tables with password, page ranges, layout mode, and OCR.
Convert PDFs to Excel (XLSX) preserving tables, text, and layout with password, page ranges, locale separators, and OCR support.
Convert PDFs to editable PPTX preserving layouts, text, tables, and images with password, page ranges, font embedding, and OCR.