30% off your first 3 months

Get the deal

Renaming lots of files at once

by DuckyHelperNov 12, 20264 min read
Getting work done

TL;DR:

  • Both Mac and Windows can rename a whole selection at once without extra software.

  • Pad your counters with zeros (001, 002 ... 100) so files sort in the right order.

  • Preview the new names, and work on a copy of the folder until you trust the result.

Your phone or camera names photos IMG_0001.jpg, IMG_0002.jpg and so on. A month later you have 100 of them from one trip and no idea which is which. Renaming them by hand means a hundred clicks, and one slip can overwrite a name you wanted to keep. Both major desktop systems have a built-in way to do it in one go.

Before you start

  • Copy the folder first. Renaming is easy to undo right after you do it and hard to undo a week later. Work on a duplicate.

  • Decide the pattern on paper. A good name sorts correctly, says what the file is, and avoids characters that cause trouble: / \ : * ? " < > |.

  • Pick the order. Counters follow the order the files are in when you select them, so sort the folder by the thing that matters (date taken, or name) before you begin.

Renaming on a Mac with Finder

Select the files in Finder (Command+A selects all), then right-click and choose the option that renames the selected items; it shows the count, for example "Rename 100 Items". A small window opens with three modes: replace text, add text, and a format mode that builds a name from a name plus a counter or similar. A live example of the first new name appears in the window, which is your preview.

For a trip series, use the format mode with a custom name such as 2026-11-09_beach_, a counter starting at 1, and the counter placed after the name. Read the example line before clicking Rename. The options differ a little between macOS versions, so go by what your window shows.

Renaming on Windows with Explorer

Select all the files (Ctrl+A), press F2, type the new base name, and press Enter. Windows names them beach (1), beach (2) and so on, in the order they were selected. This is quick but you cannot choose padding or a date format, and the numbers are not zero padded.

If you need more control, PowerShell can do it, and it has a built in preview flag. Open PowerShell in the folder and run the line below. With the flag in place it prints what it would do without renaming anything. Remove -WhatIf only when the output looks right.

Get-ChildItem *.jpg | Sort-Object Name | ForEach-Object -Begin { $i = 1 } -Process { Rename-Item $_ -NewName ("2026-11-09_beach_{0:D3}.jpg" -f $i) -WhatIf; $i++ }

{0:D3} means "show the number with at least three digits", so 1 becomes 001.

Worked example: renaming 100 photos with dates

The folder holds IMG_0001.jpg to IMG_0100.jpg, 100 files, from a beach day on 2026-11-09. The goal is 2026-11-09_beach_001.jpg through 2026-11-09_beach_100.jpg.

  1. Duplicate the folder: Copy it and work in the copy. Keep the original until you have opened a few renamed photos.

  2. Sort the files: Sort by name so IMG_0001 comes first. Because the originals are zero padded, name order is also the order they were taken.

  3. Choose three digits: 100 files need numbers up to 100, which has three digits, so pad with zeros: 001 to 100. With only two digits you would reach 99 and then break the pattern.

  4. Run the rename: Use Finder's format mode or the PowerShell line above, and read the preview of the first name.

  5. Check the ends: The first file should end in 001 and the last in 100. Count the files in the folder window: it should still say 100 items. Two names in a row should differ by exactly one.

Why zero padding matters: sorted as text, beach_10 comes before beach_2, because the comparison goes character by character and 1 is less than 2. beach_002 and beach_010 sort correctly.

One more habit helps: after any batch rename, keep a short note of the pattern you used and the date. If a colleague asks where a photo went, the note tells them how to find it, and it tells you how to reverse the change if you must.

Mistakes to avoid

  • Changing the file extension. Keep .jpg; a changed extension can make the file look broken.

  • Running the command twice. A second run starts counting again and can clash with names that now exist.

  • Renaming files other programs point to. A document that links to IMG_0001.jpg will lose it. Rename project files from inside that program when it offers it.

  • Skipping the check. Open three files, one from the start, middle and end.

Doing it faster

If you do this often, keep your pattern written in one text file: date, place, counter. Same pattern every time means you can find anything by typing part of the name into search. If you want a second pair of eyes while you do your first one, DuckyHelper is always there on Mac, Windows and Linux: press one key and ask out loud while you keep working.

Frequently asked questions

Can I undo a batch rename?

On a Mac, Finder usually offers Undo straight after the rename. On Windows, Ctrl+Z in File Explorer often undoes it. Do not rely on this later, which is why you keep a copy.

Will renaming change when the photo was taken?

The date the picture was taken is stored inside the file, so a new file name does not change it. That is why a date in the name is a convenience, not the only record.

Get started

DuckyHelper can
do more

It sees your screen and works in any app you use. Try it for 10 minutes, no card.

Get it for Mac, Windows or Linux

Share

Questions and jobs

Do anything

Ask it a question or hand it a job, in any app.

Doing jobs for you is in early access on Mac. Asking works on Mac, Windows and Linux.