ToolForge

How to Compress an Image

Compressing an image takes about fifteen seconds once you know which of two modes you want: aim for a quality level, or aim for a file size. Everything else is presets.

This covers both, the order of operations that gets the most saving for the least visible cost, and the handful of cases where the result is not what you expected.

Written by toolforge.websitePublished Last reviewed How we build and check these tools

Compressing a file

Everything happens on your own machine — the image is decoded, re-encoded and measured in the browser, and the worker script that does the heavy lifting is served from this site rather than a third-party CDN. Nothing is uploaded, which matters for client work, screenshots of internal systems, and photographs of people who have not agreed to be on someone else's server.

  1. Add your images.

    Drag them in, browse for them, or paste a screenshot straight from the clipboard with Ctrl/⌘+V. JPG, PNG, WebP, GIF and AVIF are accepted, and you can queue several at once.

  2. Pick a preset, or set the options yourself.

    Web, Email, Social and Archive each set format, dimensions and quality together — the four decisions that matter — so a preset is usually the whole job.

  3. Choose an output format if you are not using a preset.

    Keep original, JPEG, PNG, WebP or AVIF. WebP and AVIF only appear when your browser can actually encode them, which is checked at load rather than assumed.

  4. Decide between quality mode and target-size mode.

    Quality mode takes a percentage. Target-size mode takes a ceiling in KB and works backwards to reach it.

  5. Set a longest-edge limit if the image is larger than you need.

    The ladder runs 4K, 2K, Full HD, HD, Web 1080px and Small 800px, plus "Don't resize". This is where the biggest savings live.

  6. Compress, then check the before/after slider.

    Drag the divider over a detailed area — hair, foliage, text — rather than a flat one, because that is where artifacts appear first.

  7. Download individually, or take the batch as a ZIP.

    Each row reports its original size, output size and the percentage saved.

Which preset, and why

The presets exist because format, dimensions and quality interact, and choosing them one at a time leads people to strange combinations like a full-resolution PNG at 40% quality.

PresetWhat it setsUse it for
WebWebP, 1920px, 80%, metadata strippedAnything going on a web page
EmailJPEG, 1280px, under 2 MB, metadata strippedAttachments, and forms with a size limit
SocialJPEG, 1080px, 85%, metadata strippedPosts and stories
ArchiveOriginal format, full size, 95%, metadata keptKeeping a smaller copy without committing to changes

Two details worth noticing. The Web preset drops to JPEG automatically if the browser cannot encode WebP, rather than silently failing. And Archive is the only preset that keeps your metadata — the others strip it, which removes the camera model, the timestamp and any GPS coordinates along with a few kilobytes.

If you are picking manually, the useful defaults are 80% quality for photographs on the web and 90–95% for anything you might print or edit again. Where the quality thresholds actually sit goes into the numbers per image type.

Hitting an exact file size

Forms and email systems specify limits in kilobytes, not quality percentages, and guessing at a slider to satisfy one is miserable. Target-size mode does it properly: you give it a ceiling and it steps the quality down repeatedly until the output fits underneath, up to twelve attempts.

Common ceilings people are handed:

RequirementSetting
Under 100 KBTarget 100 KB, and cap the longest edge at 1080px or below
Under 500 KBTarget 500 KB — usually reachable at good quality
Under 2 MB email attachmentThe Email preset already does this
A specific pixel size and a KB limitSet the longest edge first, then the target

What target-size mode guarantees is a ceiling, not a precise figure — you asked for "no more than", and you get the largest file that fits, which is the right behaviour. The size actually achieved is reported for every image.

The one way to make it fail is to ask for something the dimensions cannot support. A 4000-pixel-wide photograph squeezed under 50 KB has to destroy the picture to get there, because quality is the only lever left. Give it a longest-edge limit as well and the same target becomes easy — fewer pixels means fewer bytes to spend on each of them.

The order that saves the most

Compression is the last step, not the first. Doing these in order takes the same amount of time and produces a much better result:

  1. Crop to what you are actually showing. Pixels outside the crop cost bytes for nothing.
  2. Resize to the dimensions the image will be displayed at. This is the quadratic one — halving the width and height quarters the pixel count.
  3. Convert to an efficient format. Google puts WebP at 25–34% smaller than JPEG at equivalent visual quality, which is a saving with no visible cost at all.
  4. Strip metadata if the file is small enough for tens of kilobytes of EXIF to matter, or if it contains location data you would rather not publish.
  5. Then set quality, and only as far as you need.

Most people start at step 5, pull the quality down until the number looks acceptable, and end up with a visibly damaged image that is still larger than a properly resized one would have been. If you only ever do one of these five, do step 2.

Batches, and what to expect

Queue as many files as you like; settings apply to the whole batch, so you configure once. Each file reports its own progress and its own outcome, so one problem image does not take the rest down, and you can cancel partway through without losing what has already finished. At the end, one ZIP.

Two behaviours in a batch that are worth understanding before they surprise you.

Some files may come back marked "Already optimised". That is the safeguard working. If re-encoding would produce a larger file than the original — which happens routinely with images that have been compressed before, because the first encoder's artifacts are themselves detail the second one has to preserve — the tool keeps your original bytes rather than handing you a worse, bigger copy. It is on by default and can be turned off.

Mixed folders give mixed results. A batch of camera JPGs will typically drop 60–80% at 80% quality. A batch of PNG screenshots will barely move unless you change the output format, because quality settings do not apply to PNG at all. If your batch is mostly screenshots, set the output to WebP and the same files will often shrink by 80–90%.

Very large batches are limited by the memory your browser tab can hold rather than by the tool, so for several hundred high-resolution files work in groups of thirty or forty.

The mistakes worth avoiding

Compressing before cropping and resizing. Covered above, and the single most common waste.

Overwriting your only original. Compression is one-way. Keep the source somewhere, especially for anything you might edit or print later.

Chasing a small number with quality alone. Below about 60% the artifacts are visible to anyone, and you will get a smaller, cleaner file by removing pixels instead.

Expecting a PNG to shrink. It will not, not meaningfully, until you change the format. The tool says so when it detects the case, and offers the WebP switch in one click.

Compressing an animated GIF. Re-encoding goes through a canvas, which handles one frame, so you get a still image. The tool warns rather than silently flattening your animation — for real GIF work you need software built for it.

Assuming the upload limit means what you think. Some systems measure the encoded size of the attachment rather than the file on disk, which is around a third larger. If a file at exactly the limit is rejected, aim about 25% under it. More reasons a file is still refused are worth a look before you retry.

Image Compressor

Compress JPG, PNG, WebP by quality or target file size. It runs in your browser, so the files never leave your machine, and there is nothing to install or sign up for.

Try the Image Compressor

Frequently asked questions

How do I compress an image to exactly 100 KB?

Use target-size mode with 100 as the ceiling — you will get the largest file that fits under it rather than exactly 100 KB, which is what a limit actually asks for. For a large photograph, also cap the longest edge at 1080 pixels or the encoder has to sacrifice too much quality to reach the target.

Will compressing my photo change its dimensions?

Only if you set a longest-edge limit, and "Don't resize" is one of the options. Every finished file lists both its original and output dimensions, so any change is visible rather than silent.

Can I compress images on my phone?

Yes — it is a normal web page and works in a mobile browser, including pasting a screenshot. Very high-resolution files are more demanding on a phone's memory, so reduce the output size or work in smaller batches if a file fails.

Why is my compressed file bigger than the original?

Because the original was already well optimised, and re-encoding it means faithfully preserving the first encoder's artifacts. With the default safeguard on, the tool spots this, keeps your original bytes and marks the row "Already optimised" instead of giving you the larger version.

Does compressing remove EXIF and GPS data?

Three of the four presets strip metadata; Archive keeps it. There is also a direct toggle. Stripping is a small size saving and a real privacy one, since camera files often carry the exact coordinates where a photo was taken.

The short version

For most jobs the Web preset is the entire answer, and target-size mode covers the rest. The one habit worth building is the order: crop, resize, convert, then compress — because a picture shown at 800 pixels wide gains nothing from carrying 4000, and no quality setting will fix that. Keep your originals, and treat a file that comes back marked "Already optimised" as good news.

Tools that go with this

Each one is here for a specific reason rather than because it is in the same category.

Image Batch Resizer

Resize multiple images at once online for free

Open Tool

When a whole folder needs the same dimensions rather than the same quality setting.

Image Format Converter

Convert between JPG, PNG, WebP, AVIF, and HEIC

Open Tool

For a format change on its own, without touching quality or dimensions.

Image Cropper

Crop and resize images with custom aspect ratios

Open Tool

Worth doing before compressing — cropped-away pixels cost nothing to encode.

New

Image to PDF Converter

Convert JPG, PNG and WebP images to a PDF

Open Tool

A common destination for a set of compressed images that has to travel as one file.

How-to

How to Compress Images Without Losing Quality

Truly lossless compression, and visually lossless compression, are different things. Which to use per image type, and where the quality thresholds actually sit.

Troubleshooting

Why Your Image Is Still Too Large After Compressing

Six reasons compression did not shrink your file: a PNG that stayed a PNG, dimensions rather than quality, an already-optimised source, or a lying upload limit.

Guide

How Image Compression Works

Why a photo can lose 80% of its bytes and look identical: what lossy compression discards, how quality settings behave, and why PNG ignores them entirely.

Explainer

What Is the Difference Between Lossy and Lossless Compression?

Lossless keeps every pixel; lossy discards what you cannot see. What each one actually promises, why lossless is not "better quality", and which to pick.

Best practices

Image Optimization Best Practices

The nine things that actually make images fast, in order of impact — right dimensions, right format, lazy loading everything except the one image you must not.

Explainer

What Image Size Should You Use on a Website?

Pixel dimensions, file size and DPI are three different things, and only two of them matter on the web. The sizes to use, and why 300 DPI is meaningless here.

Comparison

JPG vs PNG vs WebP: Which Should You Use?

A decision table plus the published figures: WebP is 25–34% smaller than JPEG and 26% smaller than PNG. When each format still wins, and where AVIF fits.

Guide

What Is a CR3 File?

CR3 is Canon's raw photo format, introduced in 2018. Here is what is inside one of these files, why most software cannot open them, and what to do with them.

Sources

  1. WebP: A new image format for the Web

    Google · Official documentation · accessed 7 September 2026

    Cited for: WebP being 25–34% smaller than comparable JPEG at equivalent SSIM quality, behind the advice to convert format before lowering quality

  2. Image file type and format guide

    MDN Web Docs · Technical documentation · accessed 7 September 2026

    Cited for: Which formats are lossy or lossless, and why a PNG cannot be shrunk by a quality setting

About the author

toolforge.website

Builder and maintainer, ToolForge

Started ToolForge in May 2026 and has built and maintained it since, writing every tool on the site and the documentation that goes with each one.

How we research and check this content · About ToolForge

Part of

Image Compression & Formats

Why lossy compression works, which format to use, what image size a web page actually needs, and why a file is still too big after compressing it.

Browse all image tools
Buy Me a Coffee