Skip to content
Browser tool Runs locally

Image Compressor

Compress JPG, PNG, and WebP images in your browser. No upload.

Input image

Click to choose an image or drag a file here

PNG, JPEG, WebP, GIF, or BMP

Options
Compressed image

Choose an image, adjust options, then click Compress Image.

How to compress an image

  1. Choose or drop an image.
  2. Pick an output format and quality.
  3. Optionally set a max width or height to resize.
  4. Click Compress Image and download the result.

How compression works

Your image is decoded, drawn to a canvas at the target size, and re-encoded with the format and quality you choose. The image never leaves your device - decoding and encoding both happen locally in the browser.

Why compress images at all?

Images are usually the heaviest part of a web page's total download size, so a few oversized photos can slow a page down far more than any amount of extra HTML, CSS, or JavaScript. Compressing images before publishing them cuts page weight, speeds up load times, reduces bandwidth costs, and helps with metrics like Largest Contentful Paint that affect both user experience and search ranking. It's one of the highest-leverage things you can do for site performance for very little effort.

Lossy vs. lossless compression

Lossy compression shrinks a file by discarding some visual information that's harder for the eye to notice, which is what makes JPEG and WebP (in their default mode) able to reach much smaller file sizes than the original. Lossless compression shrinks a file without discarding any pixel data at all - the decompressed image is identical to the source - which is how PNG works, and why PNG files typically stay larger than a JPEG or WebP at comparable visual quality.

JPEG vs. PNG vs. WebP

JPEG is a lossy format with no transparency support, and it's the long-standing default for photographs - it compresses smooth tonal gradients well but tends to blur or smudge sharp edges and fine text. PNG is lossless and supports transparency, which makes it the right choice for screenshots, logos, diagrams, and any graphic with flat colors or sharp edges where JPEG artifacts would be obvious - the tradeoff is a larger file. WebP supports both lossy and lossless modes plus transparency, and generally produces a smaller file than JPEG or PNG at equivalent visual quality, making it a strong default for the web when you don't have a specific reason to use the others.

Quality vs. file size

For JPEG and WebP output, the quality slider controls how much detail is discarded - higher quality keeps more detail and produces a larger file, lower quality shrinks the file further but can introduce visible artifacts like blockiness or blurring, especially around sharp edges and text. There's no single correct setting: a photo in a hero banner can usually tolerate more compression than a product close-up customers will zoom into. Reducing dimensions with the max width or height fields also shrinks file size, often with less visible quality loss than pushing the quality slider very low, since a smaller image simply has less data to encode.

When to compress before publishing

  • Photos straight from a phone or camera, which are often several megabytes and far larger than any page needs to display.
  • Hero images, banners, and background photos, which tend to be the single heaviest asset on a page.
  • Product photos and thumbnails used repeatedly across a catalog or gallery.
  • Screenshots and diagrams pasted into articles or documentation, which are often exported larger than necessary.
  • Any image you're about to embed as a Base64 data URI, since compressing first keeps the encoded string smaller too.

Compression doesn't fix a bad crop or resize

Compressing a file only changes how efficiently its existing pixels are encoded - it can't reframe a badly cropped photo, straighten a crooked shot, or repair a resize that distorted proportions. The max width and max height fields here scale the whole image down proportionally; they don't crop or recompose it. If a photo is poorly framed or was stretched out of proportion before you get it, fix that in an image editor first - compression will faithfully preserve whatever framing and proportions it's given, good or bad.

Limitations of this tool

  • Transparency: PNG and WebP output preserve any alpha (transparency) channel from the source. JPEG has no alpha channel, so converting a transparent image to JPEG fills the transparent areas with a white background instead.
  • Metadata: Re-encoding through the canvas keeps only pixel data. EXIF metadata - camera model, capture date, GPS coordinates, and similar - is not preserved in the output, regardless of output format.
  • Orientation: No orientation tag is written to or read from the output, since none of the source metadata carries over. Most modern browsers already display a photo upright according to its orientation tag before it's drawn to the canvas, so the result usually looks correct, but there's no manual orientation correction in this tool.
  • Animated GIFs: Only the first frame of an animated GIF is read and compressed; animation is not preserved in the output.
  • Browser format support: WebP output depends on your browser's encoder support. It's well supported in current versions of Chrome, Firefox, Edge, and Safari, but on an older or unusual browser WebP encoding can fail - this tool reports an error rather than silently falling back to another format.
  • Very large images: Images above roughly 100 megapixels are rejected with an explanatory error, since decoding them can exhaust memory or fail outright on constrained devices.

Frequently asked questions

Will compressing an image lose quality?
It depends on the format. JPEG and WebP use lossy compression, so higher compression (a lower quality setting) discards more visual detail in exchange for a smaller file, though at moderate settings the loss is usually hard to notice. PNG output from this tool is always lossless, so the quality slider is ignored and file-size savings come only from resizing and PNG's own lossless encoding, not from discarding detail.
Should I use JPEG, PNG, or WebP?
JPEG is the safest general-purpose choice for photos without transparency. PNG is best when you need transparency and can accept a larger file, or for graphics like screenshots, logos, and line art with flat colors and sharp edges. WebP usually produces the smallest file for a given quality in either case, supporting both lossy and lossless compression with transparency, and is well supported by modern browsers - it's a good default unless you specifically need JPEG or PNG for compatibility with an older tool or platform.
Does this tool keep my photo's EXIF data, like camera settings or GPS location?
No. Re-encoding an image through the browser's canvas only preserves pixel data - EXIF metadata such as camera model, capture date, and GPS coordinates is not carried over to the compressed output, regardless of format. If you need to strip that metadata for privacy before sharing a photo, that happens automatically here; if you need to keep it, this isn't the right tool.
Will my compressed image come out rotated?
It shouldn't, in a modern browser. Most current browsers automatically apply a photo's built-in orientation tag when decoding it, so the compressed output is drawn upright the same way the original appears in your browser. What's lost is the orientation tag itself, since none of the original metadata is carried into the output - so if you view the file in older software that relies on that tag rather than the pixels' actual orientation, results can differ.
Why did compressing my image barely change its dimensions or framing?
Compression and resizing are different operations. This tool reduces file size by re-encoding the pixels you give it, and can scale the whole image down proportionally if you set a max width or height, but it can't crop, straighten, or reframe anything. A poorly cropped or badly composed photo will still be poorly cropped or badly composed after compressing - fix framing and cropping in an image editor first, then compress the result.

Related tools