My Tool Studio
Bulk Operations·4 min read

Bulk Rename Patterns Explained: Tokens, Regex, Scripts

DSC_4821.JPG tells you nothing: not the shoot, not the date, not where it belongs among ten thousand siblings. Fixing that across a whole memory card is a rules problem. Desktop renamers such as Bulk Rename Utility stack numbered steps, and the Bulk File Renamer follows the same idea in a browser: edit the original name, build a pattern around it, then fix case, spaces and extensions. This guide explains each step, a dated scheme for camera dumps, and how to get the new names onto your disk.

The order the rules run in

Edit the name, then build the new one.

Rules apply in a fixed order. First, find and replace works on the original name without its extension. Second, removals trim a number of characters from the start or end and can strip digits or symbols. Third, Insert text adds a string at a position, where 0 is the start and -1 the end. The result of those three steps is what the {orig} token holds.

Fourth, the pattern builds the new name from {orig} and any other tokens and text you type. Fifth, spaces are trimmed, collapsed or turned into hyphens or underscores, and the letter case is applied. Last, the extension is kept, changed to lower or upper case, replaced or removed. Characters Windows does not allow are replaced with a hyphen along the way.

Pattern tokens and counters

Small words, big savings.

The pattern takes plain text plus tokens: {n} for the counter, {orig} for the edited original name, {mdate} and {mtime} for the date and time modified, {exif} for the camera date, {folder} for the folder a file sits in, {date} for today and {size} for the file size. The original extension is added back automatically, so you never type it.

The counter starts at Start at, rises by Step and gets leading zeros from Digits. Three digits gives 001 to 999 and sorts correctly in every file manager; unpadded numbers sort as 1, 10, 11, 2. Numbering follows Number files in: order added, name in either direction, date modified, size, file type, or Manual, where the arrows in the preview move files up and down.

Find and replace, plain or regex

Where most clean-up happens.

Plain find and replace changes every match, with Match case controlling whether capitals must agree. Find DSC_ with an empty replacement and a pattern of {orig} turns DSC_1042.JPG into 1042.JPG. Tick Regular expression when the change depends on shape rather than exact text: find ^IMG_(\d+) and replace with photo-$1, or find (\d{4})(\d{2})(\d{2}) and replace with $1-$2-$3 to add hyphens to a date.

The preview recomputes on every keystroke, and an invalid expression shows its error under the box instead of silently doing nothing. Rename from a list is the other escape hatch: paste one name per line, for example a column of SKUs from a spreadsheet, and each file takes the name on its line in the numbering order.

A worked batch: one memory card, one dated set

Camera dates in, sortable names out.

Choose folder and pick the card's DCIM folder: 214 files load. Set the pattern to {exif}_shoreline-{n}, Digits 3, Number files in to Date modified, and Letter case to lowercase. The tool reads each photo's camera date, so DSC_4821.JPG taken at 09:14:02 on 3 July 2026 becomes 2026-07-03_091402_shoreline-001.jpg. Files without EXIF fall back to their date modified.

Check the first and last rows of the preview, then choose the output. Rename 214 files to ZIP gives renamed copies and leaves the card alone. Or pick Windows (.bat), PowerShell (.ps1) or Mac or Linux (.sh), download the rename script, drop it into the folder you picked and run it, and the originals are renamed in place.

Scripts, undo and the record

Renaming in place, safely.

Browsers cannot rename files on your disk, which is why the script exists. It only touches files whose name changes, renames each one to a temporary name first and then to its final name, so swaps such as a.jpg to b.jpg and b.jpg to a.jpg work, and it handles subfolders relative to the folder you picked. The undo script reverses every change.

Download Old and new names (CSV) as a record before you run anything. It lists the folder, old name and new name of every file, which makes a client handover or an audit trail easy, and it is the quickest way to prove what changed if someone asks months later.

Batch rename mistakes that cost time

The errors that actually cause trouble:

  • Writing a pattern with no {n} for a multi-file run. Nothing is overwritten, since clashes get -2, -3 and so on, but you end up with trip.jpg, trip-2.jpg and a first file with no number.
  • Using find and replace with a pattern that has no {orig}, so the edited text never appears in the new names.
  • Running the rename script from the wrong folder. It uses paths relative to where it sits.
  • Flattening subfolders into one ZIP without {folder} in the pattern, so names from different folders collide.
  • Using Extension, Change to, to turn photo.png into photo.jpg. That changes the name, not the format; use the Bulk Image Converter to convert the file itself.

Bulk File Renamer after other batch tools

Several batch tools on this site name files as they go: the Bulk Image Compressor and Bulk Image Converter take name patterns, the Bulk Image Resizer defaults to {name}-{w}x{h}, and the Bulk Image Watermark adds -watermarked. When deliverables need one scheme across all of them, extract the ZIPs and bring the results here, where a find and replace with an empty replacement strips any leftover suffix in one pass.

Try it now

Open Bulk File Renamer

The tool is one click away. No sign up, no upload, no payment.

Open Bulk File Renamer