Tools,

Scanned PDF to Word, free, tested on 10 pages

1,875

of 1,955 words, in 46 paragraphs

Get the script

Three lines, one .docx

26 s for 10 pages, 2 cores

16 KB .docx, all text

  1. Install OCRmyPDF and pandoc once. I used uv tool install ocrmypdf and brew install pandoc.
  2. Save word.sh next to book.pdf.
  3. Run sh word.sh. It writes book.docx.
ocrmypdf --jobs 2 --mode force --output-type none --sidecar book.txt book.pdf -
perl -0pe 's/-\n(?=[a-z])//g' book.txt > joined.txt
pandoc joined.txt -o book.docx

OCRmyPDF reads the scan into plain text. The perl line joins words split at a line end. pandoc makes each block of lines one paragraph.

The scan as it is: 0 words

A scan is a picture of each page. Both converters kept the pictures and found no text at all.

10-page scan, no OCR, words in the .docx
Converter Words File
LibreOffice Writer 0 6.4 MB
pdf2docx 0 50.0 MB

So every route below starts with OCR.

OCRmyPDF, then Writer: 933 text boxes

OCRmyPDF puts hidden text behind each page picture. Writer's PDF import kept the pictures and split that text over 933 small text boxes.

Left: page 1 from Writer's import, a picture of the book page with one line of OCR text across the bottom. Right: page 1 from word.sh, plain paragraphs of text.
Page 1 of two .docx files, as LibreOffice draws them. Left: Writer's import, one OCR line over the picture. Right: word.sh.

The words are there, 1,771 in order. But a change to one sentence means a hunt through small boxes.

pdf2docx skips OCR text by default

pdf2docx ignores hidden text, so OCRmyPDF's PDF gave 0 words again. Its --ocr=2 setting reads only hidden text.

pdf2docx on OCRmyPDF's PDF, words in order
Setting Words What you get
Default 0 10 page pictures, 50.0 MB
--ocr=2 1,382 3 tables from plain prose, 14 pages
--ocr=1 Error No file

--ocr=1 stopped with this message:

OCR feature is planned but not implemented yet.

pdf2docx is MIT. It needs PyMuPDF, which is AGPL-3.0 or a paid Artifex license. If you ship it in a product, read those terms.

Text first: lines or paragraphs

The same OCRmyPDF text, with three different last steps:

The proofread pages have 38 paragraphs
Last step Words Paragraphs
LibreOffice 1,875 265
pandoc 1,864 46
perl, then pandoc 1,875 46

LibreOffice made each OCR line a paragraph. pandoc left 12 words split at line ends, like "Draw- ing". The perl line joined all 12, and 11 were right: "old-fashioned" became "oldfashioned".

What the .docx keeps

Our Actor's Markdown, into Word

Our Actor reads the scan in the cloud, with no install. pandoc turns its Markdown into a .docx:

curl -s -X POST "https://api.apify.com/v2/acts/brasspage~pdf-ocr-to-markdown/run-sync-get-dataset-items" \
  -H "Authorization: Bearer $APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"documentUrls": ["https://api.apify.com/v2/key-value-stores/sTnmNrGoSsi7tLQvs/records/anythingllm-mixed-11-pages.pdf"]}' \
  | jq -r '.[].markdown' > book.md
pandoc book.md -o book.docx
Same scan, words in order, of 1,955
Route Words Paragraphs
word.sh 1,875 46
Actor, then pandoc 1,874 45

The Actor joined the split words itself. It puts page numbers and running heads on lines of their own. It costs $0.006 a page.

How I tested it
  • Scan: the 10 pages of OCR in n8n, proofread Wikisource book scans, 1,955 true words.
  • Score: true words found in order in each .docx (the text of word/document.xml), with the scorer of the tessdata test.
  • Tools: OCRmyPDF 17.13.0 with Tesseract 5.5.4, LibreOffice 26.8.1.1, pandoc 3.13, pdf2docx 0.5.13 with PyMuPDF 2.1. Apple Silicon Mac, lowest priority, 2 cores, one run each.
  • I have no copy of Microsoft Word. LibreOffice drew each .docx to count pages and make the picture above.
  • The Actor: one real run, build 0.1.65, on November 12. Its file is the same 10 pages plus a 13-word typed cover page.
What I did not test
  • Microsoft Word, Google Docs and Adobe Acrobat.
  • Online converters.
  • Tables, forms, handwriting and languages other than English.
Sources

Two ways to skip the work

Run it yourself. Our Apify Actor turns scanned PDFs into Markdown, tables included.

Try the Actor

Or send us the scan. Tack, our AI, does the job for $29, up to 50 pages. First page free.

Get one page free

Questions people ask

Can I convert a scanned PDF to Word for free?

Yes. OCRmyPDF reads the scan and pandoc writes the .docx. On 10 book pages, the file had 1,875 of 1,955 words in order, in 46 paragraphs.

Why does pdf2docx find no text in my scanned PDF?

A scan holds pictures of pages, not text. After OCRmyPDF, pdf2docx still skips the hidden OCR text unless you add --ocr=2.

Does the .docx keep the page layout?

No. word.sh keeps the words and paragraphs only. Writer's PDF import keeps the page pictures, but it splits the text over 933 small text boxes.