“Invalid File Format – Only JPG/JPEG Allowed”: Why a Photo Is Rejected and How to Fix It
By Yasir, Lahore · Published November 29, 2026 · Last reviewed November 29, 2026 · All guides
You pick your photo, press upload and the form answers with “Invalid file format”, “Only JPG, JPEG files are allowed” or “File type not supported”. Often the file even looks like a JPG in your gallery. The form is not being random: it checks either the file name ending, the file type your browser reports, or the first bytes inside the file, and one of those does not say JPEG.
Below are the six causes we see most, how to tell which one you have, and one fix that works for all of them: saving a fresh, genuine JPG.
Which cause do you have?
| Where the photo came from | What it really is | Why the form says no |
|---|---|---|
| iPhone camera | HEIC (or HEIF) | Many forms accept only JPEG; HEIC is a different format |
| Screenshot, edited picture, downloaded logo | PNG | A JPG-only form rejects PNG, even if you renamed it to .jpg |
| Saved from a website or WhatsApp Web | WebP | WebP is newer and many forms do not list it |
| Saved on Windows from a browser | JPEG with a .jfif ending | The inside is JPEG, but the form only checks for .jpg or .jpeg |
| Renamed by hand | photo.jpg.png or photo.JPG with a space | The real ending is not .jpg, or the form is strict about the name |
| Scanned from a printer app | PDF or a multi-page file | An image field does not accept documents |
How to see the real format
- Android: open the photo in the Files app (not the gallery), tap the three dots, then File info or Details. The name ending and type are shown there.
- iPhone: in Photos, swipe up on the picture. The info panel shows HEIF or JPEG next to the camera details.
- Windows: in File Explorer choose View → Show → File name extensions. A hidden ending like
.pngor.jfifbecomes visible. - Mac: select the file and press Command + I; look at Kind.
Renaming a file does not change what is inside it. A PNG called photo.jpg is still a PNG, and stricter upload systems read the first bytes of the file and notice. A real JPEG always starts with the bytes FF D8.
The fix: save a genuine JPG
- Open the image resizer to KB and select the photo, whatever its format: JPG, PNG, WebP or iPhone HEIC.
- Keep Compress (make smaller) and type the KB limit your form shows, for example 50. If the form gives no limit, type a number a little smaller than the current file size.
- If the form also states pixels, open Advanced and enter the width and height.
- Press the green button and download. The result is always a real JPEG with a plain
.jpgending, such as1-photo-50kb.jpg. - Upload that downloaded file. On a phone, choose it from Files or Downloads rather than the gallery, so the browser does not convert it again.
png-renamed.jpg (984.7KB) came out as 1-png-renamed-50kb.jpg, 48.8KB, starting with the JPEG bytes FF D8. A WebP picture (498.8KB) became a 48.4KB JPG. A 51.3KB JPEG saved as .jfif became 1-small-real-jpeg-50kb.jpg at 48.4KB.👉 Open the image resizer to KB
One catch with .jfif and small JPEG files
If your file is already a real JPEG and already below the number you type, the resizer leaves it untouched to protect its quality — and that includes its original name. In our test, the same 51.3KB .jfif file with 60 in the box came back unchanged as 1-small-real-jpeg.jfif. To force a fresh .jpg, type a number slightly below the file’s current size (50 for a 51KB file), or enter the width and height the form asks for. You can also simply rename .jfif to .jpg: here, unlike with PNG, the inside already is JPEG.
Fixes for each device
iPhone: stop new photos being saved as HEIC
Go to Settings → Camera → Formats and choose Most Compatible. New photos are then saved as JPEG. Photos you already took stay HEIC, so convert those with the resizer or read our HEIC to JPG guide.
Android: screenshots and edited photos
Screenshots and many editing apps save PNG. Take the original camera photo instead, or run the PNG through the resizer, which saves JPG.
Windows: browser downloads ending in .jfif
Turn on file name extensions (see above), then either rename .jfif to .jpg or re-save it with the resizer.
What not to do
- Don’t just rename PNG, WebP or HEIC to .jpg. The form may accept the name and then fail later, or show a confusing size error.
- Don’t use a screenshot of the photo. It is usually PNG, has the wrong pixel size and includes parts of the screen.
- Don’t send the photo to yourself on a chat app. It gets recompressed and sometimes changed to WebP.
- Don’t put dots, slashes or emoji in the file name. Keep it short, like
photo.jpgorsignature.jpg.
Related problems
If the format is accepted but the size is not, read why a photo that looks the right size is rejected. For a PNG you made yourself, PNG to JPG explains when the switch is worth it. In Roman Urdu, photo ko JPG mein kaise convert kare covers the same steps.
CompressPicOnline is an independent free tool and is not connected to any exam board, employer or government portal. Always follow the file rules stated on your own form.
Frequently asked questions
Why does the form say invalid format when my file ends in .jpg?
The name may say .jpg while the file inside is PNG, WebP or HEIC, for example after someone renamed it. Strict upload systems read the first bytes of the file. Save a fresh JPG with the resizer and upload that.
Is JPEG the same as JPG?
Yes. .jpg and .jpeg are two endings for the same format. A form that asks for JPEG accepts a .jpg file, although a few strict forms only check one spelling of the ending.
What is a .jfif file?
It is a JPEG image with a different ending that Windows and some browsers use when you save a picture. Renaming it to .jpg is enough, or re-save it with the resizer to get a .jpg file.
How do I change an iPhone photo from HEIC to JPG?
Select the HEIC photo in the image resizer to KB and download the result, which is always JPG. To get JPG for new photos, set Settings, Camera, Formats to Most Compatible.
Does CompressPicOnline upload my photo to convert it?
No. The conversion and compression happen inside your browser, and the photo is never sent to our server.