When you want to rename photos or documents in bulk, Mac includes powerful batch file renaming features by default. There are three main approaches: Finder's built-in rename feature, Automator workflows, and Terminal using the mv command. Choosing the right one for your task and file count makes the work much more efficient. This article explains every method with practical examples, targeting macOS Sonoma / Sequoia and later. For broader Mac tips, also see Mac Troubleshooting Guide.
Table of Contents
- Three Ways to Batch Rename Files on Mac
- Finder's Batch Rename Feature
- Finder Format Options in Detail
- Create a Batch Rename Workflow with Automator
- Use the mv Command in Terminal
- The rename Command via Homebrew
- Practical Photo File Renaming Examples
- Practical Document File Renaming Examples
- Troubleshooting
- Summary: The Best Choice by Use Case
Three Ways to Batch Rename Files on Mac
There are three main ways to batch rename files on Mac, and each is best suited to different tasks.
Finder's Built-in Feature: Complete Everything in the GUI
Built into macOS since OS X Yosemite. For basic operations on around 10 to 100 files, such as replacing text, adding text, or adding sequential numbers, this is all you need. No installation required, with the smallest learning curve. It is the first choice for everyday use.
Automator: Automate Repetitive Tasks
If you register the workflow as a Quick Action, you can call it directly from Finder's right-click menu. It makes routine work much easier when you repeat the same operation every week.
Terminal: Maximum Flexibility for Advanced Users
By combining the mv command or the rename command, you get the ultimate flexibility to do almost anything with regular expressions. Terminal is the best option for processing more than 1,000 files or for complex tasks such as naming files based on Exif information.
Finder's Batch Rename Feature
For batch renaming on Mac, Finder's built-in feature covers most needs. It has been available since Yosemite (10.10), and its behavior has remained stable across major macOS updates.
Select Multiple Files and Open Rename
Select the target files in Finder (⌘ + A to select all, Shift-click to select a range, or ⌘-click to select individual files) → right-click the selected files → choose "Rename Items...". You can also open the same dialog from the menu bar: "File" → "Rename".
"Replace Text" Mode
From the dropdown at the top of the dialog, choose "Replace Text". Enter the text to find and the replacement text → check the preview → click the "Rename" button to run the bulk replacement. For example, replacing "IMG_" with "Photo_" changes "IMG_1234.JPG" to "Photo_1234.JPG".
"Add Text" Mode
Choose "Add Text", enter the text you want to add in the "Text" field, then choose where to place it ("before name" or "after name"). For example, adding "2026-05_" before the name changes "IMG_1234.JPG" to "2026-05_IMG_1234.JPG". This is useful when adding a project name or date prefix in bulk.
Use "Format" Mode to Add Sequential Numbers
"Format" is the most powerful mode because it rewrites file names using a completely new naming rule. Set the naming pattern in "Name Format", the fixed text in "Custom Format", and the starting value in "Start numbers at". For example, if you set the custom format to "Vacation", the starting number to "1", and the name format to "Name and Number", the files will be named "Vacation 1.jpg", "Vacation 2.jpg", and so on.
Finder Format Options in Detail
"Format" mode has many options, and combining them gives you flexible naming patterns.
Name and Number, Name and Counter, Name and Date
You can choose from three format types in the dropdown:
- Name and Number: "Vacation 1.jpg", "Vacation 2.jpg" (separated by a half-width space)
- Name and Counter: "Vacation00001.jpg", "Vacation00002.jpg" (fixed five-digit zero padding)
- Name and Date: "Vacation 2026-05-01 14-23-15.jpg" (timestamp from when the rename is run)
For sequential photo names, "Name and Counter" is often preferred because it keeps the digit width consistent.
Starting Number and Number of Digits
You can set the initial value in "Start numbers at". If you enter "100", the files continue as "Vacation 100.jpg", "Vacation 101.jpg", and so on. In "Name and Counter" mode, the zero-padded width is fixed at five digits, while "Name and Number" uses variable digits, so names like "9.jpg" and "10.jpg" coexist. Since some file managers sort "10" before "9", choose "Counter" if aligned digit widths matter.
Whether to Place the Number Before or After the Name
In "Where", you can choose "before name" or "after name". "After name" is common, as in "Vacation 1.jpg", but choosing "before name" sorts the folder by number, so use whichever fits the purpose.
Create a Batch Rename Workflow with Automator
If you routinely rename files with the same pattern every week, registering the task as an Automator "Quick Action" lets you run it in one step.
Steps to Register It as a Quick Action
Launch "Automator.app" → choose "Quick Action" → search for "Rename Finder Items" in the search bar, then drag it into the workflow area. Configure options such as "Replace Text", "Add Text", or "Make Sequential" → choose "File" → "Save", give the Quick Action a name, and save it.
Add It to Finder's Right-click Menu
After saving it, select multiple files in Finder → right-click → "Quick Actions" → the action name you created to run it. You can also assign a keyboard shortcut from "Settings" → "Keyboard" → "Keyboard Shortcuts" → "Services", which makes the operation even faster.
Branch by Condition to Process Only Certain Extensions
Place a "Filter Finder Items" action at the beginning and specify a condition such as "extension is jpg". Then, even if the selection includes other extensions, only the target files will be processed. This makes workflows like "rename only the jpg files in the photo folder and leave PDFs untouched" possible.
Use the mv Command in Terminal
For complex renaming that the GUI cannot handle, Terminal is the strongest option. It gives you full control over processing 1,000 or more files, automatic naming based on Exif data, regular-expression replacements, and more.
Basic One-off Renaming with mv
mv old_name.txt new_name.txt
This is the most basic rename operation. It is not a batch operation by itself, but you can turn it into one with shell variables and loops. If the file name contains spaces, you need to wrap it in quotes:
mv "old name.txt" "new name.txt"
Sequential Renaming with a for Loop
i=1
for f in *.jpg; do
mv "$f" "Vacation_$(printf '%03d' $i).jpg"
i=$((i+1))
done
This script renames every jpg in the current directory to "Vacation_001.jpg", "Vacation_002.jpg", and so on. printf '%03d' applies three-digit zero padding, and the numbers are assigned in the sort order of *.jpg.
zsh / bash Expansion Syntax
zsh, the macOS default shell, has convenient syntax using brace expansion and parameter expansion:
# 拡張子だけ jpeg → jpg に変える
for f in *.jpeg; do mv "$f" "${f%.jpeg}.jpg"; done
# プレフィックス追加
for f in *.jpg; do mv "$f" "2026-05_$f"; done
${f%.jpeg} is parameter expansion that removes the trailing .jpeg.
The rename Command via Homebrew
If you want to rename files easily in Terminal with regular expressions, installing the rename command with Homebrew is the standard choice.
Install with brew install rename
brew install rename
If Homebrew itself is not installed, follow the setup instructions on the official site. rename is a utility that can rewrite file names in bulk using Perl regular expressions.
Flexible Renaming with Regular Expressions
# 「IMG_」プレフィックスを「Photo_」に置換
rename 's/^IMG_/Photo_/' *.jpg
# 連番を3桁ゼロ埋めにする
rename 's/(\d+)/sprintf("%03d",$1)/e' *.jpg
# 拡張子を jpeg → jpg に変える
rename 's/\.jpeg$/\.jpg/' *
s/old/new/ is Perl replacement syntax. With the /e flag, the right-hand side can be evaluated as a Perl expression, enabling flexible processing such as digit-width adjustment.
Preview with the -n Option
rename -n 's/IMG_/Photo_/' *.jpg
Adding -n or --no-act previews only the changes without actually renaming the files. Getting into the habit of checking whether the conversion is what you intended before running it for real reduces mistakes.
Practical Photo File Renaming Examples
Here are practical examples for standardizing names around capture dates.
Change "IMG_1234.JPG" to "2026-05-01-001.jpg"
In Finder's "Format" mode:
- Custom Format: "2026-05-01-"
- Name Format: "Name and Counter"
- Start numbers at: "1"
This names the selected files in order as "2026-05-01-00001.jpg". The key is to pay attention to selection order, or sort by name in Finder before selecting the files.
Automatically Name Files from Exif Capture Date
Finder cannot do this, so use exiftool in Terminal:
brew install exiftool
exiftool '-FileName<DateTimeOriginal' -d '%Y-%m-%d-%H%M%S.%%e' *.jpg
This command reads the Exif capture date from each photo and renames the file using that date and time. Even photos from the same event will sort by capture time, so the chronology stays intact.
How to Organize Photos Synced Between iPhone and Mac
Photos imported from iPhone use the "IMG_" prefix plus sequential numbers. For photos synced with iCloud, file names inside Photos.app cannot be changed, so organization after export is the main workflow. The standard approach is to export them from "Photos.app" → "File" → "Export" → "Export Unmodified Original", then rename them using the steps in this article.
Practical Document File Renaming Examples
Organizing business documents is a typical case where naming rules determine how useful the system becomes.
Standardize Invoice PDFs as "YYYY-MM-Client.pdf"
In an invoice folder, a realistic hybrid workflow is to select everything → "Rename Items" → "Add Text" → add "2026-05_" before the name → manually append each client name. If you want full automation, OCR is required, which means using a third-party app such as PDFExpert or PDF Architect, or building the flow with Apple Shortcuts.
Add Track Numbers to Music Files
In "Format" mode, choose custom format "Track", starting number "01", and name format "Name and Counter". If you want to respect MP3 tags, it is more accurate to open and edit the files in Music.app, formerly iTunes. File-name renaming is best limited to surface-level organization.
Avoid Number Collisions with Duplicate File Names
When you gather files from multiple folders into one folder, duplicate names can cause overwrites. In Finder, choosing "Keep Both" while copying automatically adds numbers such as "Untitled 2.jpg" and "Untitled 3.jpg", but the naming is not especially clean. To renumber everything in bulk, it is safest to rebuild all names together using Finder's "Format" option.
Troubleshooting
Here are common points where rename workflows go wrong and how to avoid them.
You Cannot Restore the Original Names After Renaming
Finder batch renaming can be undone with ⌘ + Z (Undo) for the immediately previous operation, but files renamed with mv in Terminal cannot be restored that way. Before processing important files, take a Time Machine backup or copy the files to another folder first. Using the rename -n dry run is also recommended.
Only the Extension Disappears
If you use Finder's "Replace Text" with a replacement that includes ".jpg", you may accidentally remove the extension. Finder is designed to rename files including their extensions, so check the replacement target explicitly. Turning on "Settings" → "Finder" → "Advanced" → "Show all filename extensions" lets you see extension states before and after renaming, which reduces mistakes.
Finder's Rename Menu Does Not Appear
If "Rename Items..." does not appear when multiple files should be selected, only one item may actually be selected. Use Shift-click or ⌘-click to ensure multiple selection before right-clicking. If you select only folders, some menus may change, so when files and folders are mixed, it is safer to process them separately.
Summary: The Best Choice by Use Case
There are three ways to batch rename files on Mac. Choose based on file count and purpose:
| File count / use case | Recommended option |
|---|---|
| 10 to 100 files, text replacement or sequential numbering | Finder's built-in feature |
| Repeating the same process every week | Automator Quick Action |
| 1,000 or more files, complex regular expressions | Terminal + rename |
| Automatic naming from Exif information | exiftool |
| Standardizing by capture time order | exiftool + keep filename extensions |
For everyday use, Finder is enough. If you want a repeatable workflow, use Automator. For more serious file operations, move on to Terminal step by step. For broader Mac operations, also see Mac Troubleshooting Guide.


