Image Compressor
Compress and resize JPG, PNG and WebP images in your browser. Drop an image, adjust the quality, optionally change the format or dimensions, and download the smaller file — everything runs locally, so nothing is uploaded. Last reviewed 2026-06-19.
Drop an image here, or browse
JPG, PNG, WebP, GIF, BMP — processed locally, never uploaded.
How it works
The tool draws your image onto an HTML <canvas> and re-encodes it with the
browser's native image encoder. For JPEG and WebP the quality
slider controls how aggressively detail is discarded — lower quality means a smaller file.
PNG is lossless, so the slider has no effect on it; you shrink a PNG by resizing
it or by switching it to WebP. Because the whole process happens in your browser, the picture is
never sent anywhere, and the re-encode strips EXIF/GPS metadata as a side effect.
JPEG vs WebP vs PNG
| Format | Compression | Transparency | Best for |
|---|---|---|---|
| JPEG | Lossy | No transparency | Photographs and complex images. The quality slider works — 70–80 is the usual sweet spot. |
| WebP | Lossy or lossless | Supports transparency | Modern web images. Typically 25–35% smaller than JPEG at the same quality. The quality slider works. |
| PNG | Lossless | Supports transparency | Logos, icons, screenshots and anything with sharp edges or transparency. The quality slider has no effect (PNG is lossless) — resize to shrink it. |
Tips for smaller images
- Resize first. A photo straight from a phone can be 4000 px wide; most web and social uses never need more than 1600–2048 px. Halving the width roughly quarters the file.
- Quality 70–85 is usually indistinguishable from the original for photographs while cutting the size dramatically.
- Prefer WebP for the web — it is typically 25–35% smaller than JPEG at the same visual quality and every current browser supports it.
- Keep PNG for graphics with sharp edges, text or transparency; convert photos out of PNG, which was never meant for them.
Good to know
- If the “compressed” file comes out larger than the original — common when re-saving an already-optimised JPEG at high quality — keep your original; the tool will say so.
- Animated GIFs and animated WebP are flattened to their first frame (canvas captures a single frame).
- Your original file is never modified; you always download a new copy.
Lossy vs lossless: two different bargains
Every image format makes one of two promises. A lossless format (PNG, GIF, or WebP in lossless mode) guarantees that the file you decode is identical to the original, pixel for pixel — it only saves space by describing the existing pixels more compactly. A lossy format (JPEG, and WebP or AVIF in their usual mode) is allowed to throw away information the eye is unlikely to miss, which buys far smaller files at the cost of some fidelity. That single distinction explains almost everything about why compression behaves the way it does: the quality slider only has teeth on a lossy format, because only a lossy format has detail it is permitted to discard. Run a JPEG through at quality 60 and you get a much smaller file; do the same to a PNG and nothing happens to the slider, because PNG has no detail it is allowed to drop.
The trade is not linear, either. Lossy formats can shed the first 60–70% of a photo's file size with changes that are genuinely invisible at normal viewing distance, then start to show visible damage — soft edges, smeared text, blocky skies — as you push past the point where only meaningful information is left to remove. The art of compression is finding that knee in the curve, which is why the tool shows you the before/after size and a live preview rather than just applying a fixed setting.
Inside a JPEG: what the quality slider really changes
JPEG (named for the Joint Photographic Experts Group that standardised it in 1992) is built around how human vision actually works, and understanding its four stages makes the quality slider far less mysterious.
- Colour conversion. The image is converted from RGB to YCbCr — one brightness channel (Y, luma) and two colour-difference channels (Cb and Cr, chroma). The eye is much more sensitive to brightness than to colour, so splitting them lets the encoder treat colour more roughly.
- Chroma subsampling. Most JPEGs store the two colour channels at half
resolution in each direction (called
4:2:0), immediately cutting colour data by about 50% with almost no visible effect on photographs — though it is exactly why fine red text or saturated edges can look fringed in a heavily compressed JPEG. - The DCT. Each channel is split into 8×8 pixel blocks, and a Discrete Cosine Transform converts each block from pixels into a set of frequency coefficients — a few that describe broad tones and many that describe fine detail.
- Quantisation. This is the one irreversibly lossy step. Each coefficient is divided by a value from a quantisation table and rounded, which zeroes out most of the fine-detail coefficients. The quality slider simply scales that table: lower quality means coarser division, more zeros, a smaller file — and, eventually, the visible 8×8 "blocking" that is JPEG's signature artefact.
So when you drag this tool's quality control down, you are telling the browser's JPEG encoder to quantise more aggressively. Around 70–85 the rounding stays below the threshold of perception for most photos; below about 50 the block structure and colour fringing start to show. This is also why re-compressing an already-compressed JPEG is wasteful: the detail was discarded the first time, so a second pass mostly just adds new rounding error to an already-degraded image. Compress from the original whenever you can.
WebP and AVIF: the modern alternatives
WebP, released by Google in 2010, borrows the predictive coding used by the VP8 video codec: instead of compressing each block in isolation, it predicts a block from its neighbours and stores only the difference. Google's own study measured WebP lossy files at roughly 25–34% smaller than JPEG at equivalent visual quality, and WebP lossless files about 26% smaller than PNG. It also supports transparency and animation, which JPEG never could. Every current browser has supported it for years (Chrome since 2010, Firefox 65, and Safari 14 in 2020), so for most web work WebP is the sensible default this tool offers.
AVIF goes a step further. Built on the royalty-free AV1 video codec inside the same HEIF container Apple uses for iPhone photos, it commonly reaches around 50% smaller than JPEG and beats WebP on both file size and colour depth. Support is now broad (Chrome 85, Firefox 93, Safari 16), though AVIF encoding is slower and browser-canvas support for writing AVIF is still uneven — which is why this tool standardises on JPEG, WebP and PNG, the three formats every browser can both read and re-encode reliably.
Why a PNG barely shrinks here — and how to really compress one
PNG, finalised by the W3C in 1996 as a patent-free replacement for GIF, is lossless by design. It works in two stages: each row of pixels is first filtered (one of five predictors — None, Sub, Up, Average, or the clever Paeth filter — replaces each pixel with the small difference from its neighbours), and the filtered data is then compressed with DEFLATE, the same LZ77-plus-Huffman algorithm used inside ZIP files. Because it never discards detail, re-saving a PNG at the same size through a browser canvas almost never makes it smaller — the canvas re-encoder cannot match the careful per-row filter choices and palette quantisation that dedicated PNG optimisers (like pngquant or OxiPNG) use.
So if a PNG is too big, you have three good moves: resize it smaller (fewer pixels is the one thing that always shrinks a PNG); convert a photo out of PNG into JPEG or WebP, since PNG was designed for flat graphics, logos and screenshots, not photographs; or keep PNG only where you genuinely need lossless edges, sharp text, or transparency. For a screenshot of a webpage, WebP-lossless or a resized PNG is usually the right answer; for a JPEG-style photo saved as PNG, switching format can cut the file by 80% or more.
Compression, page speed and Core Web Vitals
Images are typically the heaviest part of a web page, so compressing them is one of the highest- leverage things you can do for performance. A smaller image downloads faster, which directly improves Largest Contentful Paint (LCP) — the Core Web Vitals metric that measures how quickly the main content appears, and one Google uses as a ranking signal. On mobile connections and metered data plans the difference between a 3 MB phone photo and a 200 KB web-ready version is the difference between a page that feels instant and one that visibly loads.
Two habits multiply the benefit. First, resize before you compress: a photo straight off a phone can be 4000 px wide, but a full-width web hero rarely needs more than 1600–2048 px, and halving the width roughly quarters the pixel count. Second, serve the image at the size it is actually displayed — encoding more pixels than the layout shows is pure waste. This tool's "max width" control lets you do both in one pass, decoding the original, scaling it down, and re-encoding at your chosen quality.
Why doing it in your browser matters
Most "free image compressors" upload your picture to a server, process it there, and send back a
result — which means your photo, with whatever it contains, briefly lives on someone else's
machine. This tool never does that. It decodes the image with the browser's built-in
createImageBitmap(), draws it to an off-screen <canvas>, and
re-encodes it with the browser's native canvas.toBlob() encoder, entirely on your
device. Nothing is uploaded, nothing is logged, and it keeps working offline once the page has
loaded.
There is a privacy bonus baked into how the canvas works. A camera photo carries an EXIF metadata block — camera model, the exact date and time, and often the GPS coordinates where the shot was taken. Re-encoding through a canvas produces a clean image with no EXIF block at all, so that data is stripped automatically every time you compress. That is ideal when you are about to post a photo publicly, and a reason to keep your original safe if you ever need the metadata back.
Picking a quality setting for common jobs
There is no single "right" quality — it depends on how the image will be seen. As a starting point for the JPEG/WebP slider:
| Use | Quality | Why |
|---|---|---|
| Hero / full-screen photo | 80–85 | Large on screen, so artefacts would show; still cuts most of the size. |
| Blog body / thumbnail | 70–80 | Viewed smaller; the eye forgives more, so you can push harder. |
| Social media upload | 75–82 | The platform re-compresses anyway — don't pre-degrade it too far. |
| Email attachment | 65–75 | Priority is a small, send-friendly file over pixel-perfection. |
| Background / decorative | 55–70 | Behind other content, so heavy compression is invisible. |
Whatever you pick, trust the live preview and the before/after numbers over a fixed rule — a flat blue sky and a detailed cityscape behave very differently at the same quality value.
Frequently asked questions
- Is my image uploaded to a server?
- No. The image is decoded and re-encoded entirely in your browser using the built-in Canvas API — it never leaves your device and is never logged or transmitted. It also works offline once the page has loaded, which is why it is safe to compress private photos, screenshots or scans.
- Does compressing reduce the image quality?
- For JPEG and WebP, yes — they are lossy, so a lower quality setting throws away more detail to make the file smaller. Around 70–85 is usually indistinguishable from the original for photos. PNG is lossless, so re-encoding it never loses quality; to make a PNG smaller you resize its dimensions or switch it to WebP.
- Which format should I choose for the web?
- WebP gives the smallest files for both photos and graphics and is supported by every current browser, so it is the best default for the web. Use JPEG for photos when you need maximum compatibility, and PNG only when you need lossless quality or transparency.
- Why is my compressed PNG not any smaller?
- PNG is already lossless and the canvas re-encoder cannot apply the palette/quantisation tricks dedicated PNG optimisers use, so re-saving a PNG at the same dimensions rarely shrinks it. To reduce a PNG, lower the "Resize" max width, or convert it to JPEG (if it has no transparency) or WebP — both will be far smaller.
- Is there a file-size or resolution limit?
- There is no fixed limit, but everything happens in your browser tab, so very large images (tens of megapixels) use more memory and take a moment to process. If a huge image is sluggish, set a "Resize" max width — most web and social uses never need more than 1600–2048 px wide.
- Does it remove EXIF / GPS metadata from my photo?
- Yes. Re-encoding through the canvas produces a clean image with no EXIF block, so camera model, date and GPS location are stripped automatically. That is a privacy bonus when sharing photos — though it also means you should keep your original if you want to preserve that metadata.