How to Batch Rename Files on Mac
Three ways to rename multiple files on macOS — Finder's built-in tool, Terminal, and a bulk renamer with live preview and undo — with recipes for prefixes, numbers, dates and extensions.
The Macnestt team5 min read
- How-to
- Finder
Renaming a hundred screenshots, a folder of invoices or a camera import by hand is slow and surprisingly easy to get wrong. macOS has two built-in ways to rename in bulk, and a third option — a dedicated bulk renamer — when the job needs a preview and a way back.
This guide walks through all three, with the exact steps and the traps to avoid.
Method 1: Finder's built-in batch rename
Finder can rename a selection in one pass. It is free and fine for simple patterns.
- Open the folder in Finder.
- Select the files. Use Command-A for everything, or Command-click and Shift-click for a subset.
- Right-click the selection and choose Rename….
- Choose a mode:
- Replace Text — find a string and replace it.
- Add Text — add a prefix or suffix.
- Format — give the files a name with an index, a counter or a date.
- Fill in the fields. Finder shows one example name, not the full result.
- Click Rename.
What Finder cannot do
- No regular expressions or wildcards.
- No photo, music or video metadata.
- No per-rule filters.
- No full preview and no history.
- No control over the extension as a separate field.
For 20 files with IMG_ in the name, it is enough. For 2,000 photos from two cameras, it is not.
Method 2: Terminal
Terminal is the most powerful option and the easiest to get wrong. There is no preview and no undo.
A simple prefix with a shell loop:
for f in *.jpg; do
echo mv "$f" "Holiday_$f"
done
That prints the commands without running them. When the output looks right, remove echo:
for f in *.jpg; do
mv "$f" "Holiday_$f"
done
For regular expressions, the Homebrew rename command is clearer:
brew install rename
rename -n 's/^IMG_/Holiday_/' *.jpg # dry run
rename 's/^IMG_/Holiday_/' *.jpg # for real
-n is the dry run. Use it every time.
What Terminal cannot do
- No visual preview of every final name.
- No conflict detection.
- No undo.
- No metadata reading without extra tools.
- No protection from a wrong glob.
Test in a copy of the folder. A command that works on 10 files can still fail on a name with a space, a newline or an unusual Unicode character.
Method 3: A bulk renamer with preview and undo
A dedicated app sits between Finder and Terminal: visual rules, a full preview, conflict detection and a history. Batchcraft is our app, and this is the workflow it was built for.
Step by step
- Add the files. Drag a folder onto the window, or use Add Files. Turn on Subfolders first if the files are nested.
- Add a rule. Click Add Rule and choose Find & Replace, Add Text, Numbering, Date Insertion, EXIF Metadata or any of the eleven rule types.
- Stack and reorder. Rules run from top to bottom. Use the arrows to move one, or the switch to turn it off while you compare.
- Filter if needed. A rule can apply only to files matching a name, extension, folder or kind. Use all or any.
- Check the preview. Green rows will change, muted rows will not, orange rows conflict.
- Rename. Click Rename or press Command-R.
- Undo if it is wrong. Press Command-Shift-Z, or open History to undo any of the last 100 operations.
Nothing is overwritten. If a target name already exists, Batchcraft stops at that file rather than replacing it.
Which method should you use?
| Job | Best method |
|---|---|
| Replace one word in 20 files | Finder |
| Add a simple prefix or number | Finder |
| A repeatable pipeline in a script | Terminal |
| Regex across hundreds of files | Batchcraft or Terminal |
| Rename photos by capture date | Batchcraft or a metadata tool |
| Mixed folders where only some files should change | Batchcraft (filters) |
| Anything you might need to undo | Batchcraft |
Five batch rename recipes
Add a prefix to every file
- Finder: Add Text → Prefix.
- Batchcraft: Add Text, position Prefix, type
2026_. - Terminal:
for f in *; do mv "$f" "2026_$f"; done(dry-run first).
Add sequential numbers
- Finder: Format → Name and Counter, set the start number.
- Batchcraft: Numbering, position Suffix, three digits, start 1. Sort the list first; numbering follows the current order.
- Terminal: a counter in a loop, or
renamewithsprintf.
Put the date in the filename
- Finder: Format → Name and Date uses the file date.
- Batchcraft: Date Insertion can use created, modified, today or the photo's EXIF date taken, in a format such as
yyyy-MM-dd. - Terminal:
date -r "$f" +%Y-%m-%dinside a loop.
Change an extension in bulk
Finder cannot treat the extension as its own field. Batchcraft has a Change Extension rule that changes, replaces, removes or re-cases extensions without touching the rest of the name. Terminal can do it with rename 's/\.jpeg$/.jpg/' *.jpeg.
Rename from a spreadsheet
If the new names already exist in Excel, Numbers or Google Sheets, copy the column and paste it into Rename from List. Match by order or by the original filename. Finder and Terminal cannot do this without a script.
A safety checklist
Before any large batch:
- Work on a copy or keep a backup.
- Preview every file, not a sample.
- Look for duplicate names and existing targets.
- Check the extension is still correct.
- Know how to undo before you start.
- For photos, confirm the camera's date and time zone were right.
Frequently asked questions
Can I rename multiple files at once on Mac for free?
Yes. Select the files in Finder, right-click and choose Rename. Finder supports replace text, add text and a name with a number or date.
Can Finder rename files with sequential numbers?
Yes. Choose Format, then Name and Counter, and set the starting number. The counter is added to every selected file.
Can I undo a batch rename in Finder?
No. Finder's batch rename has no undo. You would need to rename the files back manually or restore them from a backup.
Can I use regular expressions in Finder?
No. Finder has no regex support. Use Terminal, Batchcraft or another renamer with regex.
Does Batchcraft rename folders?
Not in the current version. Batchcraft 0.2 renames files. Folder renaming is on the roadmap but not in this build.