📌 TL;DR: To mass rename files on Windows, select them in File Explorer and press F2 for a numbered series, or use the free PowerRename from Microsoft PowerToys for find-and-replace. On a Mac, select the files in Finder, right-click and choose Rename. For full control, use PowerShell on Windows or the rename command on Linux. To rename files automatically, or by what’s inside them, see how to automate file renaming.

Which method fits your job:
| Method | Platform | Best for | Skill level |
|---|---|---|---|
| File Explorer (F2) | Windows | Numbered series | Beginner |
| PowerRename | Windows | Find and replace, numbering | Intermediate |
| PowerShell | Windows | Scripted rules | Advanced |
| Finder | Mac | Replace, add text, numbering | Beginner |
| Automator | Mac | Reusable right-click actions | Intermediate |
rename command | Linux, Mac | Pattern rules in one line | Advanced |
| Filently | Google Drive | Names by content, plus filing | Beginner |
Before You Rename: Three Safety Checks
- Work on copies or have a backup. File Explorer and Finder can undo a rename, the command line can’t.
- Preview, then test on 5–10 files. A typo in a rule hits every file at once.
- Watch for duplicate names. If a rule turns
Client-Meeting-Notes.docxandClient-Follow-Up.docxboth intoClient.docx, one of them can’t keep the name.
If you don’t have a naming scheme yet, decide on one first: five rules cover almost every case.
How to Mass Rename Files on Windows
File Explorer: a Numbered Series
- Select the files in File Explorer.
- Press F2. The first file’s name becomes editable.
- Type a new name, for example
Hawaii-Trip, and press Enter.
Windows renames the whole selection to Hawaii-Trip (1).jpg, Hawaii-Trip (2).jpg and so on, in the folder’s current sort order. Press Ctrl+Z right away to undo it.
PowerRename: Find and Replace
PowerRename is a free tool from Microsoft PowerToys. Once PowerToys is installed, it sits in the right-click menu.
- Select the files, right-click and choose Rename with PowerRename.
- Enter the text to find, for example
IMG_, and the replacement, for exampleHawaii-Trip-. - Check the preview on the right, which shows every new name before anything changes.
- Click Apply. Ctrl+Z in File Explorer undoes it.
To number files with leading zeros instead, tick Use regular expressions and Enumerate items, set Apply to to Filename only, search for .* and replace with Hawaii-Trip-${start=1;padding=3}. That gives you Hawaii-Trip-001.jpg, Hawaii-Trip-002.jpg and so on.
PowerShell: Scripted Rules
PowerShell is built into Windows and handles rules that go beyond find-and-replace. Open the folder in PowerShell and run, for example:
- Replace spaces with underscores in all Word files:
Get-ChildItem *.docx | Rename-Item -NewName { $_.Name -replace ' ','_' } - Add a prefix to every JPG:
Get-ChildItem *.jpg | Rename-Item -NewName { "Project-Alpha-" + $_.Name } - Change an extension from .txt to .md:
Get-ChildItem *.txt | Rename-Item -NewName { $_.Name -replace '\.txt$','.md' }
Add -WhatIf at the end of a command to see what it would do without renaming anything.
How to Mass Rename Files on a Mac
Finder: Replace, Add Text or Number
- Select the files in Finder.
- Right-click and choose Rename.
- Pick Replace Text, Add Text or Format.
- For a numbered series, choose Format, set it to Name and Index, enter a custom format such as
ProjectX-2026-05-21-and set where the number goes. - Check the example at the bottom of the dialog and click Rename.
Finder renames the selection to ProjectX-2026-05-21-1.docx, ProjectX-2026-05-21-2.docx and so on. Press Cmd+Z right away to undo it.
Automator: a Reusable Quick Action
If you run the same rename again and again, save it as a Quick Action. This one adds a DRAFT- prefix to any file you right-click:
- Open Automator from your Applications folder.
- Create a new document and choose Quick Action.
- Set the input at the top: “Workflow receives current files or folders in Finder”.
- Add the action. Drag Rename Finder Items from the library into the workflow. Automator offers to add Copy Finder Items first; say yes if you want to keep the originals.
- Configure it. Choose Add Text and type
DRAFT-. - Save it under a name like “Add Draft Prefix”.
The action now appears under Quick Actions when you right-click a file in Finder. To run it on every new file in a folder instead, save the workflow as a Folder Action (see below).
How to Mass Rename Files on Linux
On Debian and Ubuntu, the rename command uses Perl expressions and renames a whole folder in one line. Install it with sudo apt install rename; on a Mac, brew install rename gives you the same tool. The -n flag shows what would happen without renaming anything. Remove it to apply the change.
- Standardize extensions, so
.JPEG,.JPGand.jpegall become.jpg:rename -n 's/\.jpe?g$/.jpg/i' * - Replace spaces with underscores:
rename -n 's/ /_/g' * - Convert names to lowercase:
rename -n 'y/A-Z/a-z/' *
Renaming by Photo Date and Other Metadata
PowerRename and dedicated renaming apps can pull information from the file itself, like a photo’s capture date or camera model, and turn _DSC9872.NEF into 2024-05-21_Nikon-Z6-II_Family-BBQ.NEF across a whole folder. Our comparison of file naming software covers the options. To try AI naming on a few files without installing anything, CleanName is a free AI-powered file renaming tool.
Batch renaming fixes today's files. Filently names tomorrow's too.
Named and filed on arrival, by email, upload or scan.
How to Automate File Renaming
You automate file renaming by letting something run the rename for you, on a schedule or whenever a file arrives, instead of starting it by hand. There are four ways, from built-in to fully hands-off.
1. Built-in tools: PowerRename and Automator
PowerRename (Windows) and Automator Quick Actions (Mac, see above) save a rename so it’s one right-click away. On a Mac, Automator goes one step further: save your workflow as a Folder Action instead of a Quick Action and attach it to a folder, and macOS renames every file you drop into that folder.
2. Scripts on a schedule: PowerShell and Python
A script renames files by pattern without you opening anything. Use PowerShell on Windows (see the examples above) or Python on any system. This Python script swaps the IMG_ prefix for Photo_ in one folder:
import os
folder = "/path/to/folder"
for name in os.listdir(folder):
if name.startswith("IMG_"):
new_name = name.replace("IMG_", "Photo_", 1)
os.rename(os.path.join(folder, name), os.path.join(folder, new_name))
To run it automatically, schedule it with Task Scheduler on Windows or cron on Mac and Linux, for example every night.
3. Workflow tools: Power Automate Desktop and Zapier
Power Automate Desktop, free on Windows 10 and 11, builds the same loop without code: a Get files in folder action feeds a Rename file(s) action. Zapier or Make do it for cloud storage: when a file lands in Google Drive or Dropbox, a zap renames it, for example with data from a form or spreadsheet.
4. AI watch folders
Scripts and workflows only match patterns: they can turn IMG_ into Photo_, but they can’t tell an invoice from a contract. To name files by what’s inside them, use an AI renamer that watches a folder: Renamer.ai or NameQuick on your computer, or Filently in Google Drive, which also files each document into the right folder. Our comparison of file naming software covers the options, and for files in Google Drive, see how to rename multiple files in Google Drive.
Renaming Documents by Content with Filently
Every method above follows a rule you write. None of them can tell that invoice_scan_4432.pdf is invoice 5501 from Innovate Inc., dated November 15, 2023. To get 2023-11-15_InnovateInc_INV5501.pdf, someone has to open the file and type the name, unless an AI does it.
Filently does that for documents in Google Drive. It identifies each document by its content, scans and photos of documents included, names it the way you want and files it into the right folder of your existing structure, in My Drive or in shared drives.
- Naming: Filently can adopt the pattern your existing files already follow, keep its default convention, or follow rules you describe in plain words.
- Getting files in: drop them into the _ Filently Inbox folder in your Drive, forward them by email or upload them. Every new document is renamed and filed as it arrives.
- Where it doesn’t fit: photos without text, like holiday pictures, have no content to name them by, and files outside Google Drive are out of reach. The methods above handle both.
The first 25 documents are free, no credit card needed. For more on the approach, see our article on AI document management.
Frequently Asked Questions
Can I undo a mass rename?
You can undo a mass rename in File Explorer, PowerRename or Finder if you do it right away: press Ctrl+Z on Windows or Cmd+Z on a Mac. Renames run from PowerShell, the Terminal or a script have no undo, so test those on copies of your files first. Dedicated renaming apps such as Bulk Rename Utility and Advanced Renamer keep their own undo.What's the best date format for file names?
The best date format for file names is YYYY-MM-DD (ISO 8601), for example2026-03-14_Project_Report.pdf, because files then sort chronologically by name on every system. Put the date first if you want files sorted by time, or after the subject if you want them grouped by subject. PowerRename, Automator and dedicated renaming apps can add a file’s creation date or a photo’s capture date without any typing.Which characters should I avoid in file names?
Avoid\ / : * ? " < > | in file names: Windows doesn’t allow them, and they cause sync errors in OneDrive and other cloud storage. On a Mac only the colon and the slash are off-limits, but files often move between systems. Letters, numbers, hyphens and underscores work everywhere. Spaces are fine on modern systems; use hyphens or underscores if your files end up in scripts, web addresses or command-line tools.How do I rename files with different extensions in the same folder?
To rename files with different extensions in the same folder, run one rule per file type. In File Explorer or Finder, sort the folder by type and select one group at a time. In PowerShell, filter by extension, for exampleGet-ChildItem *.jpg. In Bulk Rename Utility, a filter mask such as *.jpg limits a rule to one file type.How do I rename multiple files in Google Drive?
Google Drive can’t rename multiple files at once, so you need an add-on, Google Drive for desktop or Apps Script. The free add-on Multiple File Rename for Google Drive handles find-and-replace and prefixes, and with Google Drive for desktop you rename files in File Explorer or Finder and Drive syncs the new names. Our guide to renaming multiple files in Google Drive walks through all five ways. Filently renames Google Drive files by their content and files each one into the right folder.Stop renaming documents by hand Filently names every new document by its content and files it where it belongs.
First 25 documents free. No credit card needed.