Compress an image to a KB limit

Choose a maximum size such as 20 KB, 50 KB, 100 KB, or 200 KB. Add a JPG, PNG, or WebP to compress it on your device, then check the final size before downloading.

Target maximum file size (KB)

or drop here · JPG, JPEG, PNG, WebP · Up to 100 MB per file

How Compress to KB works

Squeezo runs a 10-step binary search across encoder quality settings on OffscreenCanvas inside a background Web Worker.

For transparent PNG inputs, the engine inspects pixel alpha channels first and preserves transparency using quantized PNG palettes or WebP.

When your requested target KB cannot be satisfied at full dimensions even at low lossy quality, the optional resize toggle runs a secondary dimension binary search to shrink width and height proportionally until the limit is met.

Step-by-step usage

  1. Drop one or more JPG, PNG, or WebP files into the workspace.
  2. Select a preset ceiling (20 KB, 30 KB, 50 KB, 100 KB, 200 KB, 500 KB) or enter any custom KB figure.
  3. Choose Auto format to preserve transparency, or select JPG/WebP explicitly.
  4. Keep dimension reduction enabled if you are compressing high-resolution camera photos to small limits like 20 KB or 50 KB.
  5. Inspect the before-and-after preview slider, check the actual resulting KB, and download individually or as a ZIP archive.

How to prepare photos for online forms

Supported formats and technical notes

Formats

Inputs verified by binary magic-byte headers before decoding:

Input: JPG, JPEG, PNG, WebP

Output: Auto (keeps alpha transparency), JPG, WebP, PNG

Implementation notes

  • Target KB is treated as a strict maximum file-size ceiling. Actual bytes are measured from the encoded Blob before finishing.
  • Lossless PNG output is attempted first when targeting PNG; if lossless bytes exceed your ceiling, palette quantization reduces color count while retaining the alpha channel.
  • All pixel decoding and binary search loops run locally in your browser memory and revoke object URLs immediately on reset.

Privacy handling

All image decoding, pixel transformations, and file packaging execute inside your browser tab via Canvas, OffscreenCanvas, and WebAssembly codecs. Your original files and exported outputs are not transmitted to Squeezo servers. Review full details in our Privacy Policy.

Questions about Compress to KB

Can every 10 MB photo fit into 20 KB without resizing dimensions?

No. A 4000×3000 photograph contains too much pixel entropy to encode under 20 KB at original dimensions without severe blocking artifacts. Enable automatic dimension reduction so the optimizer scales width and height down cleanly alongside quality tuning.

What happens when I upload a transparent PNG?

Squeezo detects alpha channel transparency before encoding. In Auto mode it keeps PNG (or lets you select WebP) so transparent backgrounds never turn solid black or white unless you explicitly pick JPEG.

Do my images leave my computer or phone?

No. File decoding, binary search compression, and ZIP packaging execute inside local Web Workers and browser canvas APIs.

Related image tools