Rename photos with the date in the filename

Practical guide · Windows 10 and Windows 11

You empty the camera card and you are looking at IMG_4417.JPG, DSC_0091.jpg, P1020388.JPG. Two years from now those names will tell you nothing at all, and if you mix photos from two cameras in one folder the numbers collide and overwrite each other.

The standard fix is to put the date in front: 2026-06-14_wedding_001.jpg. They sort themselves alphabetically, they never clash, and you can see what everything is at a glance. But before picking a method there is something worth understanding, because it is where people get burned.

The trap: a file has two different dates and they do not always agree. The file date is the one Windows keeps, and it can change when you copy, move, edit or sync to the cloud. The EXIF date is what the camera wrote inside the image itself at the moment you pressed the shutter, and it never moves.

If you copy photos off the card by dragging them, Windows usually preserves the original date. But once they pass through WhatsApp, Google Photos, a ZIP or an editing program, the file date can end up being today. The EXIF date is still the day you took the shot.

Finding out which date you have

Right-click a photo, Properties → Details. If "Date taken" shows something, you have EXIF. Compare it with "Date modified" on the General tab. If they match, any method will do. If they do not, read the ExifTool section.

1. PowerShell, using the file date

Open PowerShell in the folder and paste:

Get-ChildItem *.jpg | Rename-Item -NewName { $_.LastWriteTime.ToString('yyyy-MM-dd') + '_' + $_.Name }

That leaves you 2026-06-14_IMG_4417.JPG. Test it first by adding -WhatIf to the end of the command: it shows what it would do without doing it.

What it cannot do: it uses the file date, with the risk we just covered. It does not number anything. There is no real preview and no undo: get it wrong across two hundred files and you are repairing them by hand.

2. ExifTool, when the file date cannot be trusted

ExifTool is a free command-line tool, the de facto standard for reading photographic metadata. It reads the date from inside the image, so whatever happened to the file is irrelevant:

exiftool "-FileName<DateTimeOriginal" -d "%Y-%m-%d_%%f.%%e" .

It is the right choice if your photos have been around. It can also repair the file date from the EXIF one, which is what I would do before anything else:

exiftool "-FileModifyDate<DateTimeOriginal" .

What it cannot do: you have to download and install it, the syntax is dense, and there is no interface. For anyone who does not live in a console it is a real learning curve.

3. In batches, with a preview

If you want to see the result before anything is touched and stack several operations at once, TandaFiles does it in the browser:

  1. Open folder and choose the photo folder.
  2. Add the File date rule, format YYYY-MM-DD, position at the start.
  3. Add Numbering, three digits, at the end.
  4. If you want a word in the middle, add Prefix / suffix or build the whole name with Template, using the {date}, {name} and {n} tokens.

The table shows you the old and the new name of every file as you type, flags in red any that would end up duplicated, and there is a button to undo the last batch.

Be clear about what it uses: TandaFiles takes the file date, not the EXIF one. If your photos come straight off the camera or the card, they are the same and you will not notice a difference. If they have been through messaging apps or the cloud, run ExifTool first with -FileModifyDate<DateTimeOriginal to give the file its proper date back, then rename with whatever you like.

Which date format to use

Always use YYYY-MM-DD, that is 2026-06-14. This is not a preference: it is the only format that sorts itself. Write 14-06-2026 and sorting by name groups together every 14th of every month of every year, which is useless. With the year first, alphabetical order and chronological order are the same order.

Which one to use

And the usual advice: the first time, run it on a copy of the folder.

Try TandaFiles free in your browser