How to Search for Words Within Files on Windows 11

To search for words inside files on Windows 11, open the folder in File Explorer, click the search box at the top right, and type content: followed by your words, such as content:"invoice number". Press Enter, and File Explorer lists the files whose text contains that phrase, not just files with matching names.

These steps are for File Explorer in Windows 11 versions 24H2, 25H2 and 26H2. Content search works best in indexed folders, like Documents and Desktop. For other folders, turn on the File Explorer option in the second section so Windows reads file contents there too.

Search File Contents in File Explorer

  1. Press Windows key + E to open File Explorer.
  2. Go to the folder that holds the files, such as Documents or a project folder. Starting in a specific folder is faster than searching the whole PC, and File Explorer searches its subfolders too. If you don’t know the folder, open This PC. Microsoft notes that searching from This PC is slower than searching from Home but more thorough.
  3. Click the search box at the right end of the address bar, or press Ctrl + E. It says Search followed by the folder name.
  4. Type content: and then the word or phrase. Put a phrase in straight quotation marks so Windows looks for those words together, for example content:"quarterly budget". For a single word, content:budget is enough.
  5. Press Enter. Results appear as Windows finds them, and the green progress bar in the address bar fills while it searches.
File Explorer search box with a content: query and results
Type content: before your words to search inside files.
  1. Double-click a result to open it, then press Ctrl + F in that app to jump to the words. In Word, searching for a word in Microsoft Word covers the Find pane.

content: is the short form of the System.Search.Contents property in the Windows property reference. Typing System.Search.Contents:"quarterly budget" gives the same results. Without the content: prefix, File Explorer matches file names first, which is why a plain search often shows files that only have your word in the name.

You can combine it with other filters. For example, content:"quarterly budget" ext:.docx finds only Word documents containing that phrase, and content:budget datemodified:this week limits results to files you changed recently.

If you only need a file you opened lately, it is often faster to see your recent files in Windows 11 first.

To sort the results by details such as Authors or Date created, switch to Details view and add another column in File Explorer.

Use the Search Options Menu Instead

If you’d rather click than type operators, run any search in the folder first. A Search options button appears in the File Explorer toolbar. Click it, point to Advanced options, and click File contents so it has a check mark. Searches in that folder then include the text inside files.

Search Contents in Folders That Aren’t Indexed

Windows keeps a search index of common locations so it can search their text quickly. In a folder outside the index, such as a second drive or a downloaded archive, File Explorer only checks file names unless you change one setting.

  1. In File Explorer, click the See more (three dots) button in the toolbar and click Options. The Folder Options window opens.
  2. Click the Search tab.
  3. Under When searching non-indexed locations, check Always search file names and contents (this might take several minutes).
Folder Options Search tab in Windows 11 File Explorer
Turn this on to search text in folders outside the index.
  1. Click Apply, then OK.

Now repeat your content: search. It runs slower in non-indexed folders because Windows reads each file as it goes, so keep your starting folder as narrow as you can. Network drives and external drives are the slowest, since every file has to travel over the connection.

Add a Folder or File Type to the Search Index

For a folder you search often, adding it to the index makes content searches fast. The Windows search indexing guide explains the available options.

  1. Click Start, type Indexing Options, and open it. You can also get there from Settings > Privacy & security > Searching Windows (labeled Search on some versions) by selecting Advanced indexing options or Customize search locations.
  2. Click Modify, check the folder you want to add, and click OK. Windows starts indexing it in the background.
  3. To make sure a file type’s text is indexed, click Advanced, then the File Types tab.
  4. Select the extension, such as txt, docx, or pdf. Under How should this file be indexed?, choose Index Properties and File Contents.
File Types tab in Advanced Indexing Options
Set a file type to index its contents, not just its properties.
  1. Click OK, then Close.

A new folder can take a while to index, depending on how many files it holds. The Indexing Options window shows how many items are indexed and whether indexing is still running.

Classic or Enhanced Indexing

The Find my files setting on the Searching Windows page decides how much of the PC Windows indexes:

Setting What Windows indexes Best for
Classic Documents, Pictures, Music and the desktop, plus any folders you add Most people; less background work
Enhanced Your entire PC, including all user folders Files spread across many folders or drives

Enhanced gives more complete results but can use more system resources. With either setting, a file type set to properties only can be found by name but not by its contents. On Copilot+ PCs, Microsoft also adds semantic indexing, which runs on the PC and lets search match the meaning of your words, not only the exact text.

Which File Types Can Windows Search Inside?

Windows reads text from a file using a component called a filter, and it includes filters for plain text, Office documents, and most other common text-based formats. PDF content search depends on a PDF filter being installed. Adobe Acrobat Reader typically adds one; if PDFs don’t show up in content results, check the pdf entry in Indexing Options > Advanced > File Types.

Scanned PDFs and photos of documents are a different case. Their pages are images, so there’s no text for Windows to find until you run OCR (optical character recognition) on them in an app like Acrobat. Adobe’s text recognition guide covers how that works in Acrobat. A quick test: open the file and try to select a word. If you can’t highlight the text, Windows can’t search it either.

Password-protected documents are also skipped, because Windows can’t read what’s inside them. Files encrypted with Windows file encryption (EFS) are indexed only when Index encrypted files is checked in Indexing Options > Advanced.

If you’re not sure what kind of file you’re dealing with, show file name extensions so you can see .txt, .docx, or .pdf at the end of each name.

Search Text Files With PowerShell

For a folder of plain text files, such as logs, notes, or code, PowerShell searches every line without waiting for the index and shows exactly where the match is.

  1. Click Start, type PowerShell, and open Windows PowerShell.
  2. Type the command below, replacing the folder path and the phrase with your own, then press Enter.

Get-ChildItem -Path "C:\Users\YourName\Documents\Notes" -Recurse -Include *.txt | Select-String -Pattern "invoice number" -SimpleMatch

Each result shows the file path, the line number, and the line that contains the phrase. -Recurse includes subfolders, and -SimpleMatch treats your phrase as plain text, so symbols like periods and brackets aren’t read as search patterns. Matching ignores capitalization unless you add -CaseSensitive. To check several types at once, list them, as in -Include *.txt,*.log. The full list of options is in the Select-String reference.

This only works on plain text formats. Word documents and PDFs store text in a compressed or encoded form, so use File Explorer for those.

Search Text Files With Command Prompt

Windows also includes findstr, an older command that does the same job in Command Prompt.

  1. Click Start, type cmd, and open Command Prompt.
  2. Go to the folder, for example cd /d C:\Users\YourName\Documents\Notes, and press Enter.
  3. Type findstr /s /i /n /c:"invoice number" *.txt and press Enter.

Microsoft’s findstr reference explains the switches: /s searches subfolders, /i ignores capitalization, /n shows line numbers, and /c: treats the quoted text as one exact phrase. Without /c:, findstr invoice number finds lines with either word. Use /m instead of /n to list only the names of matching files. Like PowerShell, findstr reads plain text files only.

If Content Search Finds Nothing

  • You searched without content:. A plain search matches names first. Add content: before your words.
  • The folder isn’t indexed. Turn on Always search file names and contents in Folder Options, or add the folder in Indexing Options.
  • The file type is set to properties only. In Indexing Options > Advanced > File Types, switch that extension to Index Properties and File Contents.
  • Indexing hasn’t finished. Wait for the Indexing Options window to say Indexing complete, then search again.
  • The file is a scan, an image, or password-protected. Run OCR on scans first, as described above. Password-protected files can’t be searched.
  • The file won’t open either. If a file is damaged, on a disconnected network drive, or blocked by permissions, no search method can read it. Check that you can open it.
  • Search seems broken everywhere. In Indexing Options, click Advanced, then Rebuild. This can take hours on a large drive, so only do it when results are clearly wrong.

File Content Search Questions

Can I search inside files from the Start menu?

Start menu and taskbar search can find words inside indexed documents. Select the Documents tab at the top of the results to leave out apps, settings, and web results. File Explorer with content: is more precise because you choose the folder.

Does content search look inside ZIP files?

Not by default. Extract the files first, or turn on Include compressed files (ZIP, CAB…) on the Search tab of Folder Options.

Is content: case sensitive?

No. content:Budget and content:budget return the same results.

Why are some results files that don’t seem to contain my words?

Without quotation marks, Windows matches files that contain each word separately, anywhere in the file. Put the phrase in quotes to require the words together.

Can I use wildcards or regular expressions?

File Explorer doesn’t support regular expressions, which are pattern codes for flexible matching. PowerShell’s Select-String does when you leave out -SimpleMatch, and findstr supports a limited set.

If you search the same folder every week, add it to the index once so later searches come back in seconds. For more ways to get around, learn how to use File Explorer in Windows 11.