ExifTool for Google Takeout: Commands and Pitfalls
By MetaData Recover Team · Updated
ExifTool is a free, open-source command-line program that reads and writes metadata in photos and videos, and it is the classic way to copy dates and GPS from Google Takeout JSON files back into your media. It works well for simple exports, but the basic command only finds JSON files with the old naming, and dates, videos and time zones each need extra care.
- The well-known one-line command only matches the old
IMG_1234.jpg.jsonnaming. - Since late 2024 many exports use
.supplemental-metadata.json, often truncated to about 46 characters. (1)duplicates,-editedcopies and Live Photo videos are usually missed by simple commands.- Always work on a copy:
-overwrite_originalreplaces your files without keeping a backup.
What is ExifTool?
ExifTool is a Perl-based metadata tool by Phil Harvey. It runs on macOS, Windows and Linux and supports almost every image and video format. Crucially for Google Takeout, it can read a JSON file and treat its fields as tags, so photoTakenTime.timestamp becomes PhotoTakenTimeTimestamp and geoDataExif.latitude becomes GeoDataExifLatitude.
Google exports one JSON sidecar per photo because Google Photos keeps your dates, captions and locations in its own database. If you are new to these files, start with Google Takeout JSON files explained.
“To keep your records or transfer your data to another service, you can create an archive.”
The basic ExifTool command for Google Takeout
Unzip your Takeout, open Terminal, cd into the Google Photos folder and run this widely shared command:
exiftool -r -d %s -tagsfromfile "%d/%F.json" "-DateTimeOriginal<PhotoTakenTimeTimestamp" "-CreateDate<PhotoTakenTimeTimestamp" "-ModifyDate<PhotoTakenTimeTimestamp" --ext json -overwrite_original .-rprocesses all subfolders recursively.-d %stells ExifTool the date values are Unix seconds, the format ofphotoTakenTime.timestamp.-tagsfromfile "%d/%F.json"reads tags from a JSON file in the same directory (%d) named after the full file name with extension (%F)."-DateTimeOriginal<PhotoTakenTimeTimestamp"copies the capture date into the date-taken tag; the next two arguments do the same forCreateDateandModifyDate.--ext jsonskips the JSON files themselves.-overwrite_originalwrites in place instead of keeping_originalbackup copies.
How do you update it for .supplemental-metadata.json?
Since roughly late 2024, Google has been rolling out a new sidecar name, IMG_1234.jpg.supplemental-metadata.json. The change was never announced, and both styles can appear in one export. On top of that, the part before .json is cut to about 46–47 characters, so you will see endings like .supplemental-metad.json or .suppl.json. The basic %F.json pattern finds none of these. See what .supplemental-metadata.json is for the full naming rules.
One approach shared on the ExifTool forum builds the JSON name with a Perl expression that adds the suffix and truncates it to 46 characters:
-tagsfromfile "%d/${filename;$_.=".supplemental-metadata";length>46 and $_=substr($_,0,46);$_.=".json"}"Replace the -tagsfromfile part of the basic command with this, and run the old command as well for files that still use plain .json names. Test it on a small copied folder first, because the exact cut-off length varies between reports.
Which files does ExifTool miss?
Even with both commands, a pattern-based approach cannot map every file to its sidecar. The usual gaps are:
- Duplicate counters:
IMG_3479(1).JPGbelongs toIMG_3479.JPG(1).jsonorIMG_3479.JPG.supplemental-metadata(1).json, with the counter after the extension. -editedcopies, which usually have no JSON of their own and need the original’s.- Live Photo and motion photo video halves, which usually have no JSON at all.
- Very long file names where the media name itself was shortened differently from the JSON name.
ExifTool prints a warning for each sidecar it cannot open. Save that Terminal output so you know which files still carry the download date.
Writing GPS from geoDataExif
Takeout stores two locations. geoDataExif is the GPS your camera recorded; geoData is the location shown in Google Photos, which may be estimated or added by hand. Prefer geoDataExif and add the reference tags so southern and western coordinates keep their sign:
"-GPSLatitude<GeoDataExifLatitude" "-GPSLatitudeRef<GeoDataExifLatitude" "-GPSLongitude<GeoDataExifLongitude" "-GPSLongitudeRef<GeoDataExifLongitude" "-GPSAltitude<GeoDataExifAltitude"Watch out for 0.0: a latitude and longitude of 0.0, 0.0 means "no location". Copy it blindly and those photos land in the Gulf of Guinea on the map. Check the JSON before copying GPS, or fall back to geoData only when it holds a real location.
How do you handle videos and time zones?
Photos: EXIF has no time zone
EXIF DateTimeOriginal is a plain local time such as 2019:07:14 18:30:00. The JSON timestamp is UTC, and with -d %s ExifTool converts it using your Mac’s current time zone, not the time zone where the photo was taken. Photos from a trip abroad can be several hours off. Writing OffsetTimeOriginal as well makes the intended offset explicit.
Videos: QuickTime dates should be UTC
For MP4 and MOV, the QuickTime CreateDate is defined as UTC. Add -api QuickTimeUTC=1 so ExifTool writes it correctly, as discussed on the ExifTool forum. Without it, Apple Photos may show your 2016 videos at the wrong hour.
ExifTool vs a dedicated Mac app
| ExifTool | MetaData Recover | |
|---|---|---|
| Interface | Terminal commands | Mac app with live progress |
| Cost | Free, open source | $9.99 one-time on the Mac App Store |
| Zip files | Unzip and merge first | Reads Takeout zips and folders directly |
| Truncated names | Needs custom expressions | Matches media and JSON even when names are truncated |
| Time zones | Manual options per run | Converts UTC to local capture time |
| Unmatched files | Warnings in Terminal output | Moved to an Errors folder with a log entry |
| Privacy | Runs locally | Runs 100% locally |
If you are comfortable in Terminal and your export is small, ExifTool is a fine choice. If you would rather drag in several zip parts and get dates, GPS, titles and descriptions restored in one pass, MetaData Recover does that on macOS 13.5 or later. It handles JPG, HEIC, PNG, WebP, common RAW formats, MP4 and MOV, and skips duplicates so nothing is processed twice.
Frequently asked questions
Does ExifTool work with Google Takeout JSON?
Yes. ExifTool can read Takeout JSON files as a tag source with -tagsfromfile, but the command has to match each photo to its sidecar name, which is the hard part with newer exports.
Why doesn’t ExifTool fix my edited photos?
-edited copies usually have no JSON of their own, so a name-based command finds nothing to read. You need to point those files at the original’s JSON.
Can ExifTool write GPS from the JSON?
Yes. Copy GeoDataExifLatitude and GeoDataExifLongitude into GPSLatitude, GPSLongitude and their reference tags, and skip files where both values are 0.0.
Is ExifTool safe to run on my originals?
ExifTool is reliable, but -overwrite_original replaces each file without a backup. Run it on a copy of your Takeout and keep the original zip files until you have checked the results.
