If a JPG won't open, the problem is rarely damage. Many files that look like JPEGs are WebP images downloaded from websites, or HEIC photos from a phone. Only the suffix has been changed to .jpg. You saved what you thought was a JPG, but the file is actually a WebP. Renaming it does not make it open in a JPEG viewer. Running a repair tool does nothing, because the bytes inside are not corrupted. Here is how to check the real format on any operating system and what to do next.
Why a JPG Might Really Be a WebP or HEIC
When you right-click and save an image from a website, you get whatever the server sent. Many sites serve WebP images to browsers that support them, even when the page URL ends in .jpg. You end up with a file named photo.jpg that is actually a WebP. A phone may save HEIC photos. Move them to a PC and they might get renamed to .jpg during transfer, or through a careless rename. In both cases, the file suffix lies about what is inside.
Changing a suffix does not convert a file. The bytes inside stay in the original format. A WebP is not a JPEG. A HEIC is not a JPEG. When you try to open a mislabelled file, the viewer looks for JPEG data, finds none, and reports an error that sounds like corruption.
Check the File Signature
To know what a file really is, look at its signature, the first few bytes. These bytes are the same regardless of the name or suffix.
- A JPEG begins with the hexadecimal bytes FF D8 FF.
- A WebP begins with the ASCII text RIFF, then four size bytes, then the text WEBP.
- A PNG begins with 89 50 4E 47 (which reads as \x89PNG in text).
- A HEIC file is an ISO base media file, so bytes 4 to 11 read ftypheic or a related brand such as ftypmif1.
Starts with RIFF and contains WEBP? It is a WebP, no matter what the suffix says. Starts with ftyp? It is a HEIC or similar media file.
How to Check the Real Format on Windows
Show File Name Suffixes
First, make sure you can see the full file name. In Windows 11, open File Explorer, go to the View menu, and tick File name extensions. This shows whether the file really ends in .jpg or actually ends in .webp or .heic. Check this right now: the file is named image.jpg but the suffix is hidden, and it is actually image.webp.
Use a Hex Viewer or Notepad
To see the file signature, open the file in a hex viewer or even in Notepad. Notepad is not a hex editor, but it shows the text near the start of the file. See RIFF or WEBP as readable text? The file is a WebP. See ftyp at the start? It is a HEIC. See \x89PNG or the letters PNG? It is a PNG. If the file opens in Notepad and shows something like , then it is not an image at all. It is an HTML error page saved with a .jpg suffix.
How to Check the Real Format on Mac and Linux
On Mac and Linux, use the command line. Open a terminal and run:
file image.jpg
The file command reads the signature and prints the real format. It will say something like “Web/P image”, “ISO Media, HEIF”, or “JPEG image data”. This works on any file, regardless of the suffix. A hex editor or a text editor that shows the first bytes also works, but the file command is the quickest route.
What to Do When Your JPG is Actually a WebP or HEIC
The fix for a mislabelled file is to rename it with the correct suffix or convert it properly. Running a repair tool will not help. The file is not corrupt; it is simply in the wrong container.
- Identify the real format using the signature check above.
- Rename the file so the suffix matches the real format. Change image.jpg to image.webp or image.heic. On Windows, make sure file name suffixes are visible before renaming.
- Open the renamed file in an application that supports that format. Most modern image viewers and browsers open WebP. HEIC requires compatible software, usually available on the same platform that created the file (a Mac or a recent iPhone, for instance).
- If you need a JPEG, convert the file properly. Open it in a photo editor that supports the original format and export it as JPEG. Do not just change the suffix again.
If the file is an HTML error page (starts with ), it is not an image. Delete it and download the image again from the source, using a direct image link.
Why Renaming a WebP to JPG Won't Open it
Rename a WebP file to .jpg and the suffix changes. The bytes inside do not. The JPEG viewer reads the first bytes, sees RIFF instead of FF D8 FF, and rejects the file. The error message might say “not a JPEG file” or “corrupt”. The file is fine. It is just not a JPEG. The same applies to renaming a HEIC to JPG. The only way to make it a JPEG is to convert it with a proper converter, not to change the suffix.
This is why “jpg not a jpeg file” turns up in web searches. The file is not a JPEG, so no amount of repair will make it one. Accept the original format or convert it.
Preventing the Problem Next Time
To avoid this, check the file suffix before you save an image from a website. If your browser supports WebP, the saved file might carry a .webp suffix, but some sites still name it .jpg. After saving, verify the signature quickly using the methods above.
For phone photos, be aware of HEIC. Transfer a HEIC file to a PC and it may arrive as .jpg. It will not open as a JPEG. Check the signature, rename it to .heic, and use compatible software.
If you have tried all this and the file still does not open, and you are certain it is a genuine JPEG (starts with FF D8 FF), then it might actually be corrupted. In that case, a repair tool could help. The site jpeg.repair offers an online option for recovering corrupted JPEG files, free and without watermark. But first, make sure the file is really a JPEG, not a WebP or HEIC in disguise.