“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 fromWhat it really isWhy the form says no
iPhone cameraHEIC (or HEIF)Many forms accept only JPEG; HEIC is a different format
Screenshot, edited picture, downloaded logoPNGA JPG-only form rejects PNG, even if you renamed it to .jpg
Saved from a website or WhatsApp WebWebPWebP is newer and many forms do not list it
Saved on Windows from a browserJPEG with a .jfif endingThe inside is JPEG, but the form only checks for .jpg or .jpeg
Renamed by handphoto.jpg.png or photo.JPG with a spaceThe real ending is not .jpg, or the form is strict about the name
Scanned from a printer appPDF or a multi-page fileAn image field does not accept documents

How to see the real format

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

  1. Open the image resizer to KB and select the photo, whatever its format: JPG, PNG, WebP or iPhone HEIC.
  2. 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.
  3. If the form also states pixels, open Advanced and enter the width and height.
  4. Press the green button and download. The result is always a real JPEG with a plain .jpg ending, such as 1-photo-50kb.jpg.
  5. 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.
Our test (November 29, 2026). We gave the resizer three problem files with the box set to 50KB. A PNG renamed to 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

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.