Blog

PNG vs JPG: which is better, and when to use WebP

Asking whether PNG or JPG is better only makes sense once you know what the image is for: a photo on a web page, a screenshot for a manual, a logo with a transparent background, a file going to a printer. Each format stores pixels in a different way, and choosing by habit usually costs weight, quality or both. This guide gives the rule for each case, the conversions that silently destroy detail, and the exact settings to use in Airpic's compressor.

The difference between PNG and JPG: lossless against lossy

The difference between PNG and JPG is not that one is good and the other is bad. It is the contract each format makes with your pixels. PNG is lossless: when the file is decoded, every pixel has exactly the value it had when it was saved. The file is smaller than the raw pixels because the encoder predicts each pixel from its neighbours and then compresses the leftover differences with the same family of algorithm a ZIP file uses. Nothing is thrown away; the saving comes from finding repetition.

JPEG is lossy: the encoder deliberately discards information it predicts your eye will not miss. It converts the image to one brightness channel and two colour channels, usually stores the colour channels at half resolution, cuts the picture into blocks of 8 × 8 pixels, describes each block as a sum of frequencies and then rounds the fine, high-frequency values towards zero. The quality slider sets how aggressive that rounding is. Rounding is a one-way operation: once a value has been rounded, the decoder can only rebuild an approximation.

That one-way step is why a JPEG that is opened, edited and saved again and again degrades, while a PNG does not. Each save repeats the rounding on data that has already been rounded, and the errors pile up where the image has sharp edges: a soft halo around text, faint squares in a smooth sky, colour bleeding at the border between a red jacket and a white wall. The first save costs the most, and every save after an edit (a crop, a resize, a brightness change) costs again, because the new blocks no longer line up with the old ones. A PNG opened and saved a hundred times without touching the pixels is byte for byte the same image.

Two consequences follow. First, lossless does not mean better than the source: PNG stores exactly what it is given, so a PNG made from a compressed JPEG preserves the JPEG's blocks with perfect fidelity. Second, lossy does not mean bad: at a sensible quality setting a JPEG looks identical to the original on screen and weighs a fraction of it, which is the whole point of the format.

Which image format to use: each one in a line

If you remember one thing from this article, make it this list. Choose by what you will do with the file, not by what the camera or the screenshot tool handed you.

  • JPEG: photographs, and anything that has to open everywhere. Every browser, phone, email client, marketplace and print shop reads it. No transparency, 8 bits per channel, always lossy.
  • PNG: transparency, screenshots of software, logos, diagrams, flat illustration, text. Lossless, 8 or 16 bits per channel, with an alpha channel. Heavy for photographs, as the next section shows.
  • WebP: the balanced choice for your own website. Lossy or lossless, with transparency and animation, smaller than JPEG at the same visual quality, and displayed by all current browsers. Less welcome outside the browser: some desktop programs, email clients and upload forms still reject it.
  • AVIF: the minimum weight for a modern site. Lossy or lossless, transparency, 10 and 12 bit colour, HDR. It compresses photographs further than WebP, encodes more slowly, and a few older devices and apps still cannot open it, so keep a fallback for anything that must work everywhere.
  • TIFF: archive and print. Lossless or uncompressed, 16 bit, layers and CMYK, understood by every print workflow. Files are huge and no browser displays them. If a job is going to a printer, this is the delivery format, together with the colour conversion explained in RGB to CMYK for print.

Phones add one more: HEIC, the default on recent iPhones. It is a good capture format and a poor sharing format, because so many services refuse it. If that is your problem, see how to convert HEIC to JPG.

So when to use WebP rather than JPEG: whenever the image lives on a web page you control and nowhere else. The gain is not theoretical. On 19 October 2026 we measured the cover images of 296 Spanish online shops, 9,620 images in total: converting their JPEG and PNG files to WebP would cut the shops' total image weight by 55%, and converting to AVIF by 58%. Those figures come from real shop fronts, not from a lab sample, and they are the order of saving you can expect on a typical product catalogue.

The mistake that weighs the most: saving a photo as PNG

The single most expensive habit in image handling is exporting a photograph as PNG because PNG is supposedly better quality. Do the arithmetic first. A 12 megapixel photo from a phone is about 4000 × 3000 pixels. At 3 bytes per pixel that is 36 MB of raw data. A PNG of that photo typically lands at tens of megabytes, because there is very little for a lossless encoder to find. A JPEG of the same photo at a quality setting that looks identical on screen is a few megabytes, and once resized for a web page it is a few hundred kilobytes. The gap is usually around an order of magnitude, and after resizing it is two.

The reason is in how PNG works. Its compression relies on prediction: it guesses each pixel from the ones above and to the left and stores only the error. On a screenshot of a spreadsheet the guess is right most of the time (the cell is the same white as the cell before it), the errors are zeros, and zeros compress to almost nothing. On a photograph the guess is almost never exactly right. Skies, skin and shadows are continuous gradients where every pixel differs slightly from its neighbour, and on top of that the sensor adds noise that is different in every pixel. The errors are small but never zero, there is no repetition to exploit, and the file barely shrinks. PNG was designed for graphics with flat areas and hard edges. Continuous tone is the one thing it is bad at.

JPEG, WebP and AVIF do the opposite. They treat the image as a mixture of frequencies and spend their bytes on the low frequencies you actually see (shapes, large gradients) while discarding the high frequencies that are mostly noise. That is exactly the structure of a photograph, which is why they compress it so well and why the loss is invisible at a reasonable setting.

The mirror-image mistake is cheaper in bytes but more visible: saving a logo, a chart or a screenshot with text as JPEG. The hard edges are precisely the high frequencies JPEG rounds away, so letters get a grey halo, flat colours pick up speckle, and any transparent background is flattened to white. For that kind of image PNG (or lossless WebP) is both sharper and smaller. The rule of thumb: continuous tone goes lossy, hard edges go lossless. A screenshot that is mostly a photo, such as a frame from a video, follows the photo rule.

One honest limit of the usual advice. Converting everything to WebP or AVIF is right for your own site and wrong for files that leave it. A product image that will be uploaded to a marketplace, attached to a quote or sent to a print shop should stay JPEG (or PNG if it needs transparency), because you do not control the software at the other end, and an upload form that rejects the file costs you more than the kilobytes you saved.

Conversions that lose quality and conversions that do not

Every conversion is either a copy or a re-encode, and it pays to know which one you are about to do.

  • JPEG to PNG: nothing comes back. The detail the JPEG encoder rounded away does not exist in the file, so there is nothing for a lossless format to preserve except the artefacts. You get the same picture, blocks included, at many times the weight. The only good reasons to do it are that you are about to edit the image repeatedly and want to stop the losses from accumulating, or that you need a transparent background, which JPEG cannot hold. In that second case, when you remove the background from a photo the output has to be PNG or WebP with an alpha channel, and the extra weight is the price of the transparency.
  • JPEG to JPEG: always a loss, even at quality 100. Re-saving runs the whole lossy pipeline again. The maximum quality setting rounds less, but it still rounds, and most encoders still store colour at half resolution. A photo that has passed through three editing apps, each saving a new JPEG, has been degraded three times. Keep the file the camera produced and export from that one every time you need a new version.
  • JPEG to WebP or AVIF: a second lossy pass. Done once, from the best source you have, the extra loss is small and the saving is large. Done from a file that has already been compressed hard, it is worse than it looks: the new encoder treats the old blocks and halos as detail worth keeping and spends bytes on them. If the original is a HEIC, a TIFF or an export from the camera's RAW file, convert from that, not from the JPEG someone forwarded you on a messaging app.
  • PNG to JPEG: fine for photos, destructive for graphics. Transparency is flattened onto a background colour, 16 bit becomes 8 bit, and hard edges pick up halos. For a photograph that was saved as PNG by mistake, this conversion is pure gain: same look, a fraction of the weight.
  • Resizing is a conversion too. Scaling a photo down and saving it discards pixels you cannot get back by scaling up again. Keep the full-size original and make the 1600 pixel web version from it, never the other way round. If all you have left is the small, heavily compressed copy, an AI tool to upscale an image can rebuild plausible detail, but it is reconstructing, not recovering: what the compressor removed is gone, as this test with a pixelated WhatsApp photo shows.

The principle behind all five: always start from the original. Treat the camera file (or the layered design file, or the scan) as the master, never overwrite it, and generate every JPEG, WebP or AVIF you need as a one-step export from that master.

When to use WebP or AVIF, and how to convert with Airpic

Airpic's compressor converts between JPEG, PNG, WebP and AVIF and lets you set the three things that decide the weight of a file: format, quality and pixel size. It runs on a CPU in the European Union, takes seconds, and it is free for both processing and downloading, with no account and no credits. The file is deleted one hour after you download it, one day at most, and is never used for training. Here is the exact sequence for a phone photo that is going on a web page.

  1. Drop the file in. JPG, PNG (with transparency and 16 bit), WebP, TIFF, HEIC and AVIF are all accepted. The tool applies the orientation stored by the phone, so a portrait shot does not come out sideways, and reads the embedded ICC colour profile. You see a card with the file name, its dimensions and its current weight.
  2. Choose the output format. For a photo on your own site, pick WebP; pick AVIF if your audience is on recent browsers and weight matters more than compatibility; pick JPEG if the file will also be emailed, uploaded to a marketplace or sent to a printer. Pick PNG only when the image has transparency or hard-edged graphics. If you are unsure, leave the format on automatic: it keeps PNG for files with transparency and JPEG for JPEG input.
  3. Set the quality. For photographs, 70-80 is the range where the file shrinks hard and the screen still shows no difference. In our test on 19 September 2026, a 1.2 MB JPEG photo came down to 208 KB at quality 72, an 83% reduction, in 2 seconds. If a form imposes a limit, use the target size field instead: type the kilobytes you need and the tool finds the highest quality that fits.
  4. Set the maximum side. This is the lever with the biggest effect and the least visible cost. A photo shown in a 1200 pixel column does not need 4000 pixels; set the longest side to 1600 or 2000 and the pixel count drops to a quarter or less before any quality loss. Leave it empty when the file is for print or archive. The guide on how to compress images for the web goes through the right sizes for each kind of page.
  5. Tick the option to remove metadata, keeping the ICC profile. Phone photos carry the date, the camera model and often the GPS position of where you stood. The option strips all of that and keeps only the colour profile, so a wide-gamut photo does not turn dull on screen. The profile is a few kilobytes and it is what keeps the colours right; the compressor keeps it on purpose.
  6. Compare and download. The result appears next to the original with a slider and a 100% view, so you can check the edges and the smooth areas before committing. The download button shows the new format and weight. If it is still too heavy, lower the quality a notch or the maximum side, and process again; the original stays untouched on your device.

Two cases where this is the wrong tool. If the file is already a small, hard-compressed JPEG, running it through again saves little and costs a little quality each time: the fix is to go back to the original, not to squeeze the copy. And if the image is a logo or a screenshot with text, a lossy format at any quality setting will blur the edges; choose PNG and accept the weight, or keep a vector version of the logo. For everything else, the steps above are the whole job: compress images for free, with no account, and pick the format for where the file is going.

FAQ

is png or jpg better quality

Neither is better in the abstract. PNG stores pixels exactly, so it never adds artefacts, but it cannot make a picture better than its source and it makes photographs very heavy. JPEG discards fine detail you are unlikely to see and gives a far smaller file. For photos, a JPEG at quality 75-85 looks the same on screen as the PNG at a fraction of the weight; for logos, screenshots and anything with transparency, PNG is sharper and usually smaller.

what is the difference between png and jpg

PNG is lossless and supports transparency and 16 bit colour; it is built for graphics with flat colours and hard edges. JPG (the same thing as JPEG) is lossy, has no transparency and is 8 bit; it is built for photographs, which it stores in far smaller files with no visible change at a sensible quality setting. Saving a JPG repeatedly degrades it a little each time; saving a PNG repeatedly does not.

should i use webp or jpg

Use WebP for images that stay on your own website: all current browsers display it and it is smaller than JPEG at the same quality. Use JPG for files that travel: email attachments, marketplace uploads, print shops and older software. If your site can serve both, serve WebP with a JPEG fallback and you lose nothing either way.

is avif better than webp

For weight, usually yes: AVIF compresses photographs further than WebP and supports 10 bit colour and HDR. It encodes more slowly and a small number of older devices and apps still cannot open it, so it is the best choice for a modern site and a poor choice for files that must open everywhere. In our measurement of 296 online shops on 19 October 2026, switching cover images to AVIF would have saved 58% of image weight against 55% for WebP.

We measured it

  • A 1.2 MB JPEG photo went down to 208 KB (83% smaller) at quality 72, in 2 seconds. (19-09-2026)
  • Across 296 Spanish online shops (9,620 homepage images), converting their JPEG and PNG files to AVIF would cut total image weight by 58%; to WebP, by 55%. (19-10-2026)

Measured on airpic.app with the GPU already running. If nobody has used it for a while, the first job takes 40 to 90 seconds longer to start.

Compress and convert your images free

Keep reading

An iLovePDF alternative that runs on your computer

Looking for an iLovePDF alternative? Airpic PDF merges, splits, compresses, OCRs and signs PDFs on your Mac or PC. Free, no account, nothing uploaded.

How to compress images for WordPress

Compress images for WordPress: resize, pick JPEG, WebP or AVIF, set quality and strip metadata so pages load fast and photos look the same.

Convert HEIC to JPG

HEIC is half the size of a JPEG, until a form or a print lab refuses it. How to convert to JPG without a second round of damage, and when WebP or AVIF wins.