BookmarkFilesLocal files · one click

Guides › Find and replace text in multiple files on Windows

Find and replace text in multiple files on Windows

Updated October 31, 2026 · Written by the BookmarkFiles team

Updating a company name in fifty text files, fixing a changed web address, renaming a setting across a folder of configuration files: these jobs are tedious by hand and easy to get wrong in a hurry. Windows has no built-in tool for it, but several free options work well. Here is how each one does it and when to pick it.

Before you start

  1. Make a backup. Copy the folder first. A bulk replace can touch hundreds of files in a second, and most of these tools cannot undo it. See how to back up before you edit.
  2. Search first. Look at what you are about to replace. A short word may also appear inside longer words.
  3. Know the text encoding. If your files are not UTF-8, some tools can damage them. Read our encoding guide if you work with Korean, Japanese or Chinese files.

Option 1: Notepad++ (Replace in Files)

  1. Press Ctrl + Shift + F to open Find in Files, then switch to the Replace in Files tab if needed.
  2. Type the text to find and the text to replace it with.
  3. Set Directory to the folder and use Filters such as *.txt to limit the file types.
  4. Click Replace in Files and confirm. Notepad++ warns that this cannot be undone.

It supports match case, whole word and regular expressions. It is a strong choice for a whole folder.

Option 2: Visual Studio Code (Replace in Files)

  1. Open the folder with File → Open Folder.
  2. Press Ctrl + Shift + H.
  3. Enter the text to find and the replacement. VS Code lists every match grouped by file.
  4. Review the list. You can exclude individual matches or files, then replace one file or all of them.

The ability to preview each change before applying it is the main advantage. It also supports regular expressions and include or exclude patterns.

Option 3: PowerShell

For a folder of plain UTF-8 text files you can use a short script. This version keeps a .bak copy of every file and replaces text literally, not as a pattern:

Get-ChildItem -Path . -Filter *.txt | ForEach-Object {
  Copy-Item -LiteralPath $_.FullName -Destination ($_.FullName + '.bak')
  $text = Get-Content -LiteralPath $_.FullName -Raw -Encoding UTF8
  $text.Replace('old text', 'new text') |
    Set-Content -LiteralPath $_.FullName -Encoding UTF8 -NoNewline
}

Test it on a copy of the folder first. In Windows PowerShell 5.1, -Encoding UTF8 writes a byte order mark. Files in other encodings, such as EUC-KR, need a different approach. On macOS and Linux, sed -i.bak 's/old/new/g' *.txt does a similar job and keeps backups.

Option 4: BookmarkFiles (for files you already keep in a list)

If the files you want to change are ones you already use every day, BookmarkFiles can do the replace without opening a code editor:

  1. Add the files, then select the ones to change with Ctrl + click.
  2. Press Ctrl + H. Type the word to replace and the new word. The bar shows how many matches there are in the selected files and in all open files.
  3. Choose Replace for the selected files or Replace All for every open file. A window lists the number of matches per file before anything changes.
  4. Review a file or two, then press Save. Replaced text stays unsaved until you save.

It does not scan folders you have not added, and it matches text literally with options for case and whole words. Read more in the BookmarkFiles find and replace guide.

Which one should you use?

SituationGood choice
A whole folder, many file types, patternsNotepad++ or VS Code
You want to preview each changeVS Code
Repeated task you can scriptPowerShell (with backups)
A handful of files you already keep in one listBookmarkFiles

Frequently asked questions

Can I undo Replace in Files in Notepad++?

No. Notepad++ warns that a replace across files cannot be undone, which is why a backup comes first.

Does find and replace support regular expressions?

Notepad++ and VS Code do. BookmarkFiles matches the text you type literally, with options for match case and whole word.

How do I replace only whole words?

Turn on the whole-word option in the tool you use. Without it, replacing cat also changes category.

Is there a built-in Windows tool for this?

File Explorer search can find text in files, but it cannot replace it. You need an editor or a script for the replace step.

Related guides

Ready to try it? Open BookmarkFiles in Chrome or Edge on a desktop computer.