Windows has three ways to replace text: Find and Replace in most programs, batch renaming in File Explorer, and Find in Settings
The fastest method depends on what you are replacing. If you are changing words inside a document or email, use Find and Replace — it is built into Word, Notepad, Outlook, and most text editors. If you are changing file names, use the batch rename tool in File Explorer. If you are searching for text across your entire computer, use Windows Settings to find files and then open them to edit.
Each method works differently and takes a different number of steps. The most common one — Find and Replace in a document — takes about 30 seconds once you open the dialog.
Key Takeaways
- Find and Replace in Word, Notepad, or Outlook opens with Ctrl+H and lets you replace one word or phrase with another throughout a whole document in seconds.
- You can replace all instances at once or go through them one by one to make sure each change is correct.
- File Explorer's batch rename tool lets you change multiple file names at the same time by finding a common word and replacing it in all selected files.
- Windows Settings search finds text across your computer, but you have to open each file separately to edit it.
Find and Replace in Word, Notepad, and Outlook
Open the document or email you want to edit. Press Ctrl+H on your keyboard. A dialog box titled "Find and Replace" will open.
Type the word or phrase you want to find in the "Find what:" field. Type the replacement text in the "Replace with:" field. If you want to replace every instance at once, click "Replace All". If you want to check each one first, click "Replace" to change them one at a time — the program will move to the next match after each click.
When you are done, close the dialog by pressing Escape or clicking the X button. Save your document with Ctrl+S.
Replace text in Notepad and other text editors
Notepad, VS Code, Sublime Text, and most other text editors use the same Ctrl+H shortcut. The steps are identical: open the file, press Ctrl+H, type what you want to find and what you want to replace it with, then click Replace All or Replace.
Some editors like VS Code show a count of how many matches were found before you click Replace All. This is useful if you want to make sure you are not replacing something by accident. If the count looks wrong, press Escape and check your search term.
Batch rename files in File Explorer
Open File Explorer and go to the folder containing the files you want to rename. Select the first file you want to rename by clicking it once. Hold Ctrl and click each other file you want to rename — they will all highlight in blue.
Right-click one of the selected files. A menu will appear. Click "Rename". A text box will open showing the name of the first file. Type the new name. Press Enter. Windows will rename all selected files, numbering them automatically (for example, "Document (1)", "Document (2)", "Document (3)").
If you want more control over the names, use a third-party tool like Bulk Rename Utility or Advanced Renamer, which let you find and replace text in file names the way Find and Replace works in documents. These are free programs you can read from their websites.
Search for text across your entire computer
Click the Windows Start button and type the word or phrase you are looking for. Windows will search your Documents, Desktop, Downloads, and indexed folders. Results will show file names that match, but not text inside files.
To search inside files, open File Explorer, go to the folder you want to search, and type your search term in the search box in the top right corner. Windows will find files that contain that text, but again, you will have to open each file to edit it. This method is slower than Find and Replace if you know which document contains the text.
Replace text in PDF files
Most PDF readers do not let you edit text directly. If you need to replace text in a PDF, you have two options: convert the PDF to Word first, or use a dedicated PDF editor.
To convert to Word, open the PDF in Microsoft Edge, click the three dots in the top right, select "Edit PDF", then save it as a Word document. You can then use Find and Replace as normal. To use a PDF editor, read a free program like PDFtk or use an online tool — search "free PDF editor" to find current options.
Replace text in Google Docs and online documents
Open your Google Doc or online document. Press Ctrl+H. A Find and Replace panel will open on the right side of the screen. Type what you want to find and what you want to replace it with, then click "Replace all" or step through each match with the arrow buttons.
The steps are the same in OneDrive documents, Sheets, and most cloud-based editors. The keyboard shortcut Ctrl+H works in nearly every text-based program on Windows.
Frequently Asked Questions
What if I want to replace text but keep the original capitalization?
In Word and most editors, click "More Options" or "Advanced" in the Find and Replace dialog. Look for a checkbox labeled "Match case" and make sure it is unchecked. This tells the program to find "the", "The", and "THE" all at once. If you check "Match case", it will only find exact matches.
Can I undo a Replace All if I made a mistake?
Yes. Press Ctrl+Z when ready after clicking Replace All. This will undo the entire replacement. If you have already saved the file, undo may not work — this is why it is safer to click "Replace" one at a time if you are unsure about the change.
How do I replace text in multiple files at once?
Most text editors like VS Code and Sublime Text have a "Replace in Files" feature. Open the Find and Replace dialog, look for a button or option that says "Replace in Files" or shows a folder icon, select the folder you want to search, then click Replace All. This searches and replaces across every file in that folder at once.
Why does Find and Replace not work in some programs?
Some programs like web browsers and email clients do not support Find and Replace — they only support Find (Ctrl+F). If Ctrl+H does not open a dialog, try copying the text into Notepad, making the replacement there, and copying it back.
Can I use Find and Replace to find line breaks or special characters?
Yes, but the method varies by program. In Word, click "More Options" and then "Special". You will see a list of special characters like paragraph marks, tabs, and line breaks. In Notepad and most text editors, you can type special codes like \n for a new line or \t for a tab, but you have to enable "Regular expressions" first in the settings.