Pacix Labs

Photos

How to Merge Google Takeout JSON Files to Photos (Fix Wrong Dates)

Google Takeout keeps your photo dates in separate JSON files. Four free tools merge them back: what each one fixes, the exact commands, and how to check.

· 7 min read

Also available in: العربيةবাংলাDeutschespañolfrançaisગુજરાતીहिन्दीIndonesiaitaliano日本語ಕನ್ನಡ한국어मराठीpolskiportuguêsрусскийKiswahiliதமிழ்తెలుగుไทยTürkçeукраїнськаاردوTiếng Việt中文

You downloaded your Google Photos library with Google Takeout. Now you have thousands of photos next to thousands of .json files, and your photo viewer says a picture from 2019 was taken yesterday. To fix this, you merge each JSON file back into its photo. A tool reads the date taken from the JSON file and writes it into the photo, so every app shows the right date again.

This guide explains why the JSON files exist, why the merge sometimes fails, and how four free tools do the merge. You get the exact command for each one, which date each one changes, and a way to check the result before you delete anything.

Why your photos come with JSON files

For every photo, Takeout gives you two files: the image, for example IMG_1234.jpg, and a JSON file with the original date, GPS coordinates, description and album membership. One export guide describes the typical first look: a photo from 2019 showed "yesterday" as its date, with no location and no album, although nothing was lost. The information was in the JSON file (PixelUnion). Illinois Tech gives the same explanation for why an export has more files than your library has pictures (Illinois Tech).

The photo file can disagree with the JSON file. The author of google-photos-exif noticed that if you change a date inside Google Photos, the metadata inside the image is not updated: the new date is only in the JSON file. Some images, often ones shared with you, have no date inside at all (google-photos-exif). The gphotos-takeout-repair README shows the other half of the problem: in an extracted export, the photo, its edited version and the JSON file all show the Takeout export date as their date created (gphotos-takeout-repair).

So an app that reads only the photo file sees either no date or the day you exported. The right date is in the JSON file, and the merge puts it back.

Three things that break the merge

Every merge tool has to find the right JSON file for each photo. Three details of Takeout make that harder.

  1. A photo and its JSON file can be in different zips. Ente's migration FAQ gives the example of flower.jpeg in one zip and flower.json in another, which stops the two from being matched (Ente). The Porte README lists the same case as a known limitation: it does not find metadata files that are in a different archive from their image (Porte).
  2. The JSON file names are not consistent. For IMG123.jpg you may get IMG123.jpg.json or just IMG123.json, and some folders contain JSON files with no matching image (google-photos-exif).
  3. Edited photos come out twice. Takeout exports the original and the edited copy as separate files with different hashes, so a duplicate finder that compares hashes does not flag them (Ente). The edited file carries an -edited suffix, as in IMG_0001-edited.jpg next to IMG_0001.jpg (gphotos-takeout-repair).

The fix for the first point is the same for every tool: download every zip, then extract all of them into one parent folder and keep the subfolders as they are (Ente). If two zips contain a folder with the same name, merge the contents of the folders instead of replacing one with the other (google-photos-exif).

One tip from Illinois Tech for the download: keep the Takeout window in front. If you minimize it or work in another window, downloads fail after 15 minutes because Google asks you to sign in again (Illinois Tech).

Four free tools and the date each one fixes

A photo has two kinds of date. The EXIF date (DateTimeOriginal) is stored inside the image and travels with it to any app or service. The file date (modified or created) belongs to the file system. It is easy to lose: the gpth README warns that moving files on an Android phone usually resets it (gpth). Before you pick a tool, check which of the two it writes.

In every command below, the first folder is your extracted Takeout and the second is a new, empty output folder.

Porte: writes the date and location into the photo

Porte copies the timestamp and geolocation from the related JSON file into the image's EXIF data, without recompressing the image. If it finds no date, it tries the file name, and it uses the earliest date it finds so that a file-modification date is not taken as the capture date. It copies files to the output folder instead of changing them in place, puts failed files in a separate folder and saves a log. It does not keep album data. You can download a ready-made program from the project's releases page (Porte):

porte srcpath destpath

google-photos-exif: fills in a missing EXIF date

This Node.js tool reads photoTakenTime from each JSON file. It sets the file's modified date, and it fills in DateTimeOriginal only when the photo does not already have one. Files it cannot process go to an error folder (google-photos-exif). The PixelUnion author used it and reports that it processed the whole library in about twenty minutes (PixelUnion).

yarn start --inputDir ~/takeout --outputDir ~/output --errorDir ~/error

gpth: sorts into one folder or by month, then sets the file date

Google Photos Takeout Helper is interactive: you run it and answer its questions. It collects every photo into one folder, or into folders by month with the --divide-to-dates option, and sets the file's last-modified date. Writing JSON data back into EXIF is still on its to-do list, so its README gives an extra exiftool command that copies the file date into the EXIF dates for photos that have none. Run that command before you touch the files again. Note that gpth moves files by default, so keep your original zips (gpth).

exiftool -overwrite_original -r -if 'not defined DateTimeOriginal' -P "-AllDates<FileModifyDate" "your/output/folder/ALL_PHOTOS/"

gphotos-takeout-repair: removes the JSON files and edited duplicates

This tool copies your photos to a new folder, keeps the folder structure, and sets each file's date created from photoTakenTime in the JSON file. Where an -edited copy exists, it keeps that version (usually the best one) and leaves out the original, so the output has no JSON files and no edited duplicates (gphotos-takeout-repair). Install it with npm install -g gphotos-takeout-repair, then:

gphotos-takeout-repair --src ./unzipped-takeout-dir --dest ./output-dir

If you want the date inside the image for every photo, Porte writes it directly. With the other three, check the EXIF date afterwards, as shown below.

Check that the dates are really in the photos

Do not trust the file browser's "date modified" column. Check the metadata itself.

  1. Without extra software: right-click a photo and choose Get Info on a Mac or Properties on Windows. After a good merge you should see the right date taken, the GPS coordinates if the photo had them, and the camera model where available (PixelUnion).
  2. For a whole folder: ExifTool can print the DateTimeOriginal tag for every JPG in a folder. This line is based on an example in its documentation (ExifTool):
exiftool -DateTimeOriginal -S -s -ext jpg .

An empty line or a date from the week of your export means that photo was not merged. Then look at the tool's error or failed folder, and check whether the matching JSON file came from another zip.

  1. Compare counts. The output folder plus the error folder should hold about as many photos and videos as the extracted Takeout, minus the edited duplicates if your tool removes them.

A one-click alternative

If you do not want to use the command line, a desktop app can do the same job. PHOTOK is a Pacix Labs product. According to its page, it reads the .json files Google scatters around and puts the real dates and places back, then sorts the photos into Year / Month / Place folders and sets exact duplicates aside. It runs on Windows 10 and 11 and on Macs with an Apple chip, works without uploading anything, and never deletes files. The preview is free, and the full version costs €49 as a one-time payment (PHOTOK).

Whichever route you choose, the free tools above or an app, the same rules apply: work on a copy, check a sample, and keep the zips.

Checklist

  • Download every zip and keep a copy on a second drive.
  • Extract all zips into one parent folder, keep the subfolders, merge folders with the same name.
  • Choose a tool and know which date it writes: EXIF date, file date or both.
  • Run it on a copy, into a new output folder.
  • Check DateTimeOriginal on a sample from different years, and look in the error folder.
  • Decide what to do with -edited copies.
  • Delete the JSON files and zips only after the check and a second backup.

Frequently asked questions

Why does Google Takeout give me JSON files with my photos?

Google stores the date taken, location, description and album information it knows about each photo in a separate .json file next to the photo. The photo file itself may not contain the same information, for example if you changed the date inside Google Photos.

Can I delete the JSON files?

Only after the dates and places are inside the photos and you have checked a sample. Before that, the JSON file is the only place where Google's date and location for the photo are stored.

Which date does a merge tool fix?

It depends on the tool. Some write the date into the photo's EXIF metadata (DateTimeOriginal), which travels with the file. Others set only the file's modified or created date, which some copy methods reset. Read the tool's README before you choose.

Why are some photos still wrong after the merge?

Usually the photo and its JSON file were in different zip files and were never put back together, or the JSON file has a different name from the photo. Extract all zips into one folder, run the tool again on a fresh copy, and look at the tool's error or failed folder.

Do I need to keep the original zip files?

Yes, until the merged library has been checked and you have another backup. Some tools move files instead of copying them, and the zips are your only way to start again.

Sources