How to Rename Multiple Files at Once on Mac
Batch rename files on a Mac with Finder’s built-in Rename tool, Shortcuts or Terminal. Replace text, add a prefix, or number a whole folder in seconds.
· 8 min read
You’ve just pulled 140 photos off your phone and every one is called IMG_4471.HEIC. Or a client sent 30 PDFs named scan0001.pdf to scan0030.pdf. Renaming them one at a time is the kind of job that eats an afternoon.
It doesn’t have to. Finder has had a batch rename tool built in since OS X Yosemite, and most people never find it because it hides in the right-click menu. Here’s how to use it, plus two more powerful options for when Finder isn’t enough.
Rename multiple files in Finder
This works on any recent version of macOS, including macOS 27 Golden Gate.
- Open the folder and select the files you want to rename. Press
⌘Ato select everything, hold⌘and click to pick individual files, or hold⇧to select a range in list view. - Control-click any one of the selected files and choose Rename… (on older macOS versions it says “Rename 24 Items…”). You can also find it in the toolbar’s action menu, the circle with three dots.
- Choose one of the three modes from the pop-up menu at the top of the sheet.
- Watch the Example line update as you type. It shows what the first file will be called.
- Click Rename.
The three modes do quite different jobs, so it’s worth knowing which one to reach for.
Replace Text: swap one word for another
Finder looks for the text in Find in every file name and swaps it for whatever you type in Replace with. It’s the one to use for fixing a typo across a batch, changing IMG_ to something meaningful, or swapping Draft for Final.
Leave Replace with empty to delete text instead. That’s a quick way to strip junk like (1) or copy from the end of a pile of duplicated files.
Add Text: put something before or after the name
Add Text keeps the original names and sticks your text on the front or the end. Use it to add a date prefix like 2026-, a client name, or a status such as -approved. The pop-up next to the field decides whether it goes before name or after name.
Format: replace every name with a numbered pattern
Format throws away the old names completely and gives every file the same base name plus a number. It’s the mode for photo dumps and scanned pages. There are three formats:
- Name and Index adds a plain number:
Lisbon Trip 1,Lisbon Trip 2, and so on. - Name and Counter pads the number with zeros, like
Lisbon Trip 00001. Padded numbers sort correctly in every app, so00010never jumps ahead of00002. - Name and Date adds the current date and time instead of a number.
Type your base name in Custom Format (add a trailing space or dash if you want one between the name and the number) and set Start numbers at. Starting at something other than 1 is handy when you’re adding a second batch to a folder that already runs up to 48.
Number files in the order you want
This catches a lot of people out. When you use Format, Finder numbers files in the order they appear in the window, not the order you clicked them. So sort first, then rename.
- Switch to list view with
⌘2. (If Finder keeps flipping back to icons, see how to make list view the default for every folder.) - Click a column header to sort. Date Created keeps photos in the order you took them. Name keeps scanned pages in sequence. If you don’t see the column you need, press
⌘Jand turn it on. - Press
⌘A, then Control-click and choose Rename → Format.
For photos from more than one camera, sort by Date Created rather than Name. Different phones and cameras use different numbering, so sorting by name mixes them up.
Undo a batch rename
Made a mess? Press ⌘Z or choose Edit → Undo Rename straight away. Finder reverts the whole batch in one go. Undo only remembers your most recent Finder actions, so do it before you move on to something else.
If it’s too late for undo, Format has wiped the original names for good, but Replace Text and Add Text can usually be reversed by running the opposite change. Add Text 2026- is undone by Replace Text 2026- with nothing.
Bigger jobs: the Shortcuts app
Finder’s tool is great for one-off jobs, but it can’t do things like change names to lowercase, swap spaces for dashes, or use the photo’s capture date in the name. The Shortcuts app can, and you can make the result show up in Finder’s right-click menu.
- Open Shortcuts and create a new shortcut. In the details panel, turn on Use as Quick Action and Finder, and set it to receive Files.
- Add a Repeat with Each action so the shortcut handles each file in turn.
- Inside the loop, get the file’s name with Get Details of Files → Name, then change it with actions like Change Case or Replace Text. Replace Text has a Regular Expression option for pattern-based changes.
- Finish with Rename File, using the changed text as the new name.
Once it’s saved, select files in Finder, Control-click and look under Quick Actions. Test any new shortcut on a copy of a few files first. Unlike Finder’s own Rename, a shortcut can’t be undone with ⌘Z.
Power users: rename in Terminal
For thousands of files, or rules that need real pattern matching, Terminal is fastest. macOS uses zsh, which comes with a renaming tool called zmv. Load it, then do a dry run with -n so you can see what will happen without touching anything:
cd ~/Pictures/Lisbon
autoload -U zmv
# Preview: change every .jpeg extension to .jpg
zmv -n '(*).jpeg' '$1.jpg'
# Looks right? Run it for real
zmv '(*).jpeg' '$1.jpg'
# Replace spaces with dashes in every file name
zmv '* *' '${f// /-}'zmv refuses to run if two files would end up with the same name, which makes it safer than a hand-written loop. If you prefer plain shell, the -n flag on mv stops it overwriting an existing file:
for f in *.jpeg; do mv -n -- "$f" "${f%.jpeg}.jpg"; doneMistakes to avoid
- Don’t rename things macOS owns. Leave apps, the Library folder, your home folder and anything in System alone. Renaming them can break apps or settings.
- Watch file extensions. Finder’s Rename tool leaves extensions alone, but Terminal and Shortcuts don’t. Drop the
.pdfand the file won’t open with a double-click. Turn on Finder → Settings → Advanced → Show all filename extensions so you can see what you’re working with. - Mind linked files. Some apps keep references to files by path, such as video editing projects, Lightroom catalogs and code projects. Rename their files from inside the app, or you’ll get “missing media” warnings.
- Let iCloud catch up. Renaming a big batch inside iCloud Drive is fine, but give it a minute to sync before you open the folder on another device.
- Avoid slashes and colons. Finder shows a colon as a slash and the other way round, which confuses Terminal scripts and other apps. Dashes and underscores are safe everywhere.
A naming scheme you’ll thank yourself for
If you’re renaming anyway, use a pattern that sorts well and is easy to search later. One that works for most people is YYYY-MM-DD what-it-is, for example 2026-11-03 lisbon-tram.jpg or 2026-10 invoice acme.pdf. Dates written year first sort in time order in every app, and plain words mean Spotlight can find the file by typing what it is.
That said, you shouldn’t have to rename everything just to find it again. Homy searches the words inside your files and screenshots, so “invoice from acme” finds the right PDF even if it’s still called scan0007.pdf. If searching is the bigger problem, read our comparison of Spotlight and Finder search, or see how Homy’s search works.

And if you find yourself batch renaming every week, Finder might not be the right tool for how you work. We looked at the options in Is there a better file manager than Finder?
Frequently asked questions
Can I undo a batch rename on Mac?
Yes. Right after renaming, choose Edit > Undo Rename or press Command-Z in Finder. That reverts every file in the batch at once. Undo only works until you do something else in Finder, so check the result straight away.
Does batch renaming in Finder change file extensions?
No. Finder’s Rename tool only edits the name part, so photo.jpg stays a .jpg. If you use Replace Text and your search text happens to appear in the extension, Finder still leaves the extension alone.
How do I rename files in order by date on Mac?
Sort the folder by Date Created or Date Modified in list view, select all with Command-A, then use Rename > Format > Name and Index. Finder numbers the files in the order they appear in the window, so the sort order becomes the numbering order.
Is there a limit to how many files Finder can rename at once?
There is no published limit. Finder handles hundreds or thousands of files, though very large batches can take a few seconds. For tens of thousands of files, a Terminal loop is faster.