PDFs, Scans & OCR

How to Make a PDF File Searchable (Free and Easy Methods)

By PageTranslate Team · · 4 min read

Here is how to make a PDF file searchable for free. Run OCRmyPDF on it with one command, then confirm the result.

ocrmypdf input.pdf output.pdf

That adds an invisible text layer under every page image, so the page looks the same and Ctrl+F, copy and paste now work. If you'd rather click than type, NAPS2 does the same job from a free desktop app, and both are covered below.

The step people skip is the language.. In my test a Spanish scan read with the default English setting came back with 85 percent of its words and 4 of 74 accented ones, and with -l spa it came back with 99.6 percent and 73 of 74. The command above is right only for English pages.

Translate a scanned PDF

Scans in six languages are read for you. Exact price before you pay.

Why some PDFs aren't searchable

A scanned PDF is usually just a stack of page pictures, so there are no characters to find. A searchable PDF carries an invisible OCR text layer lined up with each picture. The PDF specification calls the technique text render mode 3, "neither fill nor stroke", which is how OCR tools hide the words without changing how the page looks.

The quick test is to try selecting one sentence, or press Ctrl+F (Cmd+F on a Mac) and search for a word you can see. If nothing highlights, there is no text layer. My Spanish test scan gave 0 words from pdftotext before OCR.

The fastest free method, OCRmyPDF

OCRmyPDF is free software (MPL-2.0) that drives Tesseract. On a Mac, brew install ocrmypdf works, and Debian or Ubuntu has sudo apt install ocrmypdf, though the packaged version can lag. The batch OCR guide has the Windows commands and the rest of the install notes.

For other languages, name them with Tesseract's three-letter codes.

ocrmypdf -l spa input.pdf output.pdf
ocrmypdf -l eng+spa input.pdf output.pdf

The second form loads both packs for pages that mix the two. Four options come up constantly. --deskew straightens tilted pages, --rotate-pages turns sideways ones upright, --clean runs unpaper first (I didn't have it installed, so I can't vouch for it), and --sidecar writes the recognized text to a separate .txt file.

Terminal output. An image-only Spanish PDF gives 0 words. OCR with the English setting finds 0 of three accented test words, and with the Spanish setting finds 11.

Real run on the Spanish test page. The grep counts how many times daño, miró and había come out right.

OCR several PDFs at once

A loop does it for a folder.

mkdir -p searchable
for f in scans/*.pdf; do
  ocrmypdf --skip-text "$f" "searchable/$(basename "$f")"
done

--skip-text leaves pages that already have text alone, which stops a mixed folder from failing with exit code 6. The OCRmyPDF docs recommend GNU Parallel for bigger jobs, with -j 2 because both tools want every core. The full walkthrough, with logs, exit codes and a failure playbook, is in batch OCR PDF.

A free app instead, NAPS2

NAPS2 8.4.0 is free (GPL-2.0-or-later) and runs on Windows, macOS and Linux. It suits occasional files and anyone who likes seeing the pages. It uses Tesseract as well.

  1. Open NAPS2 and click Import, then choose the PDF.
  2. Click OCR. The first time, it offers to download the language you need.
  3. Tick Make PDFs searchable using OCR and pick the language from the menu. The mode setting trades speed for accuracy.
  4. Click Save PDF and give the result a new name.
NAPS2 window with two imported pages and the OCR Setup dialog open. Make PDFs searchable using OCR is ticked and the language is Spanish.

NAPS2 8.4.0 on Linux, with the Spanish test pages imported.

The same file saved through NAPS2's window and through its command line (naps2 console -n 0 -i scan.pdf -o out.pdf --ocrlang spa) both gave 513 words, and the result matched OCRmyPDF's Spanish accuracy at 99.6 percent. According to its docs, NAPS2 only OCRs pages that have no text, so a mixed PDF keeps the good pages as they are.

Can't Search a Scanned PDF? Make It Searchable for Free · Bootable USBs, 2026 · Watch on YouTube

Check that the PDF is really searchable

Open the saved copy and search for a distinctive word from the page. Then select a paragraph, paste it into a text editor and read it. Accented letters, numbers, names and small print are where OCR slips first, so check those on purpose.

For a batch, sample several files, since the first one proves little. One line shows words per file, and a zero stands out.

for f in searchable/*.pdf; do echo "$(pdftotext "$f" - | wc -w) $f"; done | sort -n

Fixing poor OCR results

Tesseract's own advice on image quality is to scan at 300 dpi or more, with dark text on a light background, and to remove noise and straighten skewed pages. Rescanning beats every setting, and in my earlier batch test no amount of cleanup rescued a page I'd degraded to about 70 dpi.

Match the language setting to the page, because that was the biggest single gain in my test. Try --deskew for tilted scans, and re-run the failures with different options while keeping a log of what failed. Handwriting, very small type and badly damaged pages may still need a human to type them in.

Bar chart of one Spanish page read four ways. English setting 85.1 percent of words, Spanish setting 99.6, English plus Spanish 99.4, NAPS2 Spanish 99.6.

Same page, four settings. Under the English setting, daño came out as dafio and miró as mir6.

Make a scan searchable before translating it

OCR makes text selectable, which makes easier to extract, quote, review and reuse. A reasonable order is to scan, run OCR, check the text, then translate.

You don't have to OCR first for PageTranslate. It reads scanned PDFs in English, French, German, Italian, Portuguese and Spanish itself, and the PDF translator page covers what comes back. Long scans are handled in translating large PDFs, and the security page says how uploads are treated. I haven't tested whether pre-OCR changes the translation, so I won't promise a gain. Make the searchable copy when you want it for your own archive, and keep the original too. For whole books, there is the book translation page, the wider document translation software page lists every supported format, and turning a scanned document into a PDF covers the scanning side.

Questions readers ask

FAQ

How do I make a PDF searchable without Adobe?

Run OCR yourself with a free tool. OCRmyPDF is a command-line program that adds a text layer under each page image, and NAPS2 is a free desktop app that does the same from a button. Both use Tesseract. On a Mac, Preview's File, Export, Embed Text option also writes recognized text into the PDF when no text was found before.

Can I make a scanned PDF searchable for free?

Yes. NAPS2 (GPL-licensed, for Windows, Mac and Linux) and OCRmyPDF (MPL-2.0, command line) are free. Free upload sites exist too, but they send your file to someone else's server, which is worth thinking about for contracts, medical records or unpublished manuscripts.

Why is my searchable PDF still showing wrong words?

OCR guesses from pixels, so blur, low resolution, skew, noise and the wrong language setting all produce wrong words. In our test, a Spanish page read with the English setting recovered 85 percent of its words and 4 of 74 accented ones, and with the Spanish setting 99.6 percent and 73 of 74. Rescan at 300 dpi, match the language and compare against the page for numbers and names.

Can I OCR a PDF in another language?

Yes, as long as the language pack is installed. OCRmyPDF takes -l with three-letter codes, such as -l spa or -l eng+spa for mixed pages, and NAPS2 downloads languages from its OCR dialog. Tesseract ships with more than 100 languages, and it cannot detect the language for you, so you have to choose.