Image Compressor

Compress JPEG, PNG and WebP images to smaller JPEGs with a quality slider, in bulk, without uploading them. Shows the exact before and after size of every file.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Image Compressor?

The Image Compressor re-encodes images as JPEG at the quality you choose and shows how much each file shrank. Drop in one photo or a whole folder, adjust the Compression Quality slider between 10% and 100%, and download the results one by one or all together.

It keeps the original pixel dimensions unless you set a Target size. With a target such as 50 KB, it finds the highest quality (up to the slider) that stays under the limit, counting 1 KB as 1,000 bytes so the file passes either reading of KB, and shrinks the pixels only if even 30% quality is too big. If a file is too big because it is 6000 pixels wide, shrinking the pixel count with the Image Resizer usually saves far more than lowering quality.

Compression runs on a canvas in your browser, so the images never leave your device. One side effect worth knowing: re-encoding drops EXIF metadata, including any GPS location, so compressed copies are also safer to share.

  • Batch compression with drag and drop
  • Quality slider from 10% to 100% in 5% steps
  • Optional target size in KB for upload limits such as "under 50 KB"
  • Exact output size and an honest smaller or larger label
  • Transparent areas filled white instead of black
  • Removes EXIF and GPS metadata as a side effect
  • Runs locally in your browser
Read the guide: Resize, Convert, Compress: A Practical Order for Web Images

Updated

How to use the Image Compressor

  1. Set Compression Quality first. 80% is the default and a sensible starting point for photos.
  2. Drag images onto the upload area or click Choose Images. You can select many files at once.
  3. Check each card: it shows the original and compressed size and whether the file got smaller or larger.
  4. Change the slider and click Recompress All to try another quality on the same files.
  5. Click Download on a card, or Download All. Files are saved as name_compressed.jpg.

Worked examples

Reading the size label

Input

holiday.png, 2,000,000 bytes, compressed at 80% to 450,000 bytes

Output

1.91 MB → 439.45 KB, "77.5% smaller", saved as holiday_compressed.jpg

Sizes use 1024-byte kilobytes. The saving is (2,000,000 − 450,000) / 2,000,000. The download keeps the base name and switches the extension to .jpg because the bytes inside are now JPEG.

When compression makes a file bigger

Input

icon.png, 4,000 bytes, a flat two-colour logo

Output

For example 9,000 bytes, shown as "125.0% larger than the original"

Small, flat graphics compress better as PNG than as JPEG. The tool tells you plainly instead of reporting a negative reduction, so you know to keep the original.

Background and insight

JPEG, standardised as ITU-T T.81 in 1992, is lossy. It splits the image into 8×8 blocks, transforms each with a discrete cosine transform, and then divides the result by a quantisation table. The quality setting scales that table: lower quality means coarser rounding, more zeros and a smaller file. Between roughly 70% and 85% most photos lose very little visible detail while shrinking a lot, and below about 50% blocking and colour banding start to show, especially in skies and gradients.

The quality number is not a standard unit. Every encoder maps it to its own tables, so 80 in a browser canvas is not the same as 80 in Photoshop, libjpeg-turbo or MozJPEG. Judge by looking at the output, not by the number.

JPEG has no alpha channel. When a transparent PNG goes through a canvas into JPEG, the transparent pixels would normally come out black. This tool paints a white background first, which is what most people expect for logos and screenshots. If you need to keep transparency, convert to WebP or PNG with the Image Format Converter instead.

Common use cases

  • Meeting upload limits

    Get photos under the size cap of a form, CMS, job portal or support ticket system.

  • Faster web pages

    Shrink blog and product photos before uploading them so pages load faster on mobile connections.

  • Emailing a batch of photos

    Compress a set of phone pictures so they fit in one email instead of five.

  • Stripping location before sharing

    Re-encoding removes EXIF, including GPS coordinates, from photos you post publicly.

Tips and limitations

  • Resize first, then compress. Halving the width and height cuts the pixel count by 75%, which no quality setting can match.
  • Screenshots of text and UI often look worse as JPEG and may grow. Keep them as PNG or convert to WebP.
  • Do not recompress the same JPEG repeatedly. Each pass loses a little more detail; always start from the original.
  • Animated GIFs come out as a single still JPEG frame.
  • Download All triggers one download per file. Some browsers ask for permission before allowing multiple downloads.

Sources and further reading

  1. T.81: Digital compression and coding of continuous-tone still images, International Telecommunication Union. The 1992 JPEG standard
  2. JPEG Image Encoding Family, Library of Congress. How JPEG's DCT and quantisation work
  3. HTMLCanvasElement: toBlob() method, MDN Web Docs. The quality argument the browser encoder takes

Frequently asked questions

What JPEG quality setting should I use for web photos?

Start at 75% to 85%. Most photos look the same as the original at that range while shrinking several times over. Drop toward 60% for thumbnails, and look closely at skies, skin and gradients, where artefacts appear first.

Why did my compressed image get bigger than the original?

The original was probably already well compressed, or it is a flat graphic such as a logo or screenshot that PNG stores efficiently. JPEG is designed for photos. Keep the original in that case, or try WebP in the Image Format Converter.

Does the image compressor change the image dimensions?

Not with the quality slider alone: the output has the same width and height in pixels as the input. With a Target size set, it first lowers quality, and only if 30% quality is still over the limit does it scale the pixels down until the file fits. The card shows the quality and pixel size it settled on.

How do I compress a photo to under 50 KB or 20 KB?

Type the limit in Target size (KB). The tool searches for the highest JPEG quality that fits, counting 1 KB as 1,000 bytes, which also satisfies forms that count 1 KB as 1,024 bytes. If it cannot reach the target, the card says so in red and shows the smallest size it managed.

Why does a transparent PNG get a white background after compression?

JPEG cannot store transparency. Without a fill, transparent pixels would turn black, so the tool paints white behind the image before encoding. To keep transparency, convert to PNG or WebP instead of compressing to JPEG.

Does compressing a photo remove its EXIF data and GPS location?

Yes. The image is redrawn on a canvas and encoded fresh, and the canvas does not copy metadata. Camera model, timestamps and GPS coordinates are all gone from the compressed file. Check with the EXIF Metadata Viewer if you want to confirm.

Are my images uploaded to a server for compression?

No. Decoding, re-encoding and the size calculation all happen in your browser using the canvas API. You can disconnect from the network after the page loads and the tool still works.

Is there an in-depth guide to the Image Compressor?

Yes. “Resize, Convert, Compress: A Practical Order for Web Images” covers the background, how it works, common pitfalls and worked examples. Read the full guide.