The code is on GitHub.
The problem#
Getting text out of a PDF sounds easy, but it gets harder once the PDF runs to hundreds of pages. The free online tools I tried either timed out or failed partway through large files, and the ones that coped wanted a monthly subscription for something I only needed occasionally.
I was also uneasy about trust. Uploading a document to a converter means handing a copy to a company you know nothing about, to be stored for an unknown time on servers you can’t see. That might not matter for a public report, but it does for contracts, statements or anything with personal details.
I wanted to drop in a PDF, get an editable Word document back, and have nothing leave my machine.
What I built#
A small web app that runs on my own computer. Double-click a desktop shortcut and it starts a local server and opens a page in the browser. You drag a PDF onto the page, and a few seconds later a Word document downloads.

The page looks like any website, but its address is localhost, meaning your own computer, so the file goes from your browser to a program on the same machine and back again.
How it works#
graph LR
A[Drop a PDF
on the page] --> B[Local server
saves a temp copy]
B --> C[Read the text
page by page]
C --> D[Write a
Word document]
D --> E((Download,
temp files deleted))
- Upload, locally. The page sends the PDF to a small Python server (built with Flask) running on the same computer, with a progress bar while it goes. It accepts files up to 1 GB.
- Read the text. PyMuPDF, a fast open-source PDF library, opens the file and pulls out the text one page at a time.
- Write Word. python-docx builds a Word document, one section per PDF page with a page break between them.
- Download and tidy up. The Word file downloads with the same name as the PDF, and the temporary copies are deleted.
A small PowerShell script puts a “PDF Converter” icon on the desktop, so starting it is a double-click rather than a command.
How well it works#
When I came back to the project for this write-up, I tested it with some generated PDFs.
| Test | Result |
|---|---|
| 3-page text PDF | Converted instantly |
| 2,000-page PDF, 644,000 words | Converted in about 4 seconds |
| A file that isn’t a PDF | Rejected with a clear message |
| A scanned page (text only in an image) | No text, now with a warning |
The speed surprised me after my experience with the online tools. On a laptop, a library like PyMuPDF reads thousands of pages in seconds, so I suspect the online converters were held back by uploads, queues and free-tier limits rather than by the conversion itself.
There are a few things it doesn’t do:
- Text only. Images, tables and formatting don’t come across. You get the words, in reading order, page by page. That was exactly what I needed, but it isn’t a layout-perfect conversion.
- No scanned documents. A scanned PDF stores each page as a picture, so reading it needs OCR (optical character recognition), which this tool doesn’t do.
- No locked files. Password-protected PDFs fail.
What I fixed on the way#
Testing it again turned up three things that didn’t match the promise of “nothing leaves your machine”.
- Leftover copies. On Windows, the converted Word file was supposed to be deleted after download, but the app tried to delete it while it was still being sent, and Windows refused. Every conversion left a copy in the temporary folder. It now sends the document from memory and deletes both temporary files every time, even if a conversion fails.
- Silent empty files. A scanned PDF produced a blank Word document with no explanation. It now says that no text was found and that the PDF may be scanned.
- A call to Google. The page loaded its font from Google Fonts. Your PDF never went there, but the page did contact Google each time it opened. It now uses the computer’s own fonts and makes no outside requests at all.
None of these were dramatic, but for a tool whose whole point is privacy they were worth fixing.
Try it yourself#
- Download the code from GitHub and put the folder at
C:\Projects\dev\pdf-to-text, or update the paths in the shortcut script. - Set it up in a terminal in that folder:
python -m venv venv, thenvenv\Scripts\activate, thenpip install -r requirements.txt. - Add the shortcut by right-clicking
create_shortcut.ps1and choosing Run with PowerShell. - Double-click “PDF Converter” on your desktop and drop in a PDF.
Key takeaways#
- A small tool was enough. A few hundred lines of code did the job I’d been looking at subscriptions for.
- Private documents are better converted locally. If a job can run on your own machine, there’s little reason to send your files anywhere.
- The conversion itself is fast. A 2,000-page PDF took about four seconds, so the slowness I’d seen online wasn’t down to the work involved.
- It’s worth testing your own privacy claims. I only found the leftover copies and the call to Google because I went back and checked.
If I return to it, the most useful addition would be OCR, so that scanned documents can be converted too.

