PNG vs JPG vs WebP: we saved the same three pictures in every format
The short answer
Use JPG for photographs, PNG for screenshots, logos, line art, text and anything with see-through areas or that you will edit again, and WebP for web pages when you want the smallest file. We saved the same three pictures in all three formats: the photo got about eight times smaller as a JPG, but the screenshot and the logo got bigger. WebP was the smallest file for all three.
"JPG for photos, PNG for graphics" is the advice everyone repeats. It is right, but it does not tell you how much is at stake, or what happens when you pick the wrong one. To find out, we took three pictures, a photograph, a screenshot and a logo, saved each one as PNG, as JPG at four quality settings and as WebP with our own image converter, and wrote down every file size.
The headline: the photo went from 1,263 KB as a PNG to 153 KB as a JPG, about one eighth, with no difference you would notice. The screenshot went the other way, from 93 KB to 123 KB. Picking the format by the kind of picture, not by habit, is what decides whether a file shrinks or grows.
The three formats side by side
| PNG | JPG (JPEG) | WebP | |
|---|---|---|---|
| Compression | Lossless: every pixel is kept | Lossy: some detail is thrown away to save space | Either lossy or lossless |
| See-through areas | Yes (full alpha) | No | Yes |
| Animation | Only in the APNG extension | No | Yes |
| Best for | Screenshots, diagrams, logos, line art, anything edited again | Photographs | Photos and graphics on web pages |
| Opens in | Everything | Everything | Current Chrome, Edge, Firefox, Opera and Safari; not every older program or upload form |
Format facts that are not from our own test come from MDN's guide to image file types. On a Mac, for example, WebP needs Safari 14 or later and macOS Big Sur (11) or newer.
What we measured
The three pictures are our own: a 1024 × 768 photograph, a 1024 × 768 screenshot-style picture (flat colors, a menu bar, lines of text) and a 600 × 400 orange logo on a transparent background. Each started as a PNG made by a standard encoder. Sizes are in kilobytes.
| Photo | Screenshot | Logo | |
|---|---|---|---|
| PNG (the start) | 1,263 KB | 93 KB | 13 KB |
| JPG, quality 100 | 358 KB | 304 KB | 48 KB |
| JPG, quality 92 | 153 KB | 123 KB | 17 KB |
| JPG, quality 80 | 115 KB | 92 KB | 12 KB |
| JPG, quality 60 | 60 KB | 69 KB | 9 KB |
| WebP, quality 80 | 63 KB | 43 KB | 8 KB |
- The photo shrank a lot. At quality 92 the JPG is about one eighth of the PNG (153 KB against 1,263 KB). That is the reason photos are JPGs.
- The screenshot and the logo did not. As a JPG at quality 92 the screenshot is 123 KB, more than the 93 KB PNG, and the logo went from 13 KB to 17 KB. Only at quality 80 or below does the JPG come out smaller, and that is where the damage starts to show.
- WebP was the smallest in every column. The quality numbers of WebP and JPG are not the same scale, so do not read the table as "WebP 80 beats JPG 80". Compare by eye, at the size the picture will be shown.
Bits per pixel: a fairer way to read the sizes
The logo has less than a third of the pixels of the other two, so its kilobytes cannot be compared with theirs directly. Dividing each file by its pixel count gives the bits spent on every pixel. For reference, an uncompressed color picture uses 24 bits per pixel, 32 with transparency:
| Bits per pixel | Photo | Screenshot | Logo |
|---|---|---|---|
| PNG | 13 | 0.97 | 0.44 |
| JPG, quality 92 | 1.6 | 1.3 | 0.58 |
| JPG, quality 80 | 1.2 | 0.96 | 0.41 |
| WebP, quality 80 | 0.66 | 0.45 | 0.27 |
Seen this way, lossless compression barely more than halves a photograph: PNG still needs 13 of the 24 bits, because almost every pixel differs a little from its neighbors. A screenshot or a logo needs less than one bit per pixel as a PNG, since long runs of identical pixels cost almost nothing. JPG at quality 80 to 92 spent 1 to 1.6 bits per pixel on the photo and the screenshot alike, a bargain for the photo and a loss for the screenshot. The numbers also give a rough rule for estimating: a photo saved as JPG at quality 92 costs about 1.6 bits per pixel, so a 12-megapixel photo comes out around 2.4 MB. Treat that as an estimate; a photo full of fine detail, such as foliage or gravel, costs more.
Why a screenshot gets bigger as a JPG
JPEG compresses a picture in small blocks. It keeps the smooth changes that photographs are full of and discards fine, sudden changes. A screenshot is the opposite: large areas of one flat color, and hard edges around letters. PNG stores flat areas very cheaply and keeps every edge exact. JPG has to spend extra data on the sharp edges and still blurs them, which is where the faint "mosquito" speckles around text in a JPG screenshot come from. MDN says the same: lossy compression on content that needs sharpness, such as diagrams or charts, can produce unsatisfactory results, and lossless formats suit screenshots, diagrams, logos and line art.
So if a PNG is a screenshot or a logo, leave it as a PNG. Convert to JPG when the picture is really a photograph, which is where the saving is large. The image converter shows the old and new size on every row, so you can see right away which files got smaller.
How each format stores a picture
The sizes above follow from how each format works inside, and a little of that explains several everyday puzzles.
JPEG: brightness first, color at half size
A JPEG encoder first splits the picture into brightness and two color-difference channels. Many encoders, especially at everyday quality settings, then store the color channels at half the width and half the height (called 4:2:0 subsampling), since the eye resolves color detail far less sharply than brightness. Each channel is cut into 8 × 8 blocks, turned into frequencies with a discrete cosine transform, and the frequencies are rounded off using a table. That rounding, together with the half-size color, is where detail is lost, and the rounding is what the quality number controls. The rounded values are then packed with Huffman codes. Two consequences: red or blue text on a colored background goes fuzzy sooner than black text, because its color lives in the half-size channels, and the quality scale is not a standard. Every encoder maps its 0 to 100 to its own tables, so quality 80 in one program and 80 in another are not the same file.
PNG: predict each row, then zip it
The PNG specification has the encoder run a filter over every row of pixels before compression. There are five filter types (None, Sub, Up, Average and Paeth), each predicting a pixel from its neighbors to the left and above and storing only the difference. The filtered rows are then compressed with deflate, the same method as ZIP files. Nothing is lost at any step, but an encoder is free to choose a filter for each row and how hard deflate searches. That freedom is why two programs can write very different PNG files from identical pixels, as our browser test further down shows. A PNG can also store up to 256 colors as a palette with one byte or less per pixel. Our image compressor uses that for PNGs: in our tests a 1.2 MB photo PNG became 357 KB at 256 colors, and a 581 KB flat graphic 163 KB.
WebP: two formats under one name
Google's description of WebP's compression shows that lossy and lossless WebP are separate methods. Lossy WebP comes from the VP8 video codec: each block is first predicted from the pixels already decoded above and to its left, only the difference is transformed and quantized, the picture can be split into up to four segments that get different amounts of compression, and the result is packed with arithmetic coding. Like JPEG, it stores color at half resolution. Lossless WebP is a different algorithm: it predicts pixels with one of 13 modes, decorrelates the colors (for example by subtracting green from red and blue), switches to a palette when a picture has fewer than 256 colors, and reuses earlier stretches of pixels. WebP also has a mode JPEG and PNG lack: lossy color with a lossless transparency channel, which suits a photo cut out on a see-through background.
What the JPG quality number costs you
The quality slider (0 to 100 in most tools) trades size against faithfulness. On our photo, going from 100 to 92 cut the file from 358 KB to 153 KB, less than half, and 80 brought it to 115 KB. To see what that saving costs, we compared each JPG with the original PNG pixel by pixel:
| JPG quality | Photo: closeness (PSNR) | Photo: worst pixel | Screenshot: closeness | Screenshot: worst pixel |
|---|---|---|---|---|
| 92 | 44.6 dB | 30 of 255 | 44.5 dB | 26 of 255 |
| 80 | 39.7 dB | 44 of 255 | 39.4 dB | 40 of 255 |
PSNR is a standard measure where higher means closer to the original. The pattern is the useful part: the average error stays small, while a few pixels, usually on edges, move much more. That is why our converter uses 92 as its default, keeping most of the saving without visible loss. For pictures you care about, we would not go below about 80.
The same PNG, two very different sizes
PNG is lossless, so you might expect every program to write the same file, but browsers write PNGs quickly rather than as small as possible, and the gap can be large: the same screenshot pixels were 156 KB as written by the browser against 93 KB from a standard encoder. For the photo the difference was small (1,251 KB against 1,263 KB). If a PNG made in a web tool seems big, a dedicated PNG optimizer can usually shrink it without changing a single pixel, or the image compressor can make a much smaller JPG or WebP when exact pixels do not matter.
Re-saving, and why PNG is the safe format to edit in
Every time a JPG is opened, changed and saved again, it is compressed again, and the small errors add up. This "generation loss" is why a picture passed through a messaging app several times looks worse each time. A PNG has no such problem: save it a hundred times and it is still the same pixels. If you plan to edit a picture many times, work in PNG and make the JPG at the very end.
Turning a JPG into a PNG does not bring back the detail the JPG already lost. We checked: the PNG shows exactly the same picture as the JPG (a mean difference of 0.00 out of 255), and it is far bigger. Our 155 KB test JPG became a 1,251 KB PNG, 8.1 times the size, and a 63 KB lossy WebP became a 966 KB PNG, 15 times. The conversion only stops further loss.
WebP: the claim, and what we saw
Lossless WebP images are 26% smaller than PNGs, and lossy WebP images are 25-34% smaller than JPEGs.
Our pictures point the same way, sometimes further. Saved as lossless WebP, which keeps every pixel, our photo was 556 KB, less than half the 1,263 KB PNG. At quality 80, lossy WebP was the smallest file in each column of the table above. Google's figures are averages over many pictures, so a single test can land above or below them; the direction is consistent.
The catch is compatibility. Every current browser opens WebP, but some older programs, office tools, print services and upload forms do not. Many websites now serve WebP to browsers that accept it, so a picture saved from a page often arrives as a .webp file that another program refuses. The image converter turns it into a JPG or PNG in one step; on our tests, a 63 KB WebP became a 137 KB JPG at quality 92. For your own web pages, MDN's advice is to prefer WebP or AVIF and offer a JPEG or PNG as a fallback.
AVIF and JPEG XL, the newer two
Two newer formats compete with WebP on web pages. AVIF puts a still frame of the AV1 video codec into the HEIF container that iPhones use for HEIC photos (our HEIC vs JPEG guide explains that container). MDN describes lossy AVIF as around 50% smaller than JPEG and cites a comparison in which AVIF had a median saving of 50% against WebP's 30% on the same set of JPEGs. It supports transparency, animation, wide color and HDR. Its drawback is that it cannot display progressively: the whole file must arrive before anything shows. MDN lists support in Chrome 85, Edge 121, Firefox 93 and Safari 16.1 and later.
JPEG XL (ISO/IEC 18181) is royalty-free, lossy or lossless, and has a trick none of the formats above offers: it can repack an existing JPEG losslessly into a smaller file from which the original JPEG can be rebuilt exactly. Support arrived late; MDN's table lists Safari 17 and the recent versions 155 of Chrome and Edge and 158 of Firefox. For both formats MDN advises offering a fallback with the <picture> element.
Our tools read AVIF wherever the browser can decode it and save JPG, PNG or WebP, the formats browsers can write. The image compressor saves an AVIF left on "same type" as WebP. For a page you build yourself, WebP with a JPG fallback is the safe pair, and AVIF is worth adding as a first choice when you control the encoding.
Transparency and animation
- Transparency. Only PNG and WebP can be see-through. A JPG fills see-through areas with a color, and soft edges blend into it: a half-transparent orange pixel over white became the pale orange 242, 166, 132. Our converter lets you pick white, black or any color, so choose the color of the page the picture will sit on.
- Animation. WebP, GIF and APNG can move; JPG cannot. Our converter reads only the first frame of an animated picture, so an animated WebP, GIF or PNG becomes a still picture. We tested all three.
- Color depth. A 16-bit PNG is saved at 8 bits per channel, which is what JPG and ordinary screens use.
Size limits and other edge cases
- Very tall or very wide pictures. MDN gives WebP a maximum of 16,383 × 16,383 pixels, against 65,535 for JPEG and over two billion for PNG. A full-page screenshot of a long web page, say 1170 × 20,000 pixels, simply cannot be a WebP. Keep it as a PNG, or cut it into parts.
- Phone rotation. Many phone JPGs are stored sideways with a tag saying how to turn them. Our converter applies the tag, so a 400 × 300 test JPG tagged as rotated came out as an upright 300 × 400 picture. A program that ignores the tag can show the original sideways, so a converted copy and its original may disagree; our EXIF guide explains the orientation tag.
- SVG drawings. SVG has no pixel size of its own. Our converter draws a small SVG with its longest side at 1024 pixels before saving it as JPG, PNG or WebP.
- Transparent pictures for the web. A photo cut out on a see-through background is a poor PNG (every pixel of the photo costs about 13 bits) and impossible as a JPG. Lossy WebP with its lossless transparency channel, described above, is the format made for it.
What stays inside the file
Camera JPGs carry details such as the date, the camera and sometimes the GPS location, and pictures from image generators often carry their prompt in hidden text. Our converter draws a fresh picture and does not copy any of that, which is good for privacy and a loss if you need the information. See our guides on EXIF data and on reading the prompt stored in a picture, and open the metadata viewer first if you want to see what a file holds.
Which one should you choose?
| You have | Use |
|---|---|
| A photograph to send, print or upload | JPG at quality 90 to 95 |
| A screenshot, diagram, chart or line drawing | PNG |
| A logo or icon, or anything with a see-through background | PNG (or WebP for the web) |
| A picture you will edit several times | PNG while editing, JPG at the end |
| Pictures for a web page, where size matters | WebP, with a JPG or PNG fallback |
| A picture for training software or an old program | JPG or PNG (check what the tool reads; see preparing an image dataset) |
To convert, use the image converter: it reads JPG, PNG, WebP, GIF, BMP, AVIF where the browser can, and HEIC, and it writes JPG, PNG or WebP, many files at once. When a file is still too big, the image compressor and the image resizer take it further. Keep your originals: a lossy conversion cannot be undone.
A worked example: one photo for a web page
Say a 4032 × 3024 phone photo is going on a page whose content column is 800 pixels wide, with sharp screens in mind. A sensible route with our tools:
- Resize first. With the image resizer, set the longest side to 1600 pixels (twice the column, for high-density screens). The picture drops from 12.2 to 1.9 megapixels, a 6.3-fold cut that no switch between JPG and WebP comes close to.
- Make two files. Convert the resized photo to WebP at quality 80 and to JPG at quality 92. Using the bits per pixel from our test photo as a rough guide, expect something like 150 KB for the WebP and 370 KB for the JPG; a photo with more fine detail will be larger.
- Serve WebP with a JPG fallback.
<picture>
<source srcset="harbor-at-dusk.webp" type="image/webp">
<img src="harbor-at-dusk.jpg" width="1600" height="1200"
alt="Fishing boats moored in a harbor at dusk">
</picture>
Browsers that read WebP take the first file, anything else takes the JPG, and the alt text sits on the <img> as usual. Our guide to image SEO covers the alt text, file names and responsive srcset sizes for the same picture.
Three test pictures of our own (a 1024 × 768 photo, a 1024 × 768 screenshot-style picture and a 600 × 400 logo with a transparent background), each starting as a PNG from a standard encoder. Every conversion was made by our converter in Chromium, and the sizes are the files the browser wrote. Closeness was measured against the original PNG as PSNR, plus the largest difference of any single pixel value. The behavior checks (first frame of animations, see-through blending, 16-bit PNGs, JPG to PNG) used dedicated test files. Format facts that are not from this test come from MDN and Google's WebP page, linked above.
Convert HEIC, PNG, WebP, GIF, BMP, AVIF and SVG pictures to JPG, PNG or WebP, one at a time or a whole folder. It runs in your browser. Open the Image Converter.
Frequently asked questions
Is PNG or JPG better quality?
PNG keeps every pixel exactly, so it is the higher-quality file. It is also much bigger for photographs, which is why photos are usually JPG. At a high quality setting a JPG of a photo looks nearly the same as the PNG at normal size, at a fraction of the file size.
Why is my PNG file so large?
Because PNG keeps every pixel and a photograph has millions of slightly different ones. Our test photo was 1,263 KB as a PNG and 153 KB as a JPG at quality 92. A screenshot or logo with flat colors is a different story and stays small as a PNG.
Does converting PNG to JPG lose quality?
Yes, a little, because JPG is lossy. At quality 92 the differences on our test photo were small on average, but a few pixels moved by up to 30 levels out of 255. Keep the PNG if you need an exact copy.
Is WebP better than PNG and JPG?
It usually gives a smaller file than either, and it can be see-through and animated. It is not better everywhere: some older programs and upload forms do not accept it, and a JPG or PNG opens on everything.
Is GIF still worth using?
Rarely. GIF is limited to a palette of 256 colors. MDN recommends PNG for still images that need exact or indexed colors, and WebP, AVIF or APNG for animations, all of which give smaller or better-looking files. Keep GIF for places that ask for it specifically.
Which format should I send to a print shop?
A JPG at a high quality setting (90 to 95) at full size, unless the shop asks for something else. It is accepted almost everywhere and the compression is invisible on paper at that setting. Use PNG for graphics with text or sharp lines, and convert a WebP first, since not every print service takes it.
Can I turn a JPG into a PNG to make it look better?
No. The PNG is an exact copy of the JPG, including its flaws, and it is larger. The conversion is useful for editing without more loss, for tools that want PNG, or as a step before making a background transparent.