How-to 8 min read

How to Search File Contents on Windows

Search file contents on Windows with File Explorer, Indexing Options, findstr, and PowerShell — then when keyword search is not enough.

When you need to search file contents on Windows, you are usually looking for a phrase inside a PDF, Word doc, code file, or notes — not just a filename. Windows can do this with built-in tools. This guide covers File Explorer content search, Indexing Options, findstr, and PowerShell first. After that, we cover where keyword search breaks down and when semantic search helps.

This also covers the related query file search contents: same job, same tools.

When to search contents vs filenames

Filename search is fast when you remember budget_2025_final.xlsx. Content search is for when the name is useless but you remember a phrase inside the file. If you are still hunting by name, read how to search for a file on Windows first.

Turn on content search in File Explorer

File Explorer can search inside files, but only if Windows knows to index or scan file contents.

  1. Open File Explorer (Win + E).
  2. Go to the folder you care about (or This PC for a broader search).
  3. Click the search box in the top-right (or press Ctrl + F / Ctrl + E depending on your Windows build).
  4. Type your keyword.
  5. On the Search ribbon (Windows 10) or search options (Windows 11), make sure content search is allowed — not “file names only.”

If results only show filenames that match, content search is off or indexing is incomplete.

Windows 10 vs Windows 11 in Explorer

On Windows 10, the Search tab on the ribbon exposes Kind, Size, and Date filters while a query is active. On Windows 11, the ribbon is slimmer, but the same operators (content:, ext:, datemodified:) still work when typed into the search box. The index underneath is the same — differences are mostly UI, not capability.

Search scope matters

Searching content:invoice from This PC crawls or queries every indexed location on every drive. That is slow and noisy. Start in Documents, your project folder, or the drive letter you know (D:\Clients). Narrow scope is the single biggest speed win for content search.

Force a content search for one query

In the File Explorer search box you can use advanced query syntax:

content:"quarterly revenue"

That tells Windows to look for the phrase in file contents. Quotes help with multi-word phrases.

Other useful filters:

  • ext:.pdf content:invoice — PDF files containing “invoice”
  • kind:document content:budget — documents with that word
  • datemodified:this week content:contract — recently changed files with a keyword

Fix Indexing Options so content search works

Windows Search quality depends heavily on Indexing Options.

  1. Press Win, type Indexing Options, open it.
  2. Click Modify and include the drives/folders you actually search (Documents, Downloads, project folders).
  3. Click AdvancedFile Types.
  4. For each important extension (.pdf, .docx, .txt, .md, .xlsx), select Index Properties and File Contents.
  5. Click OK and let indexing catch up (minutes to hours on large disks).

If a folder lives on a network drive or is excluded, content search will miss it. External USB disks often need to be included explicitly.

What Windows actually indexes for content

Not every file type gets full content indexing out of the box. Plain text (.txt, .md, .csv, .log), Office Open XML (.docx, .xlsx, .pptx), and many PDFs with a text layer can be indexed. Older binary Office formats (.doc, .xls), email stores, and proprietary formats may only get properties (title, author) unless a filter handler exists.

To see what is configured on your PC:

  1. Indexing Options → AdvancedFile Types.
  2. Scroll to an extension and check whether Index Properties and File Contents or Index Properties Only is selected.

If .pdf shows “Properties Only,” your content: queries against PDFs will miss body text even when Adobe can search inside the open file.

Rebuild the index when results look wrong

  1. Indexing Options → AdvancedRebuild.
  2. Leave the PC plugged in; rebuilding can take a long time on large libraries.
  3. Until rebuild finishes, search results may be incomplete — that is normal.

Search file contents with findstr (Command Prompt)

For text-based files, findstr is fast and scriptable.

Open Command Prompt in the folder you want to search, then:

findstr /s /i /m /c:"api key" *.*

What the flags mean:

  • /s — recurse into subfolders
  • /i — case-insensitive
  • /m — print only filenames that match
  • /c:"…" — search for a literal string

Limit by extension:

findstr /s /i /m /c:"TODO" *.py *.ts *.js

findstr is excellent for code and plain text. It is a poor fit for binary Office formats and most PDFs unless you have already extracted text.

findstr tips for real projects

Limit extensions to avoid scanning binaries:

findstr /s /i /m /c:"password" *.env *.config *.json *.xml

Redirect long hit lists: findstr /s /i /m /c:"deprecated" *.cs > hits.txt

Search file contents with PowerShell

PowerShell can scan text files with more control:

Get-ChildItem -Recurse -Include *.txt,*.md,*.csv,*.log |
  Select-String -Pattern "connection string" -SimpleMatch |
  Select-Object Path, LineNumber, Line

For a simple “which files contain this?” list:

Select-String -Path .\*.md -Pattern "offline search" -SimpleMatch -List |
  ForEach-Object { $_.Path }

Tips:

  • Narrow -Include / -Path so you do not scan your entire user profile by accident.
  • Prefer -SimpleMatch for literal phrases; use regex only when you need it.
  • For huge trees, pipe through Where-Object or search one project folder at a time.

PowerShell: search with context lines

Get-ChildItem -Path .\src -Recurse -Include *.py,*.ts |
  Select-String -Pattern "TODO" -Context 2,2

-Context 2,2 shows two lines before and after each match.

Search inside Office documents and PDFs with built-in tools

Word / Excel / PowerPoint: open the file and use Ctrl + F. That only searches the open file, not your whole disk.

Microsoft 365 / OneDrive: cloud search can find content across synced files — but that is cloud-dependent and not the same as a local offline index.

PDF: Edge and Adobe Reader can search inside an open PDF. For many PDFs at once, Windows Search content indexing (above) is the built-in path. Scanned PDFs without OCR will not match text queries at all — the “text” is only pixels.

Search many Office files without opening each one

If Indexing Options is configured correctly, Explorer is the batch path:

content:"statement of work" ext:.docx

in your contracts folder returns every Word file whose indexed body contains that phrase. No macros, no upload.

If indexing is broken on a work PC, Agent Ransack (free for personal use) and similar tools can grep inside Office archives without relying on the Windows index. That is still keyword search — just a different engine reading file bytes directly.

Email and Outlook

Outlook has its own search for mailboxes. For attachments saved to disk, treat them like any other file in that folder.

A practical workflow that actually works

  1. Start in the most specific folder you can (not This PC).
  2. Try content:"exact phrase" in File Explorer.
  3. If nothing appears, check Indexing Options for that folder and file type.
  4. For code or logs, switch to findstr or PowerShell.
  5. For a single known PDF/DOCX, open it and use in-app find.

That covers most day-to-day file search contents needs without installing anything.

Example: find a clause across a client folder

You remember “limitation of liability” but not which contract revision had it.

  1. Open D:\Clients\Acme\Contracts.
  2. Search: content:"limitation of liability" ext:.docx.
  3. If zero hits, check Indexing Options for .docx content indexing.
  4. Still zero? Try findstr on any .txt exports, or open the two most recent drafts and use Ctrl + F.
  5. If the clause used different legal wording (“cap on damages”), keyword search will not connect the dots — that is where semantic search enters.

Where built-in content search falls short

Keyword content search fails in predictable ways:

  • You remember the topic (“vendor liability clause”) but not the words the document used.
  • Filenames are useless (scan_0031.pdf, Document(3).docx).
  • Photos and screenshots have no searchable text.
  • Scanned PDFs were never OCR’d.
  • Indexing is slow, broken, or excludes the folder you need.
  • The same idea appears as “Q3 results,” “third quarter,” and “Jul–Sep revenue” — three different keyword searches.

Windows Search, findstr, and PowerShell are all literal. They match strings, not meaning.

When semantic search helps (offline)

PixaFind is local semantic search: it indexes meaning so you can ask for concepts, not just keywords. It runs offline — your files stay on your machine.

Use it when you would otherwise open ten files guessing which one matches. Keep Everything-style filename tools for “I know it is named invoice-acme-2025.pdf.” For a broader tool landscape, see our best Windows file search software roundup.

Related guides: how to search for a file on Windows, search files in Windows 10, and Windows file search not working.


FAQ

Does Windows Search search inside PDFs and Word files?
Yes — if Indexing Options indexes file contents for those extensions and the folder is included. Scanned PDFs without text layers still will not match.

What is the fastest built-in way to search file contents in a code folder?
Use findstr or PowerShell Select-String from that folder. They skip the Windows index and scan text files directly.

Why does content: return nothing?
Common causes: content indexing disabled for that file type, folder excluded from the index, index still rebuilding, or the phrase simply is not in the file.

Is searching file contents on Windows private?
Local File Explorer, findstr, and PowerShell stay on your PC. Cloud features (OneDrive web search, Copilot with upload) are a different trust model — prefer local tools when privacy matters.

Can I search inside .zip or .7z archives with built-in tools?
File Explorer does not search inside compressed archives by default. Extract the archive, or use a dedicated archive tool with search.

Does search respect file permissions?
Yes. If your user account cannot read a file, search will not surface its contents.