PhotoFixer

Google Takeout JSON Files Explained

By Josep Mampel Marques, updated

The .json files in a Google Photos Takeout are sidecars: one small text file per photo or video with what Google Photos knows about it. The useful fields are title (the original file name), description, photoTakenTime (when the photo was taken, in UTC) and geoData (latitude and longitude, or 0.0 when there is no location). Google's help says only that extra information goes into a separate JSON file; the field details below come from published samples and open source tools. To write these values back into your photos, use PhotoFixer.

A typical sidecar

This is the shape of a sidecar, based on a sample published on the PhotoStructure forum (the title and view count are illustrative). Newer exports can contain more fields, and the exact set may vary:

{
  "title": "IMG_1234.jpg",
  "description": "",
  "imageViews": "3",
  "creationTime": { "timestamp": "1596250831", "formatted": "Aug 1, 2020, 3:00:31 AM UTC" },
  "photoTakenTime": { "timestamp": "-725791800", "formatted": "Jan 1, 1947, 3:10:00 PM UTC" },
  "geoData": { "latitude": 0.0, "longitude": 0.0, "altitude": 0.0, "latitudeSpan": 0.0, "longitudeSpan": 0.0 },
  "geoDataExif": { "latitude": 0.0, "longitude": 0.0, "altitude": 0.0, "latitudeSpan": 0.0, "longitudeSpan": 0.0 }
}

The fields that matter

FieldWhat it holds
titleThe full original file name. It is the most reliable way to match a sidecar to its photo when the names were shortened.
descriptionThe caption you typed in Google Photos. Empty if you never added one.
photoTakenTimeWhen the photo was taken. timestamp is seconds since 1 January 1970 UTC (negative for older dates), and formatted is the same moment written out in UTC.
creationTimeA second date that, judging from samples, is when the item was added to Google Photos. It is not the capture date.
geoDataLatitude, longitude and altitude. All zeros means no location.
geoDataExifThe same structure. Google does not document the difference; by its name it appears to hold the location found in the file's own EXIF.

Because the timestamps are UTC, turning them into a photo date needs a time zone. A photo taken at 3 PM in New York is stored as 7 PM or 8 PM UTC, depending on daylight saving time.

How sidecars are named

The basic rule is the photo's full name plus .json: IMG_1234.jpg has IMG_1234.jpg.json. In practice there are several exceptions, documented by the authors of open source tools rather than by Google:

Album folders can also contain JSON files that describe the album rather than a photo. They are not sidecars and can be ignored when matching.

Why matching is the hard part

A simple script that looks for name + ".json" works for most photos and quietly skips the rest: long names, duplicates, edited copies and the newer suffix. Those are often the photos that need the fix most, such as images with long app-generated names. Reading the title field and applying the naming rules above is what makes the match complete. A photo and its sidecar can also sit in different zip parts, so a tool has to see all parts at once.

Using the .json files

  1. Keep the zip parts from Takeout as they are. See how to download Google Photos with Takeout.
  2. Open PhotoFixer and choose every part. It matches each photo to its sidecar using the title and the naming rules, including supplemental-metadata, truncated names, (1) duplicates and edited copies.
  3. Pick the time zone, press Fix my photos and check the summary, which shows how many photos and videos were found and how many were matched to their .json.
  4. JPEG photos without EXIF get the date, location and description written in. Videos get their creation date. Every file gets its capture time as the file date.

GooglePhotosTakeoutHelper reads the same files from the command line or its interactive mode, and immich-go reads them while uploading to Immich. Both are good alternatives; see Google Photos to Immich.

FAQ

Can I delete the .json files from Google Takeout?

Only after their information has been written into the photos. They hold the date Google Photos shows, the location and the description. Once a tool has copied those into the files, the .json files are no longer needed by most photo apps.

How do I open a Google Takeout .json file?

Any text editor or a web browser opens it. Google's help notes that JSON files can be opened with text editors. The file is short: a title, a description, a few timestamps and location values.

Why does geoData say 0.0?

In Takeout sidecars, latitude and longitude of 0.0 mean there is no location, not a place in the Gulf of Guinea. Tools that restore locations should ignore 0,0 values.

Sources