Bulk rename files with a pattern
Paste your file names, write a pattern such as Trip_{n:3}_{name}, and the table shows every old name next to its new one, with duplicates flagged. Copy the result or download a CSV before you rename anything.
Everything runs in your browser. Your text and files stay on your device and are never uploaded.
Pattern
Tokens: {name} the name without its extension, {n} a counter, {n:3} a counter padded to 3 digits, {index} the line number, {ext} the extension (a pattern that uses it is not given a second one), {upper}, {lower}, {first:3} the first 3 letters, {last:3} the last 3.
Find and replace
Clean up
Paste your file names to see the preview.
How to use it
- Paste your file names, one per line. List a folder with ls on a Mac or dir /b on Windows, or copy a column from Sheets.
- Write the new name pattern. {name} is the old name, {n} a counter, and {n:3} a counter padded to three digits.
- Add find and replace, switch spaces to underscores, change letter case or fix the extension.
- Check the preview table. Rows marked Duplicate would collide, and rows marked with a problem have an empty name or a character many systems reject.
- Copy the new names, copy old and new side by side for a sheet, or download the CSV or a Mac and Linux script.
Questions
How do I bulk rename files with a numbered pattern?
Put {n} in the pattern, for example Holiday_{n:3}. The counter starts at the number you choose, steps by the amount you choose, and is padded with zeros to the digits you set, so Holiday_001, Holiday_002 and so on.
Does this rename the files on my computer?
No. A web page cannot rename files on your device. It builds the new names and shows the preview, and you apply them by pasting the list into your own tool, using the CSV, or running the downloaded script inside the folder on a Mac or Linux computer. The script never overwrites a file that already exists.
What does the Duplicate warning mean?
Two or more files would end up with the same name once the rules run, ignoring upper and lower case. Add a counter such as {n} to the pattern to make every name unique.
Can I use a regular expression?
Yes. Tick Regular expression and use groups in the replacement, for example find (\d+)-(\d+) and replace with $2-$1 to swap two numbers. An invalid expression shows an error and leaves the names alone.
Is the file extension changed by my find and replace?
No. The rules work on the name without its extension, so replacing pdf in a name never edits the .pdf at the end. Use the Extension setting to change, lowercase or remove it.
Are my file names uploaded anywhere?
No. The preview is calculated in your browser and nothing is sent to a server. Lists up to 20,000 names are processed.