Image compressor
Drop your images, pick a format and a quality, and watch the bytes come off each file. Your browser does the work, so the pictures stay on your device.
- Images are only made smaller to fit the maximum size, never enlarged, and the proportions are kept.
- The new file is drawn from the pixels alone: EXIF data, GPS location, camera model and color profile are left out. The rotation stored by the camera is applied first, so the picture stays upright.
- JPEG has no transparency: a transparent image saved as JPEG gets a white background.
Your images are opened and re-encoded by your own browser. They are not uploaded, and nothing is kept once you close the page.
Where the weight of an image comes from
An image file is a grid of pixels written down in a compact way. Its size comes down to two numbers, which are how many pixels there are and how many bytes the format spends on each one.
People tend to forget the first number. A phone photo is about 4000 by 3000 pixels, 12 million in all. A web page column is rarely wider than 800 CSS pixels, or 1600 real pixels on a sharp screen. Send the full photo there and the browser downloads 12 million pixels to throw away 10 million of them. Halving a picture’s width divides its pixel count by four, and its file size by nearly as much. That’s why this tool has a maximum width and a maximum height. Set one and each picture is scaled down to fit, with its proportions kept. A picture that’s already smaller is left at its size.
The second number depends on the format and on the quality setting. Lossy formats don’t store every pixel. They store a description that looks the same to the eye, and the quality number says how much difference you’re willing to accept.
Which format to choose
| Format | Good for | Keep in mind |
|---|---|---|
| JPEG | Photos that have to open anywhere: email attachments, old software, print shops. | No transparency. It dates from 1992, so it’s the least efficient of the lossy formats. |
| WebP | Photos and illustrations on a website. Usually 25 to 35% smaller than JPEG at the same look. | Every current browser shows it. Some desktop programs and upload forms still refuse it. |
| AVIF | The smallest files, often half the JPEG size. Smooth gradients and skies stay clean at low sizes. | Slow to encode. Shown by Chrome 85, Firefox 93, Safari 16.4 and later. Older browsers need a fallback. |
| PNG | Screenshots, logos, line drawings, anything with flat color and sharp edges. | Lossless. A photograph saved as PNG is several times larger than the JPEG it came from. |
On a web page you can serve the modern format and keep a fallback for older browsers:
<picture>
<source srcset="team.avif" type="image/avif">
<source srcset="team.webp" type="image/webp">
<img src="team.jpg" alt="The team in the workshop" width="1600" height="1067">
</picture>What this page does with your file
Every file goes through the same steps. They’re handled one file at a time, so memory use stays flat:
- We read the first bytes to learn the format and the pixel size. A file over 40 MB or about 50 megapixels is refused before it can freeze the tab.
- The browser decodes the picture and applies the rotation the camera recorded, so portraits stay upright.
- The picture is drawn on a canvas at the target size.
- The canvas is encoded. JPEG, WebP and PNG use the encoder built into your browser. AVIF uses libavif compiled to WebAssembly, a 3.5 MB file fetched from this site the first time you pick AVIF. It runs in a background thread so the page keeps responding.
The new file is built from pixels and nothing else, so nothing else comes along: no EXIF block, no GPS position, no camera serial number, no embedded thumbnail. Colors are converted to sRGB, the standard web color space.
Re-encoding a lossy file loses a little more each time. Compress from the original, once, and keep the original somewhere.
Reading the result
Each card shows the old and new size, the share saved and the dimensions before and after. The comparison is there for judging quality. Drag the divider across a face, a sky or a line of text, since that’s where compression shows first. If you can’t see anything at 100% zoom, lower the quality by ten and look again.
Sometimes the new file comes out larger. It’s usually a photo converted to PNG, an original that was already compressed hard, or a quality set near 100. The card says so and lets you save the original instead.
Two results depend on your browser. Safari can’t write WebP from a canvas and returns PNG, which the tool detects and tells you about. HEIC photos from an iPhone can only be opened by Safari 17 and later. Anywhere else, export them as JPEG first.
Questions people ask
Are my images uploaded to a server?
No. Decoding, resizing and encoding all happen in your browser. The only download is the AVIF encoder itself, when you choose AVIF. You can load the page, go offline and still compress to JPEG, WebP or PNG.
What quality should I use for JPEG or WebP?
Start at 75 to 80. On a screen that’s very hard to tell from the original, and the file is often a third of what a camera writes. Go down to 60 for thumbnails and backgrounds. Above 90 the file grows fast and you won’t see the gain.
Is AVIF better than WebP?
For file size, yes. An AVIF is commonly 20 to 30% smaller than a WebP that looks the same. WebP encodes much faster and is accepted in more places. On a website, AVIF with a WebP or JPEG fallback gets you both.
Why is the compressed file bigger than the original?
Because the original was already smaller than what the new format and quality produce. It happens with photos saved as PNG, with JPEGs that were compressed hard before, and with quality settings close to 100. Keep the original, or lower the quality.
Does compressing remove the location from a photo?
Yes. The output is encoded from the pixels and carries no EXIF, GPS or camera data. If you’d like to see what a photo contains before it goes, the photo EXIF remover shows you, and it can also clean a file without re-encoding it.
What happens to an animated GIF?
Only the first frame is kept, as a still image. This tool doesn’t produce animations.