Buy Now

Find files4 min read

How to search text inside PDFs on Mac, scanned ones too

Find a word in one PDF, across every PDF on your Mac, or in scans that have no text at all. What Preview, Spotlight and OCR can and can’t do.

Short answer

In one PDF, open it in Preview and press ⌘F. Across all your PDFs, type the words into Spotlight with kind:pdf, or into a Finder search window with a Kind is PDF rule. Scanned PDFs are pictures of pages, so nothing finds their words until text recognition (OCR) reads them. Findy does that for you on your Mac.

PDFs come in two kinds that look the same on screen. Most PDFs made by an app (an invoice from an online shop, a contract exported from Word, a boarding pass) contain real text. A PDF from a scanner, or a photo of a document saved as PDF, contains only images of pages. You can read the words, but your Mac can’t, and that difference decides which of the methods below will work.

Find a word in one PDF

Open the PDF in Preview and press ⌘F, or click the search field in the toolbar. Type the word and press Return. Preview lists every match in the sidebar with its page number, and ⌘G jumps to the next one.

If Preview finds nothing for a word you can clearly see on the page, you’re looking at a scan. Skip to scanned PDFs below.

Search across all your PDFs

Spotlight indexes the text in PDFs that have it. Press ⌘Space and type a phrase you remember, plus kind:pdf:

lease renewal kind:pdf

For a full list with no limit, use Finder. Press ⌘F, type the words in the search field, and add a rule with the + button: Kind is PDF. Add a Created date rule if you remember roughly when you got it. Click Save to keep the search as a Smart Folder.

Terminal can do the same with mdfind, which reads Spotlight’s index:

mdfind -onlyin ~/Documents 'kMDItemContentType == "com.adobe.pdf" && kMDItemTextContent == "*renewal*"cd'

The cd at the end makes the match ignore case and accents.

Why a PDF doesn’t show up

  • It’s a scan. There’s no text to index. This is by far the most common reason.
  • It’s only in iCloud. With Optimize Mac Storage on, the file on your Mac is a placeholder until you open it, and its text can’t be searched.
  • It’s locked. Some password-protected PDFs don’t let any app read their text without the password.
  • Spotlight skips the folder. Check Spotlight’s privacy list in System Settings for excluded folders or drives.

Make a scanned PDF searchable

A scan needs OCR: software that recognizes the letters in the page images and saves them as a hidden text layer under the picture. After that, Preview, Spotlight and every other tool can find its words.

  • Scan with OCR from the start. Most scanner and printer apps, and many iPhone scanning apps, have an option called “searchable PDF” or “text recognition”. Turn it on and new scans are searchable.
  • Adobe Acrobat (paid) has a Scan & OCR tool that adds a text layer to existing PDFs.
  • OCRmyPDF is free and runs in Terminal. Install it with Homebrew, then:
    brew install ocrmypdf
    ocrmypdf scan.pdf scan-searchable.pdf

Preview on its own doesn’t fix scans. On recent versions of macOS, Live Text lets you select words on a scanned page while it’s open, but nothing is saved into the file, so searching for those words later still finds nothing.

Careful with online OCR

Free websites that turn scans into text upload your file to someone else’s server. Scanned documents are often IDs, contracts, bank statements and medical letters. Use a tool that runs on your Mac.

Search PDFs and scans together with Findy

Findy reads the text in your PDFs, up to the first 50 pages of each, and keeps it in a search index on your Mac. For scans without a text layer, it recognizes the text on the first three pages with Apple’s on-device text recognition, which is where titles, names, dates and reference numbers usually are. You don’t have to convert anything: both kinds of PDF answer the same search.

  • pdfs from gmail last week
  • invoice acme
  • pdfs from last week over 5 mb
  • lease renewal

Each result shows the sentence where your words appear, so you can pick the right document without opening five of them. Findy also reads Word, Excel, PowerPoint, Pages, Numbers and Keynote files and the text in screenshots, and nothing is uploaded anywhere.

Questions

Can Spotlight search inside PDFs?

Yes, if the PDF has real text. Spotlight indexes it like any other document. It can’t search scanned PDFs until OCR has added a text layer.

How do I know if a PDF is scanned?

Search for a word you can see on the page with ⌘F in Preview. If Preview finds nothing, the page is an image. Scans also tend to be larger files and look slightly crooked or grey.

Does Preview have OCR?

Not in a way that changes the file. Live Text can read a scanned page while it’s open, but to make the PDF searchable you need an app that saves a text layer, such as your scanner’s software, Acrobat or OCRmyPDF.