A folder of 300 invoices is easy to rename until one row points at the wrong file. Then you have a missing invoice, a duplicate name, and an original sitting in a backup folder you forgot to make.
The mapping usually exists already. An accountant exports invoice numbers. A client sends a shot list keyed to camera filenames. A product catalogue has SKUs in one column. The job is to apply that sheet to the files, not to invent names.
This walkthrough uses Mass Rename, a browser tool I work on. The same sequence works with a script. The checks are the part that matters.
What you need
- A spreadsheet with two columns: the filename as it is now, and the filename you want.
- The files themselves, in one folder or a folder tree.
- A browser. The ZIP route works in any modern browser; in-place folder renaming needs Chrome or Edge.
You do not need to install anything, and you do not need to upload the files. That last part is not a slogan: the parsing, matching and ZIP creation happen in the tab. You can watch the Network panel while the job runs.
1. Put the old and new names in two columns
Keep the header row simple. The tool recognises common pairs:
current_name new_name
IMG_0412.JPG whitby-abbey-sunrise-01.jpg
IMG_0413.JPG whitby-abbey-sunrise-02.jpg
scan-001.pdf 2026-03-acme-invoice-0412.pdf
old, current, from, source, filename, original and existing name are accepted on the left. new, target, to, rename to, desired and new name are accepted on the right. If your sheet has no header, the tool falls back to the first two columns and tells you.
Two details save time later:
-
You do not have to type the extension. The extension comes from the file on disk. A row that says
invoice-2024-001applied toscan_0031.pdfproducesinvoice-2024-001.pdf. If you type.jpgfor a.pngfile, the.pngstill wins. -
Matching ignores case.
IMG_001.jpgin the sheet matchesimg_001.JPGon disk. That is useful when the camera and the spreadsheet disagree about capitals.
Before you load anything, make a copy of the folder or at least a backup of the files. The ZIP route leaves the originals alone, but a backup is cheaper than an apology.
2. Check the sheet before the files
The most common spreadsheet problems are not exotic. They are duplicate targets, blank cells, stray spaces, and a row that points at a file that is not in the folder.
In Excel or Google Sheets, add a helper column next to the new names:
=AND($B2<>"",COUNTIF($B$2:$B$5000,$B2)>1)
That returns TRUE when the same target appears more than once. Fix those rows before renaming. Two files pointed at the same name is not a numbering problem; it is a decision about which file should keep the name.
For spaces, =TRIM(B2) removes leading and trailing spaces and collapses runs of spaces. Use it only if you want that behaviour. A non-breaking space pasted from a web page is a different character; =SUBSTITUTE(B2,CHAR(160)," ") turns it into a normal space.
I would not try to encode every Windows filename rule in a spreadsheet formula. It is easier to let the rename tool show you the illegal rows, then fix them in the sheet. The rules include < > : " / \ | ? *, reserved names such as CON and LPT1, and names ending in a dot or space.
3. Load the sheet and the files
Open the renamer and drop the .csv, .tsv or .xlsx file into the first box.
A few things happen locally:
- The delimiter in a CSV is detected, so comma, semicolon and tab files load without conversion.
- An
.xlsxworkbook lists every sheet; pick the one with the mapping. - UTF-8 and UTF-8 with a BOM are both read correctly, which matters for names with accents.
- You can also paste two columns straight from Excel or Google Sheets instead of saving a file.
Then add the files. You can select them, drop a folder, or drop a ZIP; the ZIP is unpacked in memory. If the folder has subfolders, turn on the subfolder option and the tool matches each file by its relative path. Files stay in their own folder; nothing gets moved between folders.
4. Read the preview like a checklist
This is the step people skip. The preview is the whole job.
Every file gets one of five statuses:
| Status | What it means | What to do |
|---|---|---|
| Will rename | Matched, legal, unique | Nothing |
| Unchanged | The new name is identical to the old one | Nothing, unless you expected a change |
| Conflict | Two files would get the same target | Fix the sheet; both are skipped by default |
| Illegal name | Contains a blocked character, reserved name, or trailing dot/space | Fix the target |
| No row in sheet | The file exists but no row mentions it | Leave it, or add a row |
There is a sixth list for the other direction: rows in the sheet that match no file. That is where typos in the old-name column show up. Export that list as a CSV and fix it in the spreadsheet. Do not rename the folder and then hunt for the missing file by hand.
If you deliberately want to keep duplicate names, the tool has an auto-numbering option: SKU.jpg, SKU-1.jpg, SKU-2.jpg, with your own separator, start number and digit count. Turn it on only when you actually want numbering. The default is to skip conflicts, which is the safer choice.
5. Choose ZIP or in-place
There are two ways to finish:
Download a renamed ZIP. This is the default and the safe route. The original files are untouched. You unzip the result next to them, spot-check a few names, and delete the originals when you are satisfied.
Rename in place. In Chrome or Edge, the File System Access API lets the page move each file to its new name inside the folder you pick. The tool copies first and removes the old name after the copy succeeds, so an interrupted run leaves duplicates rather than holes. It also keeps the created and modified dates. If the browser cannot move the file in place, it falls back to a copy, and the modified date becomes today. Only in-place mode has an undo button; the ZIP route does not need one because the originals never moved.
If you are on a NAS, a locked-down machine, or a browser that does not support the API, use the ZIP. It is not a lesser mode. It is the mode with the fewest ways to lose a file.
6. Check the result before you delete anything
Do three checks:
- Count. The ZIP should contain the same number of files you started with, unless you intentionally filtered the sheet.
- Read the report. The CSV report lists renamed, unchanged, skipped and unmatched rows. Open it. A clean run has no surprises in the conflict and illegal-name columns.
- Open two or three files. A renamed PDF should still open. A renamed JPEG should still preview. The extension came from the file, so this should be boring, which is what you want.
Then keep the originals for a day. Disk space is cheaper than reconstructing a delivery pack from memory.
Variations that come up often
Build the name from several columns. Instead of writing a full target for every row, use a template such as {SKU}_{Color}_{n}. Each {Column} is filled from that row, and {n} numbers the rows. Modifiers like {Name:lower} and {Name:slug} are available if you need them.
Rename photos by date taken. Switch to photos-by-date mode, add a folder, and the new name comes from each photo's EXIF date. Photos taken in the same second are numbered automatically. Location data is not read. This is useful for camera dumps where the shot list does not exist yet.
Keep subfolders. Pick the top folder and match by relative path. Each file is renamed inside its own subfolder. This is the difference between a clean delivery tree and 400 files dumped into one directory.
Generate a script instead. If the rename has to run on a server or a machine where you cannot open a browser, export a PowerShell, BAT or shell script plus an undo script. The script includes only the files in the preview, so it is not a generic "rename everything" bomb.
When a script is the better tool
If you already have a reproducible pipeline, a shell loop or a Python script is fine. The trade-offs are quoting, dry runs, and undo. A filename with an apostrophe or a leading dash can ruin a loop that looked correct. A preview table makes those problems visible before they touch the disk.
Mass Rename is a good fit when the mapping lives in a spreadsheet and you want to see the whole batch before committing. It is not a fit for a server-side job, a scheduled process, or a batch so large that the browser tab runs out of memory. The tool is tested to 5,000 files per batch; past that, test with a subset first.
What it costs
The first 50 renamed files in each batch are free. The whole batch is checked for free, including the conflict and unmatched-row report; the limit applies to how many renamed files you download. A one-time $19 licence removes the cap. There is no subscription and no account.
If you only need to rename 30 files, use the free tier and keep the $19. If you are doing this every week, the licence pays for itself in one avoided mistake.
A short checklist
- [ ] Two columns, one old name, one new name.
- [ ] No duplicate targets.
- [ ] No blank target rows.
- [ ] No illegal Windows characters or reserved names.
- [ ] Backup of the originals.
- [ ] Preview read, including unmatched rows.
- [ ] ZIP or in-place chosen deliberately.
- [ ] Report CSV opened after the run.
- [ ] Originals kept until the delivery is checked.
The rename itself is the easy part. The preview is the work.
Disclosure: I work on Mass Rename. The workflow above is the one the tool implements; you can do the same checks with a script if you prefer. Links: Mass Rename, the Excel walkthrough, the CSV walkthrough.
Top comments (0)