pdf2docx
Open source Python library converting pdf to docx.
What it is and what it does
pdf2docx is a Python library that converts PDF documents into editable Word (.docx) files. It uses PyMuPDF for PDF parsing and python-docx for document generation, with additional support for table extraction and layout analysis via opencv-python-headless and numpy. The library provides both programmatic and command-line interfaces for conversion tasks.
The project was originally maintained by Artifex but is now community-driven under the MIT license. It depends on several image processing and document manipulation libraries to reconstruct PDF content as structured Word documents. Users should be aware that active maintenance has transitioned to the community, and the description suggests considering PyMuPDF directly for more comprehensive PDF processing needs.
Use it for:
- Convert scanned or digital PDFs to editable Word documents for further editing
- Extract tables from PDF reports and import them into Word format
- Batch-convert multiple PDFs to .docx for document management workflows
- Automate PDF-to-Word conversion in document processing pipelines
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts PDF files to Word documents (.docx format), with support for extracting tables and preserving layout and formatting.
Yes, with conditions. The library is straightforward to install and suitable for basic PDF-to-Word conversion tasks. However, be aware that active maintenance has ended and the project is now community-supported. If you need robust, actively-maintained PDF handling, the description recommends PyMuPDF as an alternative. No known security vulnerabilities are reported.
Install
pdf2docx on PyPI
pip
pip install pdf2docxuv
uv add pdf2docxpoetry
poetry add pdf2docxInstalling pdf2docx
Before you install
Low friction installation with a pure-Python wheel. Maintenance is active, though the project description notes it is no longer actively maintained by Artifex and relies on community contributions.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install pdf2docx
from pdf2docx import Converter
converter = Converter('input.pdf')
converter.convert('output.docx')
converter.close()
Requires Python >= 3.10. opencv-python-headless requires a system with image processing libraries available.
Verify before relying
- Conversion quality and accuracy across different PDF types and layouts
- Performance characteristics on large or complex PDF documents
- Extent of table extraction accuracy and edge-case handling
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — PyMuPDF, python-docx, fonttools, numpy, opencv-python-headless, fire |
| Maintenance | actively maintained — 105 days since the last release |
| First released | |
| Downloads | 1,151,092/month — #4,297 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pdf2docx-0.5.13-py3-none-any.whl
Keywords: pdf-to-word, pdf-to-docx
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
html2docxConverts valid HTML to Microsoft Word (.docx)…
permissive · top 15,000 on PyPI
docx2pdfConverts DOCX files to PDF on Windows or macOS…
permissive · top 5,000 on PyPI
pymupdfproPyMuPDF Pro extends PyMuPDF with commercial…
unclear · top 15,000 on PyPI
html-for-docxConverts HTML content to Word documents…
permissive · top 15,000 on PyPI
doclingDocling parses diverse document formats—PDF,…
permissive · top 5,000 on PyPI
docx2txtExtracts text, headers, footers, hyperlinks,…
unclear · top 5,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
aspose-wordsAspose.Words for Python is a document…
unclear · top 15,000 on PyPI
doc2docxConverts legacy .doc files to modern .docx…
permissive · top 15,000 on PyPI
htmldocxConverts HTML content into Microsoft Word…
permissive · top 5,000 on PyPI