Skip to content

Image Compressor

Shrink JPG, PNG and WebP files without leaving your browser.

Updated · Examples checked by automated tests

LOCAL WORKSPACENO UPLOAD REQUIRED

Drop an image to compress

JPG, PNG, WebP or AVIF — compression happens on your device

About Image Compressor

Images dominate page weight, and an unoptimised photo straight from a phone camera can be several megabytes. Compressing before upload is the single biggest win available for page speed.

This compressor re-encodes your image at the quality level you choose, shows the before and after size side by side, and can optionally cap the largest dimension - all on your own device.

How Image Compressor works in your browser

The image is decoded into an offscreen <canvas> and re-encoded with canvas.toBlob() at the quality level you choose. Every step happens in your device’s memory using the browser’s own image codecs — the same ones it uses to display any image on any page.

Quality maps to the JPEG or WebP encoder’s quantisation setting. Values around 0.8 typically remove most of the file size with no difference visible at normal viewing distance; below about 0.6, artefacts start to show in smooth gradients and around sharp edges.

One consequence of the canvas round trip is worth knowing: EXIF metadata does not survive it. Camera model, timestamp, lens settings and — importantly — GPS coordinates are all dropped. If you are publishing photos, that is a privacy improvement you get for free. If you need the metadata, keep the original.

When to use it

  • Getting a photo under an upload size limit for a form or a job application.
  • Reducing page weight before publishing images to a site or a blog post.
  • Stripping GPS coordinates out of a photo before sharing it publicly.
  • Compressing pictures of family, documents or ID — the images that have no business being uploaded to a stranger’s server to be made smaller.

Worked examples

Shrink a camera photo for the web

Settings: Maximum width 1600 px

Input

Photo 4032 × 3024 px

Expected output

Output: 1600 × 1200 px

Halving the width quarters the pixel count, which usually saves far more than lowering quality. The height follows the original 4:3 ratio.

A maximum width never enlarges

Settings: Maximum width 1600 px

Input

Screenshot 1280 × 720 px

Expected output

Output: 1280 × 720 px

The image is already narrower than the limit, so its size is kept and only the quality setting reduces the file.

Limits and checks before you use the result

  • Re-encoding a PNG that is already optimised can make it larger. The tool warns you; try WebP output or keep the original.
  • Camera metadata, including GPS location, is not copied into the compressed file.
  • JPEG has no transparency, so transparent areas become white. Choose WebP or PNG to keep them.

Frequently asked questions

Are my images uploaded?

No. Compression uses a canvas in your own browser, so the file never leaves your device.

How do I reduce an image file size?

Drop the image, lower the quality slider until the preview still looks right, and compare the before and after sizes. Setting a maximum width shrinks large camera photos much further than quality alone.

Why did my PNG get bigger?

PNG is lossless. Re-encoding an already-optimised PNG can add bytes - convert it to WebP instead for a real reduction. PNG files default to WebP output for that reason.

Does compression lose quality?

JPEG and WebP are lossy, so yes, but the quality slider lets you find the point where the difference stops being visible.

Which format gives the smallest file?

WebP is usually smallest at similar visual quality and keeps transparency. JPEG is the most widely accepted by upload forms. PNG output is lossless, so it rarely shrinks photos.

Guides

Related tools