everyday mac tools

Search for a word across many PDFs at once on a Mac

· 6 min read

Open the folder in Finder, press Command-F, switch the search scope from This Mac to the folder, and type kind:pdf followed by your word. Finder lists every PDF in that folder and its subfolders whose text contains it. No extra software is needed, provided the PDFs hold real text. Scanned pages, password-protected files and files the Mac has not indexed are left out without any warning, and that is the part that catches people.

Search a folder of PDFs in Finder

  1. Open the folder that holds the PDFs.
  2. Press Command-F. A search bar appears with a scope row underneath: This Mac, and the name of the folder. Click the folder’s name.
  3. Type kind:pdf, a space, and the word: kind:pdf indemnity.
  4. For an exact phrase, use quotes: kind:pdf "notice period".

Subfolders are included. To narrow further, click the plus button at the right of the scope row and add a rule, such as Last modified date is within the last year. A rule set to Contents, contains, limits matches to the text inside files rather than their names. The Save button turns the whole search into a Smart Folder that stays current as PDFs are added.

If you always want searches to start in the folder you are looking at, open Finder, Settings, Advanced, and set When performing a search to Search the Current Folder. Search inside one folder only on a Mac has more on scope.

Spotlight (Command-Space) accepts the same kind:pdf query, but it searches the whole Mac and shows a short list. For a stack of documents, the Finder window is the better tool.

Find the word inside each result

Finder tells you which files match, not where. Select a result and press Space to check in Quick Look that it is the right document. Then open it in Preview and press Command-F: the sidebar lists the pages with a match, and Command-G steps to the next one.

Preview’s search works on the window in front, so it is the tool for finding the page, not for finding the file.

If you search the same stack again and again, such as a case bundle or a year of statements, it can be quicker to merge copies into one working PDF and search that once. Merge PDFs on a Mac without uploading them anywhere covers how. Keep the originals as they are.

The same search from Terminal

mdfind queries the Spotlight index directly and prints full paths, which is useful when you want the list in a file or a script:

mdfind -onlyin ~/Documents/Leases -interpret 'kind:pdf "notice period"'

Add -count to get only the number of matching files. Because it reads the same index, it finds exactly what Finder finds, no more. mdfind: searching a Mac from the Terminal goes further.

One thing that does not work is grep -r. Text inside a PDF is stored compressed, so a plain text search passes straight over it and reports nothing.

Why some PDFs never show up

A search that returns nothing has two possible meanings: the word is not there, or the file could not be read. These are the usual reasons for the second.

  • Scanned PDFs. A scan is a stack of pictures with no text to index. Preview may let you select words on screen, but that recognition is not saved into the file, so search cannot see it.
  • Password-protected PDFs. If a PDF needs a password to open, its contents are encrypted and the index has nothing to read. If the file is yours, remove the password from a copy first.
  • Files not indexed. New files take a moment to appear. Folders listed under Search Privacy in the Spotlight settings are skipped, and so are external drives with indexing turned off.
  • iCloud files that are not downloaded. A file showing a cloud icon is not on the Mac, so its text is not there to search. Control-click it and choose Download Now.
  • Text that is present but wrong. Some PDFs carry a damaged text layer. Copy a line from the page and paste it into TextEdit; if you get nonsense characters, search will never match the words you can see.
  • Phrases broken across lines. A phrase split by a line break or a hyphen may not match exactly. Search for one distinctive word instead.

A quick test before you trust an empty result: pick a word you can see on the first page of a file in that folder and search for it. If the file does not appear, the problem is the file, not your search term.

Make the stack searchable first

For a pile of scans, the lasting fix is to run OCR once so that every method above works from then on. Make a scanned PDF searchable on a Mac explains what OCR adds and how to judge the result.

Basalt includes Make Searchable among its eighteen PDF tools. The work happens on the Mac, in an engine that holds no network entitlement, so the documents are not uploaded anywhere, and each run writes a new file and leaves the original untouched. The same window has Merge for building a single working copy and Passwords for removing a password you know. It does not crack a password you do not have. Basalt is free for 24 hours with every tool, then $29 once for up to three Macs.

After OCR, check the quality before you rely on it. Search for something the software is likely to misread, such as a reference number, a date or an unusual surname, and confirm the file appears.

Questions

Why does Finder find a file when Preview finds nothing inside it? By default Finder matches names and details such as title, author and keywords, as well as page text. The word may be in the file name or its properties. Add a Contents, contains rule to match page text only.

Can I search PDFs on an external drive? Yes, if the drive is indexed. Run mdutil -s /Volumes/DriveName in Terminal to check. If indexing is off there, Finder falls back to file names only.

Does this search text in filled form fields or comments? Do not count on it. What gets indexed is mainly page text. If a detail matters, open the likely files and check by eye.

Is there a limit to how many PDFs Finder can search? Not a practical one. The search reads an index built in advance, so a folder of thousands of PDFs returns results about as fast as a folder of ten.