Bulk & Automation

How to Rename Part of a Filename in Multiple Files

Sometimes you do not want to rebuild filenames from scratch, you just want to change one part of them across a whole folder: strip the IMG_ prefix off a batch of photos, swap the word copy for final in a set of drafts, fix .jpeg to .jpg, or lowercase everything. That is a find-and-replace job, and the right tool depends entirely on what you are replacing. This guide covers the free options (Windows PowerToys PowerRename, Bulk Rename Utility, Advanced Renamer, macOS Finder, and the command line), gives you the regex snippets for the common cases, and lays out a decision rule so you pick the right one the first time.

What Find-and-Replace Renaming Actually Means

Renaming part of a filename means leaving most of the name alone and changing one substring across many files at once. The four jobs that cover almost every case are: remove a fixed prefix or suffix (IMG_1234.jpg becomes 1234.jpg), swap one word for another (report copy.docx becomes report final.docx), change an extension (photo.jpeg becomes photo.jpg), and normalize casing or spacing (My Photo.JPG becomes my_photo.jpg).

The dividing line that decides your tool is simple. If you are replacing one exact, literal string, almost any renamer will do it and you want the one with the least friction. If the thing you are matching is a pattern rather than a fixed string (remove everything before the first underscore, match any four digits, lowercase only the extension), you need a tool with regex. Pick the tool for the kind of replacement, not out of habit.

Windows PowerToys PowerRename: the simple default

If you are on Windows, PowerRename is the one to reach for first. It ships free as part of Microsoft PowerToys and installs straight into File Explorer, so you select files, right-click, and choose PowerRename. The dialog is two fields, Search for and Replace with, plus a live preview pane that shows the new names before you commit, which means you never rename blind.

For a literal swap it is instant: put copy in Search for, final in Replace with, and every report copy.docx becomes report final.docx in the preview. To delete a prefix, put IMG_ in Search for and leave Replace with empty, and IMG_1234.jpg becomes 1234.jpg. There is a checkbox to flip on regular expressions when you need a pattern instead of a literal string, and options for case sensitivity and matching only the filename versus the extension. It is the simple default because it does 90% of these jobs with zero learning curve and a preview you can trust.

Bulk Rename Utility: for heavy or complex replacements

When PowerRename is not enough, Bulk Rename Utility is the free Windows workhorse. Its interface is famously dense, a single window packed with a dozen numbered panels, but that density is the point: it exposes a Replace panel with full regex support, a separate case panel, an extension panel, and a live preview column, all at once, so you can stack several transformations in one pass over tens of thousands of files.

Use it when the replacement is conditional or you are chaining changes, for example strip a prefix, lowercase the result, and fix the extension in a single apply. In the Replace panel you type what to find and what to replace, tick Regex, and the preview column updates live. It is overkill for a one-word swap, but for a large or multi-step find-and-replace nothing free on Windows beats it.

Advanced Renamer: the cross-platform pick

Advanced Renamer runs on both Windows and Mac, which makes it the answer when you need the same replacement workflow on either operating system. It works on a method-stack model: you add a Replace method (with an optional regex toggle), see the results in a preview list, and can save the method list as a reusable batch for the next time the same rename comes up.

For a literal swap you add one Replace method, type the old and new text, and apply. For a pattern you enable regex in the same method. It sits between PowerRename and Bulk Rename Utility in power, and its cross-platform reach plus saved batches are the reason to choose it over a Windows-only tool.

macOS Finder Replace Text: literal swaps on Mac

On a Mac you do not need to install anything for a simple swap. Select the files in Finder, right-click, choose Rename X Items, and pick Replace Text from the dropdown. Type the text to find and the text to replace, and Finder shows an example of the result before you click Rename.

The important limit: Finder's Replace Text is literal and case-sensitive, with no regex and no wildcards. Copy will not match copy, and you cannot express "remove everything after the second dash". For fixed swaps it is the fastest thing on the Mac; for anything pattern-based on macOS you move to Advanced Renamer or the command line.

The command line: regex without installing anything

If you already live in a terminal, find-and-replace is a one-liner and it is the most precise option because it is pure regex. On Windows PowerShell, run a Rename-Item loop that uses the -replace operator: Get-ChildItem *.jpg | Rename-Item -NewName { $_.Name -replace 'IMG_', '' } strips the IMG_ prefix from every JPG. Swap the pattern for whatever you need; -replace is regex, so ' ','_' turns spaces into underscores.

On macOS or Linux, bash parameter expansion handles literal swaps: for f in *; do mv "$f" "${f// /_}"; done replaces every space with an underscore, turning My Photo.jpg into My_Photo.jpg. For regex the rename utility is cleaner: rename 's/\.jpeg$/.jpg/' *.jpeg rewrites the extension, and rename 's/^IMG_//' * drops a leading IMG_. Two safety habits: preview first (PowerShell has -WhatIf, and with bash you can echo the mv before running it for real), and always quote your variables so a filename with a space does not break into two arguments.

Regex Snippets for the Common Cases

Most find-and-replace renames come down to a handful of patterns. Remove a leading IMG_ prefix: match ^IMG_ and replace with nothing, so IMG_1234.jpg becomes 1234.jpg. Replace spaces with underscores: match a space (or \s) and replace with _, so Client Brief.pdf becomes Client_Brief.pdf. Change a .jpeg extension to .jpg: match \.jpeg$ and replace with .jpg. These three anchors, ^ for the start, $ for the end, and \s for whitespace, cover the large majority of real jobs, and they work the same way in PowerRename's regex mode, Bulk Rename Utility, Advanced Renamer, and PowerShell -replace.

Which Tool: the Decision Rule

The choice is driven by what you are replacing, not by the tool you happen to know. If it is a simple literal swap (one exact string to another, or delete a fixed prefix), use PowerRename on Windows or Finder Replace Text on Mac; both give you a preview and zero setup. If it is a regex or conditional replacement (patterns, multiple steps, casing rules), use Bulk Rename Utility or PowerShell -replace on Windows. If you need the same workflow on both Windows and Mac, use Advanced Renamer. Here is how the options compare across the things that actually decide it.

ToolBest forRegex?Live preview?Platform
PowerToys PowerRenameSimple literal swaps, the everyday defaultYes (toggle)YesWindows
Bulk Rename UtilityHeavy, complex, or multi-step replacementsYesYesWindows
Advanced RenamerSame workflow across operating systemsYesYesWindows, Mac
Finder Replace TextQuick literal swaps with nothing installedNoExample onlyMac
Command line (PowerShell, bash, rename)Precise regex, huge batches, scriptingYesWith -WhatIf or echoWindows, Mac, Linux

The short version: start with PowerRename or Finder for a literal swap, move to Bulk Rename Utility or PowerShell -replace the moment you need a pattern, and pick Advanced Renamer when the same rename has to run on more than one operating system.

When the Part You Want Is Not in the Filename

Every tool above rewrites text that already exists in the filename. That works because the string you want to change (IMG_, copy, .jpeg) is right there in the name. The one case find-and-replace cannot touch is when the meaningful part is not in the name at all, for example a folder of scan0001.pdf through scan0300.pdf that you want named after the vendor and invoice number printed inside each document.

That is a different job. Unlike find-and-replace tools that only edit the existing name, renamer.ai reads the actual document content (OCR plus AI vision) and generates the name from what is inside the file, so scan0001.pdf becomes Acme-Invoice-4471-2026-03-15.pdf. Find-and-replace edits the name you already have; renamer.ai writes a name you never had. If your job is truly find-and-replace, the free bulk rename software covered above is all you need.

A Note on Scanned Documents and OCR

One quick caveat if your files are scans. A scanner outputs scan0001.pdf where the page is a picture, not text, so there is no content in the filename and no text layer inside to read either. Find-and-replace tools cannot help there because there is nothing in the name to match, and plain filename tools cannot see inside the file. Only a tool that runs OCR (optical character recognition) to turn the scanned image back into readable text can name those files by their content. If your batch is scans and the part you need is on the page rather than in the name, that is the capability that matters.

Match the Tool to the Replacement

Renaming part of a filename across many files is a solved problem, and it is free on every platform. The only real decision is literal versus pattern: a fixed string swap goes to PowerRename or Finder in seconds, and a pattern goes to Bulk Rename Utility, Advanced Renamer, or the command line where regex lives. Always use the preview (or -WhatIf, or echo) before you commit, because a bad find-and-replace can flatten a whole folder in one click.

The single case none of these handle is naming by what is inside the file rather than what is already in its name. That is the content-reading job the bulk rename software route exists to solve. For editing the names you already have, the tools above cover every version of the task.

Frequently Asked Questions

How do I change part of a filename for multiple files at once?

Use a find-and-replace renamer. On Windows, select the files, right-click, and choose PowerToys PowerRename, then type the text to find and the text to replace and check the live preview before applying. On Mac, use Finder's Rename X Items and pick Replace Text. Both change one part of the name across the whole batch in one pass.

How do I remove the same text from many filenames?

Put the text you want gone (for example IMG_) in the Search or Find field and leave the Replace field empty, then apply. In PowerRename, Finder Replace Text, Bulk Rename Utility, or Advanced Renamer, an empty replacement deletes the matched text, so IMG_1234.jpg becomes 1234.jpg. Always confirm the preview first.

How do I find and replace text in filenames with regex?

Use a tool with a regex mode: enable the regular expressions toggle in PowerRename, tick Regex in Bulk Rename Utility or Advanced Renamer, or use PowerShell's -replace operator (which is always regex). Common patterns are ^IMG_ to match a leading prefix, \.jpeg$ to match an extension, and \s to match spaces. macOS Finder does not support regex, so use the command line or Advanced Renamer on a Mac.

How do I rename part of a filename on Mac?

For a literal swap, select the files in Finder, right-click, choose Rename X Items, and pick Replace Text, then enter the text to find and replace. Finder's Replace Text is literal and case-sensitive with no regex, so for pattern-based changes use Advanced Renamer or a Terminal one-liner such as rename 's/old/new/' *.

What is the best free tool to find and replace in filenames?

On Windows, PowerToys PowerRename is the best free default because it lives in the right-click menu, has a live preview, and offers a regex toggle. For heavier or multi-step replacements, Bulk Rename Utility is the free power option. On Mac, Finder's built-in Replace Text handles literal swaps with nothing installed, and Advanced Renamer is a strong free cross-platform choice.