Image Formats Explained: JPG, PNG, WebP, AVIF, GIF
A plain-English guide to image formats: when to use JPG, PNG, WebP, AVIF or GIF, with a comparison table of quality, size, transparency and support.
By PictureToLink Team · · 10 min read
Facts checked against official sources on
On this page
The five image file formats you will meet most online are JPG (photos, works everywhere), PNG (screenshots, logos and transparency), WebP (smaller files for both photos and graphics), AVIF (often smallest, newest) and GIF (simple animations). For the web, WebP is a strong default because every current major browser supports it. Use JPG when you need maximum compatibility for photos, PNG when every pixel must stay exact, and an animated WebP or a video instead of a large GIF.
Lossy vs lossless in one paragraph
Every image format compresses pixels to save space, in one of two ways. Lossless compression shrinks the file but keeps every pixel exactly as it was, which is ideal for text, logos and screenshots. Lossy compression throws away detail people are unlikely to notice, which makes photos far smaller but slowly degrades them if you re-save again and again. Some formats are only one or the other, and the newer ones can do both. Our explainer on lossy vs lossless compression has side-by-side measurements.
JPG / JPEG
JPEG (the file extension is usually .jpg, sometimes .jpeg; they are the same format) has been the standard photo format for decades. The MDN image format guide describes it as "currently the most widely used lossy compression format for still images."
Strengths
- Opens everywhere: every browser, phone, computer, printer and email client.
- Excellent for photos and other images with smooth gradients and natural texture.
- Adjustable quality, so you can trade size against detail.
Weaknesses
- Lossy only. Each re-save loses a little more detail.
- No transparency. Transparent areas become a solid background.
- Poor for text and sharp edges, which pick up halos and blocky artifacts.
Use it for: photos you need to send anywhere, upload to forms, print or attach to emails.
There is no difference between .jpg and .jpeg beyond the name. Our guide to JPG vs PNG covers the most common format decision in more depth.
PNG
PNG (Portable Network Graphics) is a lossless format with full transparency support. MDN notes that it is preferred over JPEG "for more precise reproduction of source images, or when transparency is needed."
Strengths
- Lossless: what you save is exactly what you get back.
- Full alpha transparency, including soft edges and semi-transparent shadows.
- Crisp text, lines and flat colours.
Weaknesses
- Large files for photos, often several times the size of a JPEG of the same picture.
- No lossy option within the format itself. Tools can shrink PNGs by reducing them to a palette of fewer colours first, which is a lossy step.
Use it for: screenshots of text and interfaces, logos, icons, diagrams, and anything that needs a transparent background when WebP is not an option.
PNG can also be animated (APNG), which MDN lists as supported in Chrome, Edge, Firefox, Opera and Safari, though animated WebP is usually smaller.
WebP
WebP was developed by Google as a single format for the web that can 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.
Strengths
- Usually smaller than JPEG for photos and much smaller than PNG for graphics.
- Supports transparency in both lossy and lossless modes.
- Supports animation, making it a better replacement for GIF.
Weaknesses
- Not every desktop app, older photo editor or online form accepts it yet.
- The maximum image size is 16,383 × 16,383 pixels, smaller than JPEG's limit, according to MDN. This only matters for very large panoramas and scans.
- Lossy WebP, like JPEG, should not be re-saved over and over.
In our own tests, the size advantage varied a lot from image to image. Converting our test images to WebP at quality 80 with our upload pipeline gave:
| Sample | Original | WebP, quality 80 | Saved |
|---|---|---|---|
| Landscape photo, 4032 × 2623 JPG | 380 KB | 197 KB | 48.1% |
| Flower photo, 3000 × 2000 JPG | 961 KB | 607 KB | 36.9% |
| Photo, 3024 × 2016 JPG | 1.6 MB | 1.4 MB | 13.9% |
| Screenshot, 1366 × 900 PNG | 2.3 MB | 126 KB | 94.6% |
Screenshots and graphics saved as PNG gain the most. Photos that are already well-compressed JPEGs gain less, so it is worth checking the result.
Use it 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 using the AV1 video codec inside a HEIF container. MDN describes it as offering "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.
Strengths
- Often the smallest files at a given visual quality, especially for photos.
- Supports transparency, animation, high bit depth and HDR.
- Royalty-free.
Weaknesses
- Newer than WebP, so support in desktop software, older devices and upload forms is patchier.
- Slower to encode, which matters when converting large batches.
- No progressive rendering: MDN notes that AVIF files must be fully downloaded before they are displayed, although their small size usually makes up for it.
MDN recommends including a fallback format when you use AVIF on a website (for example with the HTML picture element). We compare the two newer formats in detail in AVIF vs WebP.
Use it for: websites where you control the HTML and can provide a fallback, and photo-heavy pages where every kilobyte counts.
PictureToLink accepts AVIF uploads and keeps them as AVIF unless you choose to convert to WebP or JPG. 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 because of animated reactions and memes. Technically it is lossless, but MDN explains that each pixel is an index into a palette of at most 256 colours. Full-colour images have to be squeezed into that palette, which is why GIFs of video clips look grainy or banded.
Strengths
- Plays everywhere, including email clients and old software.
- Simple animation with no player needed.
Weaknesses
- Limited to 256 colours per frame (fewer looks worse).
- Transparency is on or off for each pixel, with no soft edges.
- Animations are very large for what they show.
Better alternatives: MDN suggests preferring PNG for still images and "WebP, AVIF or APNG for animation sequences." On sites that allow 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 23 KB, a 55.9% saving, with the animation intact. If you need to share a GIF as a link, our GIF to URL tool keeps animations animated.
Other formats you may meet
- HEIC/HEIF is the default photo format on recent iPhones. It produces small files but many websites and Windows apps cannot open it. Convert it to JPG before uploading to sites that refuse it, for example with our HEIC to JPG converter. The PictureToLink uploader does not accept HEIC.
- SVG is a vector format: shapes described as code rather than pixels, so it stays sharp at any size. Ideal for logos and icons on websites. Because SVG files can contain scripts, many upload services, including PictureToLink, do not accept them.
- JPEG XL is a newer format with strong compression and lossless JPEG recompression. MDN currently lists support in Safari, behind a flag in Chrome and in Firefox Nightly, so it is not 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.
Comparison table
| JPG | PNG | WebP | AVIF | GIF | |
|---|---|---|---|---|---|
| Compression | Lossy | Lossless | Lossy or lossless | Lossy or lossless | Lossless (256-colour 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 format to choose (decision list)
Work down the list and stop at the first match:
- Is it animated? Use animated WebP, or an MP4 video where the site supports it. Use GIF only when the destination accepts nothing else.
- Does it need a transparent background? Use WebP for the web, PNG for maximum compatibility.
- Is it a screenshot, logo, chart or anything with text? Use PNG (lossless) if crispness matters, or WebP to save space.
- Is it a photo for a website you control? Use WebP, or AVIF with a JPG or WebP fallback.
- Is it a photo for email, an online form, printing or someone with an older device? Use JPG.
- Not sure? Use JPG for photos and PNG for everything else. Both work everywhere.
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 |
Whatever the format, the dimensions matter more than the format itself. A photo resized to the size it will actually be shown at is smaller in any format. Our image compressor can resize and convert to JPG, WebP or PNG in your browser without uploading anything.
How to tell what format a file really is
The 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. A few ways to check:
- Show file extensions. 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.
- Check the file details. The 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 does not convert it. Changing photo.webp to photo.jpg leaves the WebP data inside, and strict apps will still reject it. To change format, open the image and export or convert it, for example with the image compressor.
Common format mistakes
- Saving photos as PNG "for quality". The file can be several times larger than a good JPEG, with no visible benefit when viewed on screen.
- Saving screenshots as low-quality JPG. Text gets fuzzy halos. Use PNG, or WebP at a reasonable quality.
- Choosing a format to fix a size problem that is really about dimensions. A 4000-pixel photo is big in any format. Resize first, then pick the format.
- Converting a GIF to PNG to "improve" it. The 256-colour limit has already done its damage, and the PNG cannot add back lost colours.
- Uploading HEIC to sites that do not support it. Export as JPG instead.
Converting between formats
- JPG or PNG to WebP: use the image compressor and pick WebP as the output, or choose Convert to WebP (smallest) in the options on the uploader when you want a shareable link at the same time.
- WebP or AVIF to JPG: choose JPG as the output format. Transparent areas become white, because JPG has no transparency.
- Anything to PNG: fine for keeping quality, but expect a bigger file if the image is a photo.
Remember that converting a lossy file to a lossless format does not restore lost detail. Always convert from the best original you have.
Next step
Check the images you share most often. If your screenshots are big PNGs or your website photos are full-size JPGs, run a couple through the image compressor as WebP and compare. For a full size-reduction routine, read how to reduce image file size.
