How to Open a JSON Image File (It Is Not an Image)
How to open a JSON image file: it is text, not a picture. Open it in Notepad or TextEdit to read the photo's date and place. Windows, Mac and phones.
A JSON "image file" is not an image. It is a small text file that holds information about the photo next to it, so an image viewer cannot open it. Open it in a text editor, such as Notepad on Windows or TextEdit on a Mac, and you see the photo's date, place and caption as text.
Most people meet these files in a Google Takeout export. Next to IMG_2044.jpg there is IMG_2044.jpg.json or IMG_2044.jpg.supplemental-metadata.json. The name ends in .jpg something, so it looks like a picture, and double-clicking it gives an error or opens a browser. Nothing is broken. The file just is not what its name suggests.
What a JSON image file is
JSON is a plain-text format for data. Google Photos uses it to export what it knows about each photo: when it was taken, where, the caption you typed, the original filename. The picture itself is the .jpg, .heic or .mp4 file beside it. The .json file is its sidecar.
The name tells you which photo it belongs to. IMG_2044.jpg.supplemental-metadata.json belongs to IMG_2044.jpg. Google cuts long sidecar names at 46 characters before .json, so some names end in a shortened word, such as supplemental-metad.json. That is still a normal sidecar.
How to open it on Windows
- Right-click the
.jsonfile. - Choose Open with, then Notepad. If Notepad is not in the list, choose "Choose another app" and select it there.
- Read the text. Close Notepad without saving.
Windows may also offer a browser, such as Edge. A browser opens JSON too and often shows it in a tidy, folded view. Either works. Do not set the Photos app as the default for .json files; it cannot read them.
How to open it on a Mac
- Right-click (or Control-click) the
.jsonfile in Finder. - Choose Open With, then TextEdit.
- Read the text, and close TextEdit without saving.
You can also select the file and press the Space bar. Quick Look shows the text without opening any app.
How to open it on a phone or tablet
On Android, open the file from the Files app; most versions offer a text viewer or ask which app to use. On an iPhone or iPad, the Files app shows a preview of the text when you tap the file. If a phone only offers photo apps, the file is still fine; use a computer instead.
What you see inside
A Google Photos JSON file looks roughly like this, shortened:
{
"title": "IMG_2044.jpg",
"description": "Grandma's 80th",
"photoTakenTime": {
"timestamp": "1531741387",
"formatted": "Jul 16, 2018, 11:43:07 AM UTC"
},
"geoData": {
"latitude": 41.9028,
"longitude": 12.4964
}
}
titleis the original filename.descriptionis the caption you typed in Google Photos.photoTakenTimeis the date the photo was taken. Thetimestampis the number of seconds since 1 January 1970, in UTC; theformattedline is the same moment in readable form, also in UTC.geoDatais the location. Zeros mean "no location", not a place in the ocean.
There is also a creationTime, which is the upload date, not the date taken. photoTakenTime explained shows how to read and convert the numbers, and What are JSON files in Google Takeout? goes through every field.
Why your photo shows the wrong date
This is usually why people open these files in the first place. The photo shows the day you downloaded it, and the JSON file shows the real date. Both are correct about what they hold.
Your computer, your phone and apps such as Apple Photos read the date inside the image file. For many Takeout photos that date is missing, so they show the file date, which is the day you unzipped the export. They never look at the .json file. Why Takeout photos have the wrong date explains the cause.
Opening the JSON file shows you the right date, but it does not fix the photo. To fix it, the date has to move from the .json file into the photo.
Should I edit or delete the JSON file?
Do not edit it. There is no reason to change the text, and a small typo can make it unreadable for the tools that use it.
Do not delete it yet either. For many photos it is the only copy of the date and place. First write its data into the photo, then check a few photos, and only then remove the .json files. Can I delete JSON files from Google Takeout? has the details.
How to use all of them at once
Opening one JSON file is easy. Copying the date from ten thousand of them into ten thousand photos by hand is not. Two routes do it in one run:
- exiftool, a free command-line program. One command copies
photoTakenTimeinto each photo's EXIF. It needs extra steps for shortened names and(1)duplicates. Merge Google Takeout JSON files to photos has the command. - A desktop app, if you prefer no command line.
Takeout JSON Metadata Fixer is such an app, for Mac and Windows.
It reads every .json file in your export, finds its photo even when Google shortened the name, and writes the real date, time and GPS into the photo. It sets the file dates to match, so Explorer and Finder sort correctly too. It can also write the caption into the photo, rename files by date and place, and sort them into folders. Everything runs on your computer, and the first 500 photos are free.
Frequently asked questions
Why can't I open a JSON file from Google Photos?
Because it is not an image. Photo viewers only open pictures. Use a text editor, a browser, or Quick Look on a Mac.
Is a JSON file a virus?
A JSON file from your own Google Takeout export is plain text. It contains no program and cannot run by itself.
Can I convert a JSON file to a JPG?
No. The JSON file holds no picture to convert. The picture is the file next to it with the same name. If that picture is missing, it is in another part of the export; see Google Takeout missing photos.
Can Google Photos read the JSON file again?
No. If you upload the photos back to Google Photos, it ignores the .json files and uses the date inside each photo.
What program opens JSON files by default?
None that shows a picture. On Windows, Notepad or a browser. On a Mac, TextEdit or Quick Look. Any code editor opens them too.