Compress

Compress JPGCompress PNGCompress WebPCompress AVIFCompress to 100 KBCompress to 200 KBCompress to 500 KB

Convert

Convert to JPGConvert to PNGConvert to WebPConvert to AVIFWebP to JPGPNG to JPGJPG to PNGWebP to PNG

Image tools

Crop ImageResize ImageImage to PDFImage to Base64

More tools

AI Prompt GeneratorColor PickerTime Zone ConverterQR Code GeneratorWord CounterPassword Generator
Image Compression

Image Compression Explained: Formats, Quality Settings and Tools

What image compression actually does, how JPEG, PNG, WebP and AVIF differ, and a repeatable workflow for smaller files that still look right.

What is image compression?

A digital photo is a grid of pixels, and each pixel needs several bytes to describe its colour. A 12-megapixel image (4000 × 3000 pixels) would take about 36 MB uncompressed at 3 bytes per pixel. Compression is what turns that into the 2–6 MB file your phone actually saves. The smaller the file, the faster it uploads, loads and fits through email limits. It also costs less to store and serve.

There are two families of methods. Lossless compression finds patterns and stores them more compactly, so the decoded image is identical to the original. Lossy compression permanently removes information that matters least to human vision, which is why it can shrink files far more. The trade-offs are covered in detail in lossy vs lossless compression.

How the main formats compress images

Understanding the mechanism explains why each format suits different content.

  • JPEG splits the picture into 8 × 8 pixel blocks, converts each block into frequency components (a discrete cosine transform), then rounds the less visible components more aggressively. It also often stores colour at lower resolution than brightness (chroma subsampling), because we notice brightness detail more. Lower quality means coarser rounding, which eventually shows up as blocky edges and smudged colour.
  • PNG is lossless. It predicts each pixel from its neighbours (filtering) and then packs the result with DEFLATE. It handles flat colours and sharp edges well but is inefficient for photographs. A PNG can also use a palette of up to 256 colours, which is how colour-reduction tools shrink graphics dramatically.
  • WebP uses predictive coding derived from the VP8 video codec for lossy images and a separate lossless mode, plus transparency and animation. Google's published study found lossy WebP files 25–34% smaller than comparable JPEGs at equivalent SSIM quality, and lossless WebP 26% smaller than PNG.
  • AVIF stores images using the AV1 video codec inside a HEIF-style container. It often produces smaller files than WebP or JPEG at similar visual quality, supports transparency and wide colour, but takes longer to encode.

For a side-by-side decision guide, see JPEG vs PNG vs WebP vs AVIF.

Which format should you choose?

Your imageBest choiceWhy
Photograph for a websiteWebP (JPEG as fallback)Smaller than JPEG at similar quality, displayed by all current major browsers
Photo for email, forms or print shopJPEGAccepted everywhere
Logo, icon, screenshot, diagramPNG, or lossless WebPSharp edges and flat colour stay crisp
Needs transparencyPNG or WebPJPEG cannot store transparency
Very large hero photo, bandwidth mattersAVIF with WebP/JPEG fallbackOften the smallest file for photographs
Simple animationAnimated WebP, or videoGIF files are large and limited to 256 colours

Need to change format? Use the JPG/PNG to WebP converter, PNG to JPG or WebP to JPG tools. They run in your browser, so the files are not uploaded.

What quality setting should you use?

Quality numbers are not percentages of the original, and they do not mean the same thing across formats. As a practical guide, JPEG quality around 75 is a widely used default (Google's WebP study also treats 75 as the generally recommended JPEG level), and 80–85 is a safe choice when detail matters. WebP is commonly set around 75–80. AVIF uses a different scale, so values around 50–60 are a typical starting point. Always judge by eye at the size the image will be shown.

  • Quality 90+ keeps almost everything but produces large files. Use it only for masters or print.
  • Quality 75–85 is the usual sweet spot for web, email and online shops.
  • Quality 60–70 suits thumbnails and previews where fine detail is not needed.
  • Below 60 usually shows visible artefacts on faces, skies and gradients.

The JPG compressor and WebP compressor let you set this with a slider and show the exact saving.

Resize first, then compress

Dimensions usually matter more than quality. A 4000-pixel-wide photo displayed in a column that is 800 pixels wide carries about 25 times more pixels than needed (4000 × 3000 versus 800 × 600). Shrinking it removes data without any visible loss at the display size, and then compression has far less to encode.

Rule of thumb: export at about 2× the largest displayed width if you want sharp results on high-density screens, and no more. Use the image resizer to set exact pixel sizes or a percentage, or the crop tool when you also want to change the framing. If a form demands an exact limit, the target-size compressor chooses the quality for you.

A repeatable image workflow

  1. Keep the original. Store the full-resolution file untouched.
  2. Crop and resize to the largest size you will actually display.
  3. Choose the format using the table above.
  4. Compress at quality 75–85 (or reduce colours for PNG graphics) and compare against the original at 100% zoom.
  5. Check the result: faces, text edges, skies and gradients show artefacts first.
  6. Name and describe the file with a short descriptive filename and meaningful alt text.
  7. Serve it properly on the web with correct dimensions and lazy loading, covered in responsive images.

Why image size matters for speed and SEO

Images are frequently the largest element on a page, which makes them the usual cause of a slow Largest Contentful Paint. Google's Core Web Vitals treat an LCP of 2.5 seconds or less as good, and the thresholds apply at the 75th percentile of real visits. Google also publishes image guidance for Search: use descriptive filenames and alt text, supported formats, and responsive markup. See how images affect Core Web Vitals and optimising images in WordPress.

Compression is only one part of page speed, and speed is only one part of ranking. Relevant, original content still matters most.

Privacy: where does the compression happen?

Many online compressors upload your files to a server. That is convenient but means a copy of your photo leaves your device. An in-browser tool, such as the ones on this site, does the work on your own computer with your browser's image encoders. Learn what to look for in how to choose a free image compressor.

Common mistakes to avoid

  • Compressing the same JPEG repeatedly. Each lossy save adds artefacts, so always start from the original.
  • Saving photographs as PNG. The files are often several times larger than JPEG or WebP.
  • Uploading full camera resolution and letting the page shrink it with CSS.
  • Ignoring transparency. Converting a transparent PNG to JPEG fills it with a solid colour.
  • Over-compressing logos and text. Use PNG, lossless WebP or SVG instead.
  • Forgetting that email and upload limits apply to the whole message. See how to reduce photo size for email.

Try it now: Compress JPG

Free, private and runs in your browser. Nothing is uploaded.

Open Compress JPG

Frequently asked questions

Resizing changes the pixel dimensions (for example 4000 px wide to 1200 px). Compressing keeps the dimensions but stores the data more efficiently, discarding some detail if the method is lossy. Combining both gives the smallest files.
Lossless compression does not. Lossy compression always discards some information, but at moderate settings the change is rarely visible at normal viewing size. Re-compressing an already compressed file adds further loss.
There is no single number. Aim for the smallest file that looks good at the displayed size. Hero images are often a few hundred kilobytes and content images much smaller, and the best judge is your own LCP and page weight measurements.
For the web, usually yes. Google reports lossy WebP files 25–34% smaller than comparable JPEGs at equivalent quality. JPEG remains the most universally accepted format for email, print and older software.
Yes. Tools that run in your browser, like the compressors on this site, process the file locally so it is not sent to a server.

Sources and further reading

External links open the original source. We cite primary or official documentation for factual claims and re-check them when we update an article. See our editorial policy.

Keep reading