Image Compressor
Published Updated
Re-encode an image as JPEG or WebP at a quality from 10 to 100 and see the new file size before you download it.
What one photo became at each setting
The slider only matters for JPEG and WebP. Here is a 2000 x 1500 test photo, a 307,159-byte JPEG, re-encoded by Google Chrome 156's canvas encoder, which is what this tool uses:
| Output | Quality | Size | Compared with the original |
|---|---|---|---|
| JPEG | 50 | 71,868 bytes | 77% smaller |
| JPEG | 80 (default) | 159,658 bytes | 48% smaller |
| JPEG | 95 | 363,531 bytes | 18% larger |
| JPEG | 100 | 1,304,212 bytes | 4.2 times larger |
| WebP | 80 | 59,410 bytes | 81% smaller |
At 95 and 100 the tool offers the original instead of those larger files. The same photo stored as a 2,052,270-byte PNG and left in Original Format would come back as 3,471,337 bytes whatever the slider said, so that PNG is returned unchanged too. Flat graphics and screenshots behave differently again, as the next section shows.
Screenshots and logos need a different choice
For a flat 1280 x 800 screenshot saved as a 4,593-byte PNG, JPEG was the worst option: 46,206 bytes at quality 80, ten times the original. WebP at 80 gave 4,108 bytes, and WebP at 100, which Chrome writes losslessly, gave 1,804 bytes. For graphics like this, choose WebP, which has a lossless mode as well as a lossy one, or try PNG Compressor, which also scales the image down.
Re-encoding a JPEG always loses a little detail, even when the file grows. Compress from the best copy you have rather than from a file that was compressed before.
The same photo through three browsers' encoders
The slider value goes to the browser's own encoder, so one setting gives a different file in each browser. When a browser cannot write the type that was asked for, the HTML standard has the canvas write PNG instead, which is why the tool checks the type of what it gets back. Measured with this tool on generated files, a 1600 x 1200 photo saved as JPEG, PNG and WebP, in Google Chrome 157, Firefox 155 and Playwright's WebKit build (not the Safari app); each cell is what the download button offers:
| Input and setting | Chrome 157 | Firefox 155 | The WebKit build |
|---|---|---|---|
| JPEG, 165,601 bytes: Original Format, quality 80 | 132,802 bytes | 144,043 bytes | Original returned |
| JPEG: Original Format, quality 95 | Original returned | Original returned | Original returned |
| JPEG: Convert to JPEG, quality 50 | 56,526 bytes | 69,217 bytes | 113,739 bytes |
| JPEG: Convert to WebP, quality 80 | 49,246 bytes | 49,032 bytes | Message: This browser can't create WebP files |
| JPEG: Convert to WebP, quality 100 | 1,363,434 bytes, flagged as bigger than the original | 1,192,076 bytes, flagged as bigger than the original | Message: This browser can't create WebP files |
| PNG, 1,439,291 bytes: Original Format | Original returned | Original returned | Original returned |
| PNG: Convert to JPEG, quality 80 | 109,238 bytes | 118,527 bytes | 209,961 bytes |
| PNG: Convert to WebP, quality 80 | 48,488 bytes | 48,182 bytes | Message: This browser can't create WebP files |
| WebP, 48,182 bytes: Original Format, quality 80 | 45,112 bytes | 44,682 bytes | Original returned |
| WebP: Convert to JPEG, quality 80 | 93,587 bytes, flagged as bigger than the original | 102,355 bytes, flagged as bigger than the original | 175,688 bytes, flagged as bigger than the original |
In Original Format the tool hands back your file when the re-encode is not smaller, which is what the WebKit build gets for the JPEG at quality 80 and for the WebP. A conversion you asked for is still offered when it is bigger, with a line saying so.
Transparency, Exif tags and rotation in the result
| Test file | Setting | Result |
|---|---|---|
| PNG logo with transparent areas, 800 x 500, 20,332 bytes | Original Format | Original returned in all three browsers |
| Same logo | Convert to JPEG, quality 80 | Top-left pixel white (255, 255, 255) in all three. 13,891 bytes in Chrome 157, 16,802 in Firefox 155, 23,562 in the WebKit build, where it is flagged as bigger than the original |
| Same logo | Convert to WebP, quality 80 | 18,882 bytes in Chrome 157 and 14,956 in Firefox 155. The top-left pixel keeps alpha 0 and a shadow pixel keeps alpha 121, as in the PNG. The WebKit build shows its WebP message |
| JPEG with camera make, model, date and GPS tags in its Exif segment, 131,996 bytes | Quality 80 | 55,667 bytes in Chrome 157 and 59,729 in Firefox 155, with no Exif segment. The WebKit build wrote 110,515 bytes with a 76-byte Exif segment that holds one pointer tag and none of the make, model, date or GPS tags |
| Same photo | Quality 100 | Original returned in all three browsers, tags included, because the re-encode is not smaller |
| JPEG stored as 600 x 400 with an EXIF orientation of 6, 6,875 bytes | Quality 80 | The preview line and the file are 400 x 600 in all three browsers: 3,412 bytes in Chrome 157, 6,433 in Firefox 155, original returned in the WebKit build |
Compressing an image
Step 1
Add one image
Any image your browser can display. The pixel size and file size show next to the preview.
Step 2
Set quality and format
The quality slider runs from 10 to 100 (default 80). Output can stay in the original format or switch to JPEG or WebP.
Step 3
Watch the size, then download
The image is re-encoded 0.2 seconds after each change, and the card shows the new size. Saved N% appears only when the file shrank.
When to use a sibling tool
- A size limit such as 100 KB for a form: Compress Image to Size.
- JPEG only, with the same slider: JPEG Compressor.
- Fewer pixels: Resize Image or Bulk Image Resizer.
- A change of format without a quality target: Image Converter.
Image compressor questions
Why does the quality slider not change my PNG?
PNG is lossless, and the browser's PNG encoder ignores the quality value. With Original Format chosen, the re-encoded PNG is often larger than before: a 4,593-byte screenshot would come back as 23,973 bytes, so the tool gives you the original file instead and says so. Switch the format to WebP or JPEG to make the slider work.
What quality should I use for photos?
Start at the default 80. On a 2000 x 1500 test photo that turned a 307 KB JPEG into 160 KB. Go lower only while the preview still looks right to you. At 95 and 100 the same photo came out bigger than the original, so the tool returns the original file unchanged.
What happens to transparent areas in a JPEG?
They become white. JPEG cannot store transparency, so the tool paints a white background before converting, and a note under the format menu says so. Choose WebP to keep the transparency.
Does it change the width and height?
No. The output has exactly the pixel size of the input. To make an image smaller in pixels too, use Resize Image first, or Compress Image to Size, which can scale down to reach a byte limit.
Is EXIF data such as location kept?
Not in a re-encoded file. The image is redrawn on a canvas, which carries pixels only, so camera details and GPS coordinates are dropped. In Chrome the picture stays upright, because the orientation tag is applied when the photo is drawn. When the tool hands back your original because the new file would not be smaller, that file is untouched, metadata included.
Does WebP work in every browser?
Saving WebP works in Chrome, Edge and Firefox 96 or later. Safari's canvas cannot write WebP, according to MDN's compatibility data, and falls back to PNG data, so choose JPEG when you are in Safari.
Is there a pixel limit for JPEG or WebP output?
Yes. WebP allows at most 16,383 pixels a side, and this page saves JPEGs up to 65,500. Over either limit you get a message with the picture's size and no file, so keep Original Format for a picture that large. A 65,535 x 8 PNG set to Convert to JPEG got that message in Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and the WebKit build.
Why did I get my own JPEG back in one browser and a smaller one in another?
Each browser's JPEG encoder writes its own file. The 165,601-byte test photo at quality 80 came out at 132,802 bytes in Chrome 157 and 144,043 bytes in Firefox 155. In the WebKit build the re-encode was not smaller, so the tool returned the original, as it does whenever a re-encode in the same format is not smaller.
What do I see in a browser that cannot write WebP?
The tool says This browser can't create WebP files, so nothing was saved, and suggests another format. That was the result in the WebKit build for the test JPEG, PNG and logo set to Convert to WebP. Chrome 157 and Firefox 155 wrote WebP files: 49,246 and 49,032 bytes for the test photo at quality 80.
Does a rotated phone photo stay upright?
In the test it did in all three browsers. A JPEG stored as 600 x 400 with an EXIF orientation of 6 showed 400 x 600 in the preview line and gave a 400 x 600 file in Chrome 157, Firefox 155 and the WebKit build.
Does a WebP made from a transparent PNG stay transparent?
In Chrome 157 and Firefox 155 it did. The top-left pixel of the 800 x 500 test logo stayed fully transparent and a shadow pixel kept its alpha of 121, the value in the source PNG. The WebKit build cannot write WebP. A JPEG fills transparent areas with white.
Related guides
JPG, PNG, WebP, HEIC and SVG: which image format to use. The guide compares quality settings on one photo and explains why re-saving a JPEG usually costs a little detail.
How to open and convert HEIC photos. The guide compares compressing a quality-90 JPG with converting from the HEIC at the final quality, at 80, 60 and 40.