FormatFlow

No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Image Tools · Updated October 25, 2026 · Reviewed by FormatFlow Editorial

Compress Image to Size

You can compress a JPG, PNG or WebP image to a target size such as 20 KB, 50 KB or 100 KB in your browser. It lowers quality and, if needed, pixel dimensions until the encoded file fits, then reports the real size, quality and dimensions.

Runs in your browserFree · No sign-up · No watermark
JPGPNGWebPJPG / WebPRuns in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

At a glance

Formats
JPG, PNG, WebP → JPG or WebP
Processing
In your browser
Max size
50 MB per file
Price
Free, no account
Updated
October 25, 2026
All Image Tools

About Compress Image to Size

Most compressors ask for a quality percentage and leave you guessing whether the file will pass a size limit. This tool starts from the limit instead: pick a target such as 50 KB for a job application or 100 KB for an upload form, and it measures real encoded sizes while lowering quality and, only when necessary, pixel dimensions.

Everything happens inside your browser with the Canvas API, so the photo is never uploaded. Each attempt is encoded and measured for real, which means the reported size is the size of the file you download, not an estimate. The panel shows the quality level and pixel dimensions that were used, so you can judge the trade-off before submitting the image.

What this tool does

The details that matter when you use Compress Image to Size for real work.
  • Compress to a size limit

    Choose 20, 50, 100, 200 or 500 KB, or type a custom target, and the tool searches for the largest encoded file that stays within it.

  • Real measured output

    Every attempt is encoded and measured, so the size shown is the actual download size rather than a guess.

  • Quality and dimensions reported

    Results list the quality level, final pixel dimensions and the percentage saved, so nothing about the trade-off is hidden.

  • JPG or WebP output

    Use JPG for maximum compatibility or WebP for a smaller file; transparent areas are kept in WebP and filled with white in JPG.

  • Optional width and height caps

    Add a maximum width or height when the destination also limits pixels; images are never enlarged beyond their original size.

  • Honest impossible-target warning

    If a target cannot be reached at a usable quality and size, the tool reports the smallest file it could produce instead of pretending.

How to use Compress Image to Size

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Add one image

    Drop a JPG, PNG or WebP file of up to 50 MB onto the page, or click to browse.

  2. 02

    Set the target size

    Pick a preset such as 100 KB or enter your own KB value. Optionally cap the width or height if the form also limits pixels.

  3. 03

    Choose JPG or WebP

    JPG is accepted almost anywhere; WebP usually produces a smaller file at the same visual quality.

  4. 04

    Compress to the target

    The tool tests quality levels and, only when needed, smaller dimensions, measuring every encoded result.

  5. 05

    Review and download

    Check the actual size, quality and dimensions, then download. If the target was not reached, the warning explains the best possible result.

Supported formats and limits

Input
JPGPNGWebP
Output
JPG or WebP
Processing
Client-side, in your browser. Nothing is uploaded.
Maximum size
50 MB per file
Requirements
A modern browser with Canvas and WebP encoding support (Chrome, Edge, Firefox or Safari) · No installation, account or upload: processing stays on your device

Limitations worth knowing

  • Targets are limits, not guarantees: the result lands at or slightly below the target, and exact bytes can differ between browsers and encoder versions.
  • Very small targets force visible quality loss and sometimes a much smaller image; text and fine detail suffer first.
  • JPG output flattens transparency onto white, and any re-encode drops EXIF metadata such as capture time and GPS location.
  • Images above roughly 50 megapixels may fail in a browser tab because of memory limits.

Privacy and file handling

Your image is decoded, measured and re-encoded entirely in this browser tab. Nothing is uploaded to a server, no copy is stored or logged, and the tool works offline once the page has loaded. Downloading the result saves the file directly to your device.

Read the full privacy policy

Compress Image to Size FAQ

Short, direct answers to the questions people ask before using this tool.
How do I compress a JPG to 20 KB?
Pick the 20 KB preset, set the output to JPG and compress. The tool lowers quality and, if required, pixel dimensions until the encoded file is at or under 20 KB, then shows the quality and dimensions it used.
Can I compress an image to exactly 100 KB?
No encoder can guarantee an exact byte count. The tool returns the largest measured result at or just below 100 KB, so the file normally lands a few percent under the target instead of overshooting it.
Why did the result get smaller in pixels instead of only lower quality?
Very small targets cannot always be reached by lowering quality alone without visible damage. When quality alone is not enough, the tool shrinks the canvas and reports the final dimensions, so you can decide whether they are acceptable.
Does 100 KB here mean 100,000 bytes?
No. The target is treated as 1024 bytes per KB because that is the convention file managers and most upload forms use. The reported original and result sizes use the same unit, so the comparison stays consistent.
Should I choose JPG or WebP output?
JPG is accepted by nearly every app, form and print service. WebP usually compresses better and keeps transparency, but a few older programs cannot open it, so use it when you know the destination supports WebP.
Does this tool remove EXIF data and transparency?
Re-encoding through the canvas removes EXIF metadata such as camera details and GPS location. Transparency is preserved in WebP; JPG has no alpha channel, so transparent areas are composited onto white.
Why is the result still larger than my target?
Very detailed images, or targets far below what the format can achieve at a usable quality, hit a practical floor. The tool stops at its minimum dimension and quality, reports the smallest file it produced, and suggests a higher target, WebP output or a smaller crop.
Can I compress a PNG screenshot to 50 KB?
Yes: use the PNG source, choose JPG or WebP output and set 50 KB. Flat screenshots compress well, but fine text degrades quickly at low quality, so verify the result after downloading before submitting it.

Background reading

Format guides that explain the trade-offs behind Compress Image to Size.