How to search files by their content on Mac
Find a Word, Pages, Excel or text file on your Mac by a phrase inside it, with Spotlight, Finder’s Contents rule, Terminal or Findy.
Short answer
Open a Finder window, press ⌘F, and add a rule with the + button: Contents contains your words. Add Kind to narrow it to documents, presentations or spreadsheets. Spotlight (⌘Space) searches contents too, and mdfind does it in Terminal. Images and scans need text recognition first, which Findy does on your Mac.
Sometimes the only thing you remember about a file is a sentence in it: a clause from a contract, a name from a meeting note, a number from a spreadsheet. Searching by name is useless then. Your Mac can search the words inside files, as long as you know where to ask and what it can’t read.
Search contents in Finder
Finder’s search window is the most precise built-in tool, because it combines content with other rules and shows every match.
- Open a Finder window and press ⌘F.
- Choose This Mac, or the current folder if you know roughly where the file is.
- Click + on the right, open the first menu and choose Contents. Type your words in the field next to it.
- Click + again for more rules: Kind is Document or Presentation, Last modified date is within the last 3 months.
Typing straight into the search field works too. Finder searches names and contents together by default, so the list is just longer. If you pick “Name matches” in the menu that appears as you type, it ignores contents, which is the opposite of what you want here.
Search contents with Spotlight
Press ⌘Space and type a few words from the file. Spotlight matches them against the text it indexed from your documents, not just the names. A few things make it sharper:
- Narrow by kind:
roadmap kind:presentation,contract kind:pdf. - Combine words: Spotlight understands
AND,ORandNOTin capitals, as inproposal NOT draft. - Pick rare words. “Invoice” matches hundreds of files. The client’s name, a street or an order number matches three.
Search contents in Terminal
mdfind asks the same index Spotlight uses and prints every match with its full path:
mdfind -onlyin ~/Documents "quarterly budget"
For plain text files like notes, Markdown, CSV and code, grep reads the files directly, which also finds things in folders Spotlight skips:
grep -ril "quarterly budget" ~/Notes --include="*.md" --include="*.txt"
grep can’t look inside Word, Pages or Excel files. Those are zipped packages, and the words aren’t stored as plain text.
What content search can’t see
- Text in images. Screenshots, photos of whiteboards and scanned PDFs hold their words as pixels. See searching screenshots and searching scanned PDFs.
- Files that are only in iCloud. A file evicted by Optimize Mac Storage has to download before anything can read it.
- Folders and drives on Spotlight’s privacy list, and external drives that aren’t indexed.
- Formats without an importer. Spotlight reads text from most common formats, but files from some apps are a closed box to it.
Search inside documents, PDFs and images with Findy
Findy keeps its own index of the text in your files, on your Mac, and searches it together with the file’s kind, date, size and where it came from. It reads:
- Word, Excel and PowerPoint files, Pages, Numbers and Keynote, OpenDocument and RTF;
- PDFs, including the first pages of scans, which it reads with text recognition;
- plain text, Markdown and CSV;
- the words in screenshots and photos.
So one search can mix what’s inside a file with everything else you remember about it:
- presentations from last month
- spreadsheets budget 2026
- invoice acme
- documents from slack
Each result shows the passage that matched. Words are matched with their endings, so “invoices” finds “invoice”, and the same works in the 12 other languages Findy understands. It doesn’t read the old binary .doc, .xls and .ppt formats; Spotlight still does.
Questions
Does Finder search inside files?
Yes. A Finder search looks at names and contents together, and a Contents rule limits it to the words inside files. It uses the Spotlight index, so it has the same blind spots.
How do I search for an exact phrase on a Mac?
Use words that are unlikely to appear together anywhere else, and add more of them until the list is short. For plain text files, grep "exact phrase" in Terminal matches the phrase exactly.
Why can’t I find a word I can see in a document?
Most often the word is part of an image: a scan, a screenshot pasted into the document, or a logo. It can also be a file that is only in iCloud, or one in a folder Spotlight doesn’t index.