Compress Image to KB
Try to fit a JPG or PNG under a chosen byte limit by searching JPEG quality and reducing dimensions. The result may remain above the target; inspect its size.
Before you start
- Choose one nonempty JPG or PNG up to 12 MiB. Signature checks and browser decoding are both required; WebP and HEIC are not accepted here.
- Enter a whole target from 5 to 12000 KB. Here 1 KB means 1024 bytes, so 100 KB means 102400 bytes; use a smaller target if a form counts decimal kilobytes.
How to use the Compress Image to KB
- Choose one nonempty JPG or PNG up to 12 MiB. Signature checks and browser decoding are both required; WebP and HEIC are not accepted here.
- Enter a whole target from 5 to 12000 KB. Here 1 KB means 1024 bytes, so 100 KB means 102400 bytes; use a smaller target if a form counts decimal kilobytes.
- Press Compress to target. The algorithm tries eight quality steps per scale, within 0.18–0.92, then shrinks both dimensions by 0.82 if necessary, for up to seven scales.
- The JPEG downloads as compressed-target.jpg. Transparent regions become white. Read the achieved-size message; if the search cannot meet the target, the smallest attempted file is still downloaded with a warning.
File handling and privacy
The inspected processing code reads selected files in browser memory and has no file-upload request. The page and decoder assets still load over the network. This does not guarantee what third-party scripts, browser extensions or a compromised device can access. Canvas output does not intentionally copy source EXIF, GPS, camera tags or color profiles; do not rely on this as certified metadata sanitization. Check orientation, colors and the downloaded file before sharing.
Browser and memory limits
One file at a time, using the file picker; no dedicated drag-and-drop, batch export, crop, positioning, rotation or clipboard controls. Browser image decoding and canvas encoding must be available. Decoded images and canvases use much more memory than compressed input bytes. A 4000 × 3000 RGBA buffer alone is about 48 million bytes, before extra copies. The dimension guard is 8192 pixels per side and 24 million pixels, checked after decoding; it cannot prevent every decode-time memory failure.
Examples
Leave room for decimal limits
For a form capped at 100000 bytes, a 97 KB setting means 99,328 bytes. Check the actual file because the search may fail to reach even that target.
Preserve readable documents
A small portrait may tolerate downscaling, while a screenshot with tiny text may become unreadable. Check both pixel dimensions and legibility before submitting.
Frequently asked questions
Is this an exact-size encoder?
No. It prefers the largest attempted candidate at or below the target. If none fits, it returns the smallest attempted candidate and reports that the target was missed.
Does it keep my PNG transparency?
No. The canvas is filled white before JPEG encoding; JPEG has no alpha channel. Use PNG or WebP output in Image Resizer if alpha matters.
Why did pixel dimensions change?
If quality reduction is insufficient, the tool tries smaller dimensions. Width and height are rounded separately to whole pixels, so tiny ratio rounding differences are possible.
Can I undo the compression?
Keep your source. JPEG compression and downscaling discard information; converting the result back to PNG does not restore it.
More image tools
Image Resizer
Resize JPG, PNG and WebP by pixels or percentage. Keep the source ratio or set exact dimensions, then compare JPG, PNG or WebP output.
Open tool →Image Compressor
Re-encode JPG, PNG or WebP at original dimensions with a WebP quality setting. Compare measured file sizes and download the actual browser output.
Open tool →WebP to PNG
Convert one still WebP image to PNG with alpha support. Retain decoded dimensions and understand why output size may increase.
Open tool →HEIC to JPG
Try HEIC/HEIF to JPEG conversion with heic2any in the browser. Review codec limits, quality, metadata and single-image output.
Open tool →WebP to JPG
Convert one still WebP image to JPEG with adjustable quality and a white background. Check dimensions, byte size and browser support.
Open tool →Aspect Ratio Calculator
Simplify a pixel width-to-height ratio and calculate the rounded height for a new width. Includes portrait and landscape examples.
Open tool →