Formats7 min read

JPG vs PNG vs WebP vs AVIF: Which Image Format to Use

What JPG, PNG, WebP and AVIF are each good at, how lossy and lossless compression differ, and which format to pick for web, forms, email, logos and print.

By Published
The same photo saved as JPG, PNG, WebP and AVIF side by side with their file sizes

Most people choose an image format by accident: whatever the phone, the screenshot tool or the “Save as” dialog picked. That works until a form rejects the file, a logo arrives with a white box around it, or a web page loads a 4 MB PNG photo. This guide covers what JPG, PNG, WebP and AVIF are each built for, where they fall short, and which to pick for common jobs. Animated images are out of scope here; this is about still images.

Quick answer: Use JPG for photos you send, upload to forms or print. Use PNG for screenshots, text, line art and logos that need transparency or exact pixels. Use WebP or AVIF for images on your own website, where they often produce smaller files at similar quality. When unsure where a file will be opened, JPG (photos) and PNG (graphics) are the most compatible choices.

Lossy vs lossless, in one minute

Lossless compression stores every pixel exactly. Open and re-save the file as many times as you like and nothing changes. The catch is size: a photo has so much random-looking detail that lossless compression can only shrink it a little.

Lossy compression throws away detail the eye is unlikely to notice, mostly fine texture and subtle colour variation. That makes photos dramatically smaller. The trade-off is that the discarded information is gone permanently, and pushing quality too low produces visible artefacts: blocks, smearing, colour banding and halos around sharp edges.

  • JPG: lossy only
  • PNG: lossless only
  • WebP: lossy or lossless
  • AVIF: lossy or lossless (lossy is how it is almost always used)

The four formats

JPG (JPEG)

JPG has been the default photo format for decades, which is its biggest strength: practically every device, program, printer kiosk and upload form reads it. It handles photographs well at moderate file sizes.

Weaknesses: no transparency, and it is poor at sharp edges. Text, UI screenshots and flat-colour graphics get fuzzy “ringing” around edges, especially at lower quality. Each re-save at lossy quality degrades it a little more.

PNG

PNG is lossless and supports full transparency (an alpha channel, so edges can be partly transparent, not just on or off). It is excellent for screenshots, diagrams, text, logos, icons and anything with flat colours and hard edges, where it can be both sharp and reasonably small.

Weakness: photos. A camera photo saved as PNG is often several times larger than a good-quality JPG of the same image, with no visible benefit.

WebP

WebP was designed for the web and does both lossy and lossless compression, with transparency in either mode. For photos, lossy WebP is often somewhat smaller than JPG at similar visual quality; for graphics, lossless WebP is often somewhat smaller than PNG.

Weakness: compatibility outside browsers. Current versions of the major browsers display WebP, but some older desktop programs, office suites, print services and upload forms either cannot open it or don’t accept it.

AVIF

AVIF is the newest of the four. It is based on a video codec and tends to hold up well at low file sizes, keeping smooth gradients cleaner where JPG would show blocks. It also supports transparency and higher bit depths.

Weaknesses: it is the least widely supported outside current browsers, and encoding takes noticeably more processing time than JPG or WebP. In ResizeAny you will see this as a slightly longer wait when exporting large AVIF files.

Comparison table

JPG PNG WebP AVIF
Compression Lossy Lossless Lossy or lossless Lossy (lossless possible)
Transparency No Yes Yes Yes
Best at Photos Graphics, text, screenshots Web images of both kinds Web photos at small sizes
Typical photo size Baseline Often several times larger Often somewhat smaller than JPG Often smaller than WebP
Compatibility Nearly universal Nearly universal Current browsers, many apps Current browsers, fewer apps
Safe for forms and print Yes Usually Check first Check first

The size comparisons are tendencies, not guarantees. The exact difference depends heavily on the image and the quality settings, and an aggressively compressed JPG can be smaller than a cautious WebP.

Which format for which job

Photos on your own website

WebP or AVIF, if your site or CMS serves them. They usually reduce page weight compared with JPG. If you are not sure your platform handles them, a well-sized JPG is perfectly fine. Pixel dimensions matter more than format: a 4000-pixel-wide image in an 800-pixel-wide column is wasteful in any format.

Screenshots and anything with text

PNG. Text stays crisp and the file is often small because screenshots have large flat areas. If a screenshot contains a big photo, try lossy WebP and compare. Avoid JPG for screenshots of text; the ringing around letters is easy to see.

Logos and graphics with transparency

PNG for maximum compatibility, WebP if it is only going on a web page. Never JPG: the transparent background becomes solid.

Email attachments

JPG for photos, PNG for screenshots and graphics. The recipient might open the file in an old desktop viewer, a phone gallery or an office program, and these two formats are the ones you can count on. Resize photos before attaching; nobody needs 12 megapixels to look at a picture in an email.

Online forms and applications

Use exactly what the form lists, usually JPG. Do not rename a WebP or PNG to .jpg; convert it. For size limits, the file size presets cover common limits such as 50 KB.

Social media and messaging uploads

Upload a good-quality JPG (or PNG for graphics) at a sensible size. Most platforms re-compress whatever you upload, so starting from an already heavily compressed file just stacks two rounds of loss. Sizing the image to the platform’s display dimensions first helps; the Instagram and WhatsApp presets are set up for that.

Print

JPG at high quality, or PNG if the print service accepts it and the image is a graphic. Most print shops and kiosks expect JPG. Pixel dimensions and DPI matter much more than format here; the print and paper presets cover common paper and photo sizes.

Mistakes to avoid

Re-saving a JPG over and over

Each lossy save discards a little more detail. Editing a JPG, saving, editing again and saving again builds up artefacts. Keep the original, make edits from it, and export to JPG once at the end.

Converting photos to PNG “for quality”

Converting a JPG to PNG cannot restore what JPG already threw away. You get the same image, artefacts included, in a much bigger file. PNG only preserves quality from that point on.

Converting PNG graphics to JPG

A logo or screenshot turned into JPG gains fuzzy edges and loses transparency. If you need a smaller file, try lossless WebP or reduce the pixel dimensions instead.

Assuming the newest format is always best

AVIF can give impressively small files, but if the person or system receiving the file can’t open it, the saving is worthless. Match the format to where the image is going.

Chasing format savings while ignoring dimensions

Switching from JPG to WebP might save a modest share of the bytes. Resizing a 4000 × 3000 photo to 1600 × 1200 cuts the pixel count by 84%, which typically shrinks the file far more than any format change.

How to convert formats in ResizeAny

  1. Open the image resizer and add your image. JPG, PNG, WebP, AVIF and HEIC files can be opened.
  2. Choose the output format: JPG, PNG, WebP or AVIF. HEIC can be read but not written; iPhone photos are usually best converted to JPG.
  3. Optionally change the dimensions or set a target file size. Target size works for JPG, WebP and AVIF by adjusting quality; it does not apply to PNG, because PNG has no quality setting.
  4. Download. If you set a DPI value, it is written into JPG and PNG files.

To convert a set of images at once, bulk image resize takes up to 10 files per batch and returns a ZIP. Conversion runs entirely in your browser, so nothing is uploaded.

Try it

Drop an image into the resizer, export it as JPG and as WebP or AVIF at the same dimensions, and compare the results yourself. That two-minute test on your own photos tells you more than any general rule, including this one.

Related guides: how to reduce an image to 20KB, 50KB or 100KB puts these formats to work against a hard size limit, and image size for print shows when resolution matters more than format.

Frequently asked questions

Is WebP better than JPG?▼
For photos on a website, WebP often gives a somewhat smaller file at similar visual quality, and it supports transparency. JPG is still the safer choice when you don't control where the file will be opened, such as forms, email attachments or print shops.
Does converting a JPG to PNG improve quality?▼
No. The detail lost when the JPG was made is gone for good. Saving it as PNG only preserves the existing artefacts exactly, usually in a much larger file.
Why is my AVIF file not opening on my computer?▼
AVIF is newer than the other three formats, and some older image viewers, editors and office programs cannot read it. Current major browsers can, so dragging it into a browser tab is a quick test; for sharing outside the web, use JPG or PNG.
Which format keeps a transparent background?▼
PNG, WebP and AVIF can all store transparency. JPG cannot, so transparent areas are filled with a solid colour (white in ResizeAny) when you convert to JPG.

Written by

Niks builds ResizeAny, a free image resizer that runs entirely in your browser. These guides are based on how the tool actually behaves, and the numbers in them can be checked with the free tools on this site.

Keep reading