Takeout JSON

Rename Photos by Date Taken in Bulk (All Platforms)

Naming schemes that sort correctly in every file manager, and how to bulk rename photos by date taken on Windows, macOS and Linux.

Every camera and phone you have ever owned named its photos differently. IMG_0042, DSC_0042, PXL_20210813_143022, 20180402_091501, Screenshot_2019. Sorted by name, a folder from one trip looks like it was shuffled. Sorted by modified date, it looks fine until you copy it somewhere and the dates reset.

Why filenames matter

A filename is the one piece of metadata that every system shows and every system sorts by. EXIF needs a viewer. File dates change when files move. The name travels with the file and is visible in any list.

If the name starts with the date taken, the folder sorts itself in chronological order everywhere: Finder, Explorer, a Linux file manager, a NAS web page, a TV's USB browser, a terminal. No column to choose, no metadata to read.

A scheme that sorts correctly

The order of the parts is what makes it work. Year first, then month, then day, then time, each zero-padded, biggest unit on the left:

2019-07-14-1105_Paris.jpg
2019-07-14-1132_Paris.jpg
2019-07-15-0908_Versailles.jpg

A few rules keep it sane:

Use four-digit years and two-digit months and days. 2019-7-4 sorts after 2019-10-1 as text. 2019-07-04 does not.

Include the time, at least to the minute. Two photos from the same day need something to keep them in order, and a burst of ten photos in one minute still needs a counter, which tools add as _1, _2.

Keep a separator between date and time. 20190714_1105 is fine. 201907141105 is unreadable.

Avoid characters that some filesystems refuse. Colons cannot appear in filenames on Windows or macOS, so time is 1105 or 11-05, not 11:05. Slashes are out for the same reason.

If you want the original name preserved, put it after the date, not before: 2019-07-14-1105_IMG_4821.jpg. The date still controls the sort, and you can still match the file back to a camera card.

Where the date must come from

The rename has to read the date the photo was taken from the EXIF DateTimeOriginal tag. Renaming by file modified date is the most common mistake, and it gives every photo the date you copied it, not the date you took it. /blog/exif-date-taken-vs-file-modified covers why the two differ.

If the photos came from Google Takeout, the EXIF date is often absent and the real date is in a .json sidecar. Rename by EXIF and every photo from that export gets the same day. Fix that first, or use a tool that reads the sidecars. There is a Takeout-specific guide at /blog/rename-google-photos-files-by-date.

Tools by platform

Windows. Explorer's built-in rename cannot read EXIF. Advanced Renamer is free and has an "Image" tag for date taken. XnView MP is free and its Batch Rename supports {EXIF:Date Taken Y-m-d} patterns. IrfanView's batch rename also reads EXIF.

macOS. Finder's batch rename cannot read EXIF either. Automator and Shortcuts can, with some effort. A Better Finder Rename is paid and does it well. XnView MP runs on Mac too.

Linux. exiftool is the standard, and it is in every distribution's repositories. digiKam and XnView MP both have graphical batch renamers.

Everywhere, exiftool does it in one line:

exiftool "-FileName<DateTimeOriginal" -d "%Y-%m-%d-%H%M%%-c.%%e" .

This renames every photo in the current folder to 2019-07-14-1105.jpg, adding -1, -2 if two photos share a minute. Add -r to include subfolders. It skips files that have no EXIF date, so check what is left over afterwards.

A dry run is wise. exiftool has no true dry run for renames, so copy a small batch to a scratch folder and try there first.

Doing it with the app

Takeout JSON Metadata Fixer handles the rename, the date fix and the folder layout in one run, so you do not have to chain three tools.

Four naming templates cover the usual needs. Date-Time + Location gives 2019-07-14-1105_Paris.jpg, with the place name looked up from GPS. Date-Time Only drops the place. Original + Date-Time keeps the camera's name and adds the date after it, as IMG_1234_20190714_1105.jpg. Keep Original Name leaves names alone if all you want is dates and folders.

You can add your own prefix or suffix to any template, so a batch can carry Wedding_ at the front or _scan at the end.

The date for each name comes from the Takeout sidecar if there is one, then from EXIF, then from the file date as a last resort, and the app writes the real date back into the file at the same time. So the name and the EXIF agree, which they often do not after other tools have been at the files.

Dry run shows every proposed name before anything is renamed. Works on macOS, Windows and Linux, offline. Free for 500 photos, then $9.99 once for unlimited.

Frequently asked questions

Should I keep the original filename in the new name?

Keep it if you ever need to match photos back to a camera card or to an old backup. Drop it if you want short, clean names and are confident the originals are backed up elsewhere. Both are fine. The date at the front is what matters.

What about videos?

The same scheme works. Videos carry a creation date in their own metadata rather than in EXIF, and exiftool reads it with -CreateDate instead of -DateTimeOriginal. The app reads the video's own creation time when there is no sidecar.

Two photos taken in the same second get the same name. What happens?

Every decent tool adds a counter. exiftool uses %-c in the pattern. The app appends _1, _2 and so on. Nothing gets overwritten.

Will renaming break Live Photos or RAW+JPG pairs?

Only if the two halves get different names. A pair is recognised by matching names, so both halves must be renamed identically. The app keeps Live Photo pairs together with the same base name by default. With exiftool, rename the JPG and the MOV or RAW in the same command with the same pattern.