Image File Formats: JPG vs PNG vs WebP vs AVIF
Image file formats in plain English: which of the five common web formats suits your picture, with a table comparing them side by side.
By Mudasir Ahsan (Founder) · · Updated · 12 min read
Facts checked against official sources on
On this page
Of all the image file formats you'll meet online, five do nearly all the work. JPG is for photos that have to open anywhere, and PNG is for screenshots, logos and transparency. WebP makes smaller photos and graphics. AVIF, the newest, often makes the smallest files, and GIF hangs on for simple animations. For the web, WebP is a strong default because every current major browser supports it. Send a JPG when a photo has to work everywhere, keep a PNG when every pixel must stay exact, and swap a large GIF for an animated WebP or a short video.
Photo: Helena Jankovičová Kováčová on Pexels
Lossy vs lossless in one paragraph
Every image format compresses pixels to save space, and it does so in one of two ways. Lossless compression shrinks the file but hands back every pixel exactly as it was, which suits screenshots and logos. Lossy compression throws away detail people are unlikely to notice. Photos get far smaller that way. They also degrade a little each time you re-save them. Some formats are only one or the other, and the newer ones can do both. Nearly every strength and weakness below follows from which side a format sits on. Our explainer on lossy vs lossless compression has side-by-side measurements.
JPG / JPEG
JPEG has been the standard photo format for decades. The MDN image format guide calls it "currently the most widely used lossy compression format for still images." You'll see the extension written .jpg and sometimes .jpeg. That's a difference in the name only.
Nothing refuses a JPG. Every browser, phone, computer, printer and email client opens one. Photos suit it, with their smooth gradients and natural texture, and a quality setting lets you trade file size against detail.
Its weaknesses all come from being lossy only. Each re-save loses a little more detail. Transparency isn't supported, so transparent areas turn into a solid background. Text and sharp edges pick up halos and blocky artifacts, and that's why a screenshot saved as a low-quality JPG has fuzzy letters. Use PNG for those, or WebP at a reasonable quality.
Choose JPG for photos you need to send anywhere, upload to forms, print or attach to emails. Our guide to JPG vs PNG covers that common choice in more depth.
PNG
PNG (Portable Network Graphics) is lossless and supports full transparency. MDN says it is preferred over JPEG "for more precise reproduction of source images, or when transparency is needed."
What you save is exactly what you get back, so text and thin lines stay crisp and flat colors stay flat. Alpha transparency handles soft edges and semi-transparent shadows too.
Size is the price. A photo saved as PNG is often several times larger than a JPEG of the same picture. People still save photos as PNG "for quality", and what they get is that bigger file with no visible benefit on screen. PNG has no lossy setting of its own. Tools that shrink PNGs usually reduce them to a palette of fewer colors first, and that step is lossy.
Animation is possible as well, under the name APNG. MDN lists APNG support in Chrome, Edge, Firefox, Opera and Safari, though an animated WebP is usually smaller.
Reach for PNG with screenshots of text and interfaces, logos, icons, diagrams, and anything that needs a transparent background when WebP isn't an option.
WebP
Google developed WebP as one web format that could do almost everything: lossy and lossless compression, transparency and animation. MDN calls it an "excellent choice for both images and animated images" and lists support in Chrome, Edge, Firefox, Opera and Safari. On a Mac, WebP in Safari needs Safari 14 or later and macOS Big Sur or later.
For photos it's usually smaller than JPEG, and for graphics it's much smaller than PNG. Transparency survives in both lossy and lossless modes. Animated WebP is a better replacement for GIF.
Three things count against it. Not every desktop app, older photo editor or online form accepts it yet. MDN gives its maximum size as 16,383 × 16,383 pixels, smaller than JPEG's limit, which only matters for very large panoramas and scans. And lossy WebP, like JPEG, shouldn't be re-saved over and over.
How much smaller WebP is, measured
"WebP is smaller" holds most of the time. It doesn't hold every time. We put our test images through our upload pipeline at quality 75, once kept in their original format and once converted to WebP. Our pipeline stores images at up to 1920 px on the longest side, so the photos were 1920 px wide in both versions.
| Sample | Kept in original format | WebP, quality 75 | WebP compared |
|---|---|---|---|
| Landscape photo, 4032 × 2623 JPG | 84 KB | 55 KB | 34.5% smaller |
| Flower photo, 3000 × 2000 JPG | 370 KB | 301 KB | 18.5% smaller |
| Photo, 3024 × 2016 JPG | 374 KB | 566 KB | 51.2% larger |
| Screenshot, 1366 × 900 PNG | 730 KB | 108 KB | 85.3% smaller |
Look at the third row. That photo went through the same pipeline at the same quality number as the others, and it came out 51.2% larger as WebP. The screenshot went the other way and dropped from 730 KB to 108 KB. Screenshots and graphics saved as PNG gain the most. Photos gain less, and now and then one loses, so compare the two files before you commit to WebP.
WebP earns its place for images on websites and blogs, screenshots you share by link, and short animations. Our explainer What is WebP? covers how to open and convert WebP files.
AVIF
AVIF (AV1 Image File Format) is the newest widely supported format. It stores images with the AV1 video codec inside a HEIF container. MDN says it offers "much better compression than PNG or JPEG with support for higher color depths, animated frames, transparency," and lists browser support from Chrome 85, Edge 121, Opera 71, Firefox 93 and Safari 16.1.
At a given visual quality AVIF often gives the smallest file, especially for photos. It supports transparency, animation, high bit depth and HDR. It's royalty-free too.
Newer means patchier. Desktop software and upload forms accept AVIF less often than WebP, and so do older devices. Encoding is slower, which matters when you convert large batches. There's no progressive rendering either. MDN notes that an AVIF file must be fully downloaded before it's displayed, although the small size usually makes up for that.
Because of that gap in support, MDN recommends a fallback format when you use AVIF on a website, for instance with the HTML picture element. So AVIF fits websites where you control the HTML and can provide the fallback, and photo-heavy pages where every kilobyte counts. We compare the two newer formats in detail in AVIF vs WebP.
PictureToLink accepts AVIF uploads and keeps them as AVIF unless you choose to convert to WebP or JPG. One limit of ours belongs here. Animated AVIF files are stored as a still image, so use GIF or animated WebP for animations.
GIF and animated images
GIF dates from 1987 and is still everywhere thanks to reaction animations and memes. Technically it's lossless. MDN explains, though, that each pixel is an index into a palette of at most 256 colors, and a full-color image has to be squeezed into that palette first. That squeeze is why GIFs of video clips look grainy or banded.
It also explains a common mistake. Converting a GIF to PNG to "improve" it changes nothing you can see, because the 256-color limit has already done its damage and PNG can't add back lost colors.
A GIF plays everywhere, including email clients and old software, and it animates without a player. Against that, it's limited to 256 colors per frame (fewer looks worse). Each pixel is either fully transparent or not at all, so there are no soft edges. Animations are very large for what they show.
MDN suggests preferring PNG for still images and "WebP, AVIF or APNG for animation sequences." Where a site allows it, a short MP4 video is often far smaller still. In our tests, converting a small sample GIF (480 × 270) to animated WebP with our upload pipeline cut it from 52 KB to 21 KB, a 60.2% saving, with the animation intact. To share a GIF as a link, our GIF to URL tool keeps it animated.
Other formats you may meet
HEIC (also called HEIF) is the default photo format on recent iPhones. The files are small, but many websites and Windows apps can't open them. Convert to JPG before uploading to a site that refuses HEIC, which our HEIC to JPG converter does, or use the HEIC to PNG converter if you plan to keep editing. The PictureToLink uploader accepts HEIC photos and converts them to JPG in your browser before they upload.
SVG is a vector format. It describes shapes as code instead of pixels, so it stays sharp at any size. That makes it ideal for logos and icons on websites. SVG files can contain scripts, though, so many upload services don't accept them. PictureToLink is one of those.
JPEG XL is a newer format with strong compression and lossless JPEG recompression. MDN now lists support from Chrome 155, Firefox 158 and Safari 17. That's recent, though, and many apps, upload forms and older browsers still won't open a .jxl file, so it isn't yet a safe choice for general sharing.
TIFF, BMP and RAW files are for editing, printing and archiving. Convert them to JPG, PNG or WebP before sharing online.
Image file formats compared
| JPG | PNG | WebP | AVIF | GIF | |
|---|---|---|---|---|---|
| Compression | Lossy | Lossless | Lossy or lossless | Lossy or lossless | Lossless (256-color palette) |
| Best for | Photos | Screenshots, logos, transparency | Almost everything on the web | Photos on the web | Simple animations |
| Typical file size | Medium | Large for photos | Small | Often the smallest | Large for animations |
| Transparency | No | Yes | Yes | Yes | On/off only |
| Animation | No | Yes (APNG) | Yes | Yes | Yes |
| Browser support (MDN) | All major browsers | All major browsers | Chrome, Edge, Firefox, Opera, Safari | Chrome 85+, Edge 121+, Firefox 93+, Opera 71+, Safari 16.1+ | All major browsers |
| Software and upload forms | Universal | Universal | Widely accepted, not everywhere | Patchier | Universal |
| Max dimensions (MDN) | 65,535 px per side | Very large | 16,383 px per side | Not listed | 65,536 px per side |
Which image format should you choose?
Go down the list and stop at the first line that matches.
- An animation: animated WebP, or an MP4 video where the site supports it. Use GIF only when the destination accepts nothing else.
- A picture that needs a transparent background: WebP for the web, PNG when it has to open everywhere.
- A screenshot, logo, chart or anything with text: PNG (lossless) if crispness matters, WebP to save space.
- A photo for a website you control: WebP, or AVIF with a JPG or WebP fallback.
- A photo for email, an online form, printing or someone with an older device: JPG.
- Anything you're unsure about: JPG for photos and PNG for everything else. Both work everywhere.
Reddit shows why that last line is the safe one. Its help center doesn't publish a list of accepted formats, and JPG, PNG and GIF are the safest choices for an image post. Our guide to posting images on Reddit has the steps.
Quick picks for common jobs
| Job | Good choice | Why |
|---|---|---|
| Photo attached to an email | JPG | Every recipient can open it |
| Photo for an online form or job application | JPG | Forms often accept only JPG or PNG |
| Hero image on your own website | WebP, or AVIF with a fallback | Smaller files load faster |
| Screenshot of an error message for support | PNG | Text stays sharp |
| Company logo for a website | SVG, or PNG if SVG is not possible | Sharp at every size, transparent background |
| Reaction animation for a chat | Animated WebP or GIF | GIF if the app does not play WebP |
| Photo for printing | High-quality JPG, or the original file | Printers and print shops expect JPG |
Resize before you pick
The dimensions matter more than the format. A 4000-pixel photo is big whatever you save it as, and a photo resized to the size it will actually be shown at is smaller in any format. So resize first. Then pick the format. Our image compressor resizes and converts to JPG, WebP or PNG in your browser without uploading anything, and our guide on how to reduce image file size covers the whole routine.

The same two photos saved as JPG at quality 75 and 1920 px wide.
How can you tell what format a file really is?
A file extension is only a label. A file called photo.jpg is usually a JPEG, but files get renamed, and some websites serve WebP images even when the address ends in .jpg.
Start by showing the extensions, since Windows hides them by default in many setups. In File Explorer, open the View menu and turn on file name extensions. On a Mac, select the file, press Cmd+I and look at Name & Extension and Kind. That Kind or Type field in your file manager, or the info panel in a photo app, usually reports the real format.
Watch for a mismatch. If an app says a ".jpg" is unsupported or damaged, it may really be a WebP or HEIC file with the wrong extension.
Renaming a file doesn't convert it. Change photo.webp to photo.jpg and the WebP data is still inside, so strict apps will keep rejecting it. To change the format, open the image and export or convert it.
Converting between formats
- For JPG or PNG to WebP, pick WebP as the output in the image compressor. Choose Convert to WebP (smallest) in the options on the uploader when you want a shareable link at the same time.
- For WebP or AVIF to JPG, use the WebP to JPG converter or the AVIF to JPG converter. Transparent areas become white, because JPG has no transparency.
- A
.jfiffile is already a JPEG, so the JFIF to JPG converter can give it a.jpgname without touching the picture. - Base64 text can be pasted into the Base64 to image converter to see and save the file it holds.
- Converting anything to PNG keeps the quality you have, but expect a bigger file if the image is a photo.
A conversion never improves the picture. Going from a lossy file to a lossless format doesn't bring back detail that's already gone, so always convert from the best original you have.
