Image Compressor

Compress JPEG, PNG and WebP images locally in your browser — by quality, or to an exact target size in KB — files never leave your device, and before/after sizes are shown before you download.

Loading calculator…

Compress your image locally

No upload or network request — files never leave your device. Animated images become a single frame and metadata (EXIF) is not preserved.

Output keeps the source format, except PNG sources are re-encoded as JPEG to achieve real savings (transparency becomes white).

What this tool does

Compress JPEG, PNG and WebP images locally in your browser — by quality, or to an exact target size in KB — files never leave your device, and before/after sizes are shown before you download. Processing happens in the ImageTools panel below. Lower quality means smaller files and more artefacts; PNG sources are re-encoded as JPEG to achieve real savings (PNG itself is lossless). In target-size mode a very small target on a large photo may be unreachable without destroying the image — the panel then reports the smallest size it could honestly reach instead of silently returning an over-target file. Inputs are capped at 30 MB / 40 megapixels.

How to use the Image Compressor

  1. Enter or select compression mode.
  2. Enter or select compression quality (%).
  3. Enter or select target size (kb).
  4. Read the calculated result; change any measurement to compare alternatives.

Formula

Quality mode: decode the local image, draw it to a Canvas at native size, and re-encode as JPEG or WebP with canvas.toBlob(type, quality/100). Target-size mode: binary-search the encoding quality for the largest output at or under the target bytes; if even the lowest usable quality is too big, step the dimensions down and search again.
mode
Compression mode
quality
Compression quality (%)
targetKb
Target size (KB)

Processing happens in the ImageTools panel below. Lower quality means smaller files and more artefacts; PNG sources are re-encoded as JPEG to achieve real savings (PNG itself is lossless). In target-size mode a very small target on a large photo may be unreachable without destroying the image — the panel then reports the smallest size it could honestly reach instead of silently returning an over-target file. Inputs are capped at 30 MB / 40 megapixels.

Worked example

For image compressor, the following measurements illustrate the exact method: Compression mode: quality; Compression quality (%): 70; Target size (KB): 200.

Inputs

  • Compression modeQuality slider
  • Compression quality (%)70
  • Target size (KB)200

Result

  • CompressionSelect a local image in the panel below to compress it and download the smaller copy.

Results explained

Compression
Compression from the formula above. Processing happens in the ImageTools panel below. Lower quality means smaller files and more artefacts; PNG sources are re-encoded as JPEG to achieve real savings (PNG itself is lossless). In target-size mode a very small target on a large photo may be unreachable without destroying the image — the panel then reports the smallest size it could honestly reach instead of silently returning an over-target file. Inputs are capped at 30 MB / 40 megapixels.

Frequently asked questions

70-85% is the usual sweet spot for web photos: large savings with artefacts most viewers will not notice. Go lower (40-60%) for thumbnails, and preview the result before publishing.

Enter the maximum size you need (for example 200 KB for an upload limit) and the compressor searches for the highest quality whose output fits under that size. If no quality setting at full size fits, it steps the pixel dimensions down gradually and searches again, and it tells you the final dimensions and size it reached — it never silently returns a file over your target.

PNG is lossless, so re-encoding it as PNG saves little. The compressor offers JPEG/WebP output for photos; keep PNG only when you need lossless quality or transparency.

Quality mode never changes pixel dimensions. Target-size mode changes them only when quality reduction alone cannot reach the target, and it reports the new dimensions next to the download. Use the Image Resizer when you need an exact pixel size.

No. Files are decoded and re-encoded with the browser Canvas API on your device. There is no upload, no server and no network request — you can verify by processing an image while offline.

Canvas re-encoding does not copy EXIF, GPS or camera metadata into the output — a privacy benefit, but copy any metadata you need before converting.