WebP vs AVIF vs JPEG vs PNG: which image format should you use?
The same photo can be 4 MB as a PNG, 600 KB as a JPEG and 300 KB as a WebP, and look almost identical in all three. Choosing the right format is often the quickest way to make a website faster or get a file under an upload limit. This guide compares the common formats in plain terms and gives you a simple way to decide.
The short answer
- Photos on a website: WebP, or AVIF if you want the smallest files and can test the result.
- Photos for email, print or someone else's app: JPEG, because everything opens it.
- Screenshots, diagrams and images with text: PNG, or lossless WebP.
- Logos and icons: SVG where possible, otherwise PNG or WebP with transparency.
Lossy and lossless compression
Every format here compresses images, but in one of two ways. Lossless compression keeps every pixel exactly, like a ZIP file for images. Lossy compression throws away detail that people are unlikely to notice, such as tiny colour variations in a sky, and gets much smaller files in return.
Lossy compression is ideal for photos, which are full of fine, random detail. It is a poor fit for screenshots and diagrams, where sharp edges and flat colours show the artefacts clearly. JPEG is lossy, PNG is lossless, and WebP and AVIF can do both.
The formats compared
| JPEG | PNG | WebP | AVIF | |
|---|---|---|---|---|
| Compression | Lossy | Lossless | Lossy or lossless | Lossy or lossless |
| Photo file size | Baseline | Much larger | Usually smaller than JPEG | Usually the smallest |
| Transparency | No | Yes | Yes | Yes |
| Animation | No | Not widely (APNG) | Yes | Yes |
| Browser support | Universal | Universal | All current browsers | All current browsers |
| Other apps and editors | Universal | Universal | Most | Growing, not universal |
| Encoding speed | Fast | Fast | Fast | Slower |
Exact savings depend on the image. A detailed landscape compresses differently from a portrait with a blurred background. The only reliable way to know is to try: convert one image to several formats and compare the sizes and the look.
JPEG: the safe default
JPEG has been the standard for photos since the early 1990s. Every browser, phone, printer, email client and office app can open it. Its compression is good for photos but shows blocky artefacts around sharp edges and text, and it cannot store transparency. Use JPEG when you do not control where the image will be opened.
PNG: exact pixels
PNG is lossless, so screenshots, charts, user interface images and text stay perfectly sharp. It also has full transparency, which is why logos are often PNG. The downside is size: a photo saved as PNG can be several times larger than the same photo as JPEG. Do not use PNG for photos unless you need an exact archival copy.
WebP: the practical choice for websites
WebP was designed for the web. In lossy mode it typically produces files noticeably smaller than JPEG at a similar visual quality, and it supports transparency, so it can replace both JPEG and PNG on a website. Every current browser supports it. Some older desktop software still cannot open WebP files, so if people will download and edit your images, JPEG or PNG may be friendlier.
AVIF: the smallest files
AVIF is based on the AV1 video codec. It often beats WebP on file size, especially at lower quality settings, and handles smooth gradients well. It is slower to encode, so converting a large batch takes longer, and support outside browsers is still catching up. AVIF is a good choice for large hero images and photo-heavy pages where every kilobyte counts.
Where SVG fits
SVG is different from all of the above. It describes shapes and paths instead of storing pixels, so logos, icons and simple illustrations stay perfectly sharp at any size and are often tiny. It is not suitable for photos. Files exported from design tools are often much bigger than they need to be; the SVG Optimizer removes the extra data.
Suggested image sizes
Resizing usually saves more than changing the format. A phone photo is often 4000 pixels wide, far more than any screen needs. These widths are a reasonable starting point:
| Use | Width in pixels | Suggested format |
|---|---|---|
| Full-width website banner | 1920 to 2400 | WebP or AVIF |
| Image inside a blog post | 1200 to 1600 | WebP |
| Product or gallery thumbnail | 400 to 800 | WebP |
| Photos attached to an email | 1600 to 2000 | JPEG |
| Profile picture or avatar | 400 to 512 (square) | JPEG or WebP |
| Screenshot for documentation | Original size | PNG or lossless WebP |
Screens with high pixel density show more detail, which is why the website widths are larger than the space the image takes on the page. Always check the specific requirements of the platform you are uploading to.
How to convert images privately
- Open the Image Optimizer.
- Add one or more images. They stay on your device.
- Choose WebP, AVIF, JPEG or PNG, set a quality (80 is a good start for photos) and, if needed, a maximum width.
- Click Convert and compare the before and after sizes in the list.
- Download the files you are happy with.
Converting also removes EXIF metadata such as the GPS location, which is usually what you want for images you publish. See how to remove location data from photos for more.
Frequently asked questions
Is WebP better than JPEG?
For websites, usually yes: WebP files are typically smaller at the same visual quality, and WebP supports transparency. For sharing files with people and apps you do not control, JPEG is still the safer choice because everything opens it.
Is AVIF better than WebP?
AVIF often produces smaller files, particularly at lower quality settings, but it is slower to encode and fewer non-browser apps can open it. Try both on your own images and keep whichever looks better at the size you need.
Does converting JPEG to PNG improve quality?
No. Converting cannot bring back detail that JPEG compression already removed. The PNG will be larger and look the same.
Why do my converted images lose their transparent background?
JPEG has no transparency, so transparent areas are filled with a solid colour. PawMedia uses white. Choose PNG, WebP or AVIF to keep transparency.
What quality setting should I use?
Start at 80 for photos and look at the result at its real display size. Go up to 85 or 90 for detailed photos, or down to 60 or 70 for small thumbnails.
Do all browsers support WebP and AVIF?
All current versions of the major browsers display both. Very old browsers and some older desktop software do not, so JPEG remains the fallback for maximum compatibility.
Related tools and guides
Compare formats on your own images
Convert one photo to WebP, AVIF and JPEG and see the sizes side by side. Nothing is uploaded.
Open the Image Optimizer