WEB PERFORMANCE · GUIDE

How to Compress Images for a Website
(Speed, SEO & Format Guide 2026)

By ImgMin Team · April 2, 2026 · 9 min read

NEWImgMin for Chrome — right-click any image to compress, no upload.Add to Chrome →

Images account for over 50% of average page weight on the web. That means a slow website is almost always an image problem. Compressing images correctly is the single highest-ROI action you can take for web performance, Core Web Vitals scores, and — by extension — SEO rankings.

Target file sizes for 2026: Hero images <200 KB · Content images <100 KB · Thumbnails <30 KB · Background images <150 KB. Use WebP format by default.

Why Image Compression Matters for Your Website

Google's Core Web Vitals use Largest Contentful Paint (LCP) as a primary ranking signal. LCP measures how long it takes for the main image on the page to appear. An uncompressed 3 MB hero image can single-handedly cause LCP >4 seconds — classified as "Poor" — costing you rankings.

Choosing the Right Image Format for Web

FormatBest Use CaseBrowser Supportvs JPEG File Size
WebPAll web images (photos + graphics)97%+ of browsers25–34% smaller
AVIFPhotos, high-fidelity images~85% (no IE/Safari 15)40–50% smaller
JPEGPhotos (fallback)UniversalBaseline
PNGLogos, screenshots, transparencyUniversalOften 3–5× larger than JPEG
SVGIcons, logos, illustrationsUniversalResolution-independent
GIFAvoid — use WebP animated or videoAvoidUp to 10× larger than WebP
2026 recommendation: Use <picture> with AVIF → WebP → JPEG fallback. This serves the best format each browser supports without sacrificing compatibility.

<picture>
 <source srcset="img.avif" type="image/avif">
 <source srcset="img.webp" type="image/webp">
 <img src="img.jpg" alt="...">
</picture>

Target File Sizes by Image Type

Image TypeMax WidthTarget Size (WebP)Target Size (JPEG)
Hero / banner1920 px<150 KB<200 KB
Blog post featured image1200 px<80 KB<120 KB
Product image (e-commerce)800 px<60 KB<100 KB
Thumbnail / card image400 px<20 KB<35 KB
Avatar / profile photo200 px<10 KB<15 KB
Background (full viewport)1440 px<100 KB<150 KB

Step-by-Step: How to Compress Images for Your Website

Step 1: Resize Before Compressing

Never serve a 4000 px wide image in a 800 px column. Resize to the maximum display width first. If you're serving retina/HiDPI, use 2× the CSS display size — so a 400 px column gets a 800 px image, then compress heavily.

Step 2: Choose Quality Level

Step 3: Compress With a Local Tool (No Upload)

For maximum privacy and speed, use ImgMin — all processing happens in your browser. Drag up to 10 images, compress, download as a ZIP. No uploads, no limits, no account needed.

For server-side workflows (CI/CD, CMS), tools like Sharp (Node.js), Pillow (Python), or cwebp (CLI) are excellent options for automation.

Step 4: Implement Lazy Loading

Add loading="lazy" to all images below the fold. This defers loading until the user scrolls near the image, saving bandwidth and improving initial page load time significantly.

Step 5: Set Correct Dimensions

Always specify width and height attributes on your <img> tags. This reserves space in the layout and prevents Cumulative Layout Shift (CLS) — another Core Web Vitals metric that affects SEO.

Step 6: Use a CDN With Automatic Optimization

If you're on Cloudflare, Vercel, or AWS CloudFront, enable automatic image optimization. These services can serve WebP to modern browsers and cache optimized versions at edge nodes worldwide — reducing latency significantly.

WordPress-Specific Tips

Shopify-Specific Tips

Website Image Compression Checklist

Frequently Asked Questions

What is the best image format for websites?

WebP is the best default for 2026 — 25–34% smaller than JPEG at equivalent quality, supported by 97%+ of browsers. Use AVIF for even better compression if your audience is on modern Chrome or Firefox. Keep JPEG/PNG as fallbacks.

How small should images be for a website?

Hero images: under 200 KB. Content images: under 100 KB. Thumbnails: under 30 KB. Background images: under 150 KB. These are WebP/JPEG targets — your exact threshold depends on image complexity.

Does image compression affect SEO?

Yes, directly. Google uses Core Web Vitals (LCP, CLS) as ranking signals. Large uncompressed images are the leading cause of slow LCP scores. Compressing images improves page speed, reduces bounce rate, and can meaningfully lift search rankings — especially on mobile.

Optimize Website Images — Free, Private, Instant

Batch compress up to 10 images at once. No upload, no account, no limits.

Compress Images Now →

Last updated: April 2026. Browser support percentages sourced from caniuse.com.