Image Compressor
Compress and resize JPEG, PNG, and WebP images, entirely in your browser.
How to use the Image Compressor
- Click to choose a JPEG, PNG, WebP, or GIF image from your device.
- Pick an output format and set the quality slider — around 70–80% is usually visually identical for photos.
- Optionally enter a max width in pixels to shrink oversized photos.
- Press Compress image, compare the original and compressed sizes, then download the result.
About the Image Compressor
Large image files slow down websites, fill up storage, and are annoying to email or upload. This tool shrinks JPEG, PNG, WebP, and GIF images by re-encoding them at a lower quality setting and, optionally, resizing them down to a maximum width — usually cutting file size dramatically with little visible difference at normal viewing sizes.
Unlike most online compressors, nothing here is uploaded to a server: the image is decoded and re-encoded entirely inside your browser using the HTML canvas API, so the file never leaves your device. That also means there's no file-size upload limit imposed by a server, and it works offline once the page has loaded.
Worked example
Example: a 4 MB JPEG photo straight from a phone camera, compressed at 80% quality with a 1600px max width, typically comes out around 200–400 KB — a 90%+ size reduction that's barely noticeable on screen.
Resizing saves more than quality
File size depends mostly on how many pixels an image has. Halving the width (and with it the height) removes three-quarters of the pixels, which usually shrinks the file more than any quality setting. Phone photos are often 4,000 pixels wide or more, while a full-width image on a website rarely needs more than about 2,000 pixels, and an image in an email about 1,200. To look sharp on high-density screens, aim for roughly twice the width the image is displayed at.
Once the size is right, use quality to fine-tune. The default of 80% is a good balance for photos. Below about 60%, JPEG starts to show blocky artifacts in skies and smooth gradients.
What changes when an image is re-encoded
The image is redrawn on a canvas and saved as a new file, so a few things don't carry over:
- Metadata is removed, including camera details and GPS location. That's a privacy bonus when sharing photos online.
- Transparency is lost in JPEG. Transparent areas usually turn black, so keep logos and icons with transparent backgrounds as PNG or WebP.
- Animated GIFs become a still image of the first frame.
- Color profiles may be converted to standard sRGB, which can subtly shift very saturated colors from professional cameras.
Picking settings by use
- Website photos: WebP at 75–85% quality, resized to the largest size it's actually shown at.
- Email attachments and forms with upload limits: JPEG at 70–80%, max width 1,200–1,600 px.
- Screenshots with text: PNG keeps text crisp; if it's still too large, try WebP at a high quality setting.
- Keep your original. Every lossy save loses a little more detail, so always compress from the original, never from an already compressed copy.
Frequently asked questions
- Will compressing reduce image quality?
- For JPEG and WebP, yes to some degree — both use lossy compression, so lower quality settings trade visual fidelity for smaller files. Quality settings of 70–85% are usually a good balance where the difference is hard to spot at normal zoom levels. PNG compression here is lossless — it never loses quality, but also compresses less than JPEG or WebP for photos.
- Which format should I choose?
- WebP typically gives the smallest file size at a given quality and is supported by all modern browsers — it's the best default for web use. JPEG is the safest choice for maximum compatibility with older software. PNG is best reserved for images that need transparency or that are mostly flat colors/text, like screenshots or logos.
- Is my image uploaded anywhere?
- No. The entire process — decoding, resizing, and re-encoding — happens locally in your browser using the canvas API. Nothing is sent to a server, which makes this safe to use on private or sensitive photos.
- Why did my PNG file get bigger after 'compressing' it?
- If a PNG is re-encoded without resizing, the output can occasionally end up slightly larger than a source file that was already optimized with a dedicated PNG compressor. To actually shrink a PNG here, set a smaller max width, or convert it to JPEG/WebP if transparency isn't needed.