FormatDrop
How-To Guide

How to Compress Images for Websites

Images are typically the largest assets on a web page — often 50-80% of total page weight. Optimizing images is the single highest-impact improvement for web performance (Core Web Vitals, LCP, page load speed). This guide covers the complete image optimization workflow for websites.

Step-by-step instructions

  1. 1

    Step 1: Choose the right format

    Photos → WebP (25-35% smaller than JPG) or AVIF (50% smaller than JPG). Icons and logos with transparency → SVG (vector) or WebP lossless. Screenshots, diagrams → PNG lossless or WebP lossless. Animated content → WebM/MP4 video (95% smaller than GIF). Use the <picture> element to serve WebP/AVIF with JPG/PNG fallback.

    Go to converter
  2. 2

    Step 2: Resize to actual display dimensions

    The most impactful change: don't serve a 3000×2000px image in a 400×300px container. Identify the largest display size for each image. Create responsive image sets: 400w, 800w, 1200w variants. Use srcset: <img srcset='img-400.webp 400w, img-800.webp 800w' sizes='(max-width: 600px) 400px, 800px' src='img-800.jpg'>

  3. 3

    Step 3: Compress for the right quality

    JPG: 85% quality for photos, 75% for thumbnails. WebP: quality 80-85 for photos. AVIF: quality 50-65. PNG: run pngquant or OptiPNG for lossless compression. Remove EXIF metadata (GPS, camera settings) — often 10-50% of JPG file size with tools like exiftool.

  4. 4

    Step 4: Use lazy loading and async decode

    <img loading='lazy' decoding='async' ...> — these HTML attributes defer loading of off-screen images. The 'loading=lazy' attribute is supported in all modern browsers and can dramatically reduce initial page load time for image-heavy pages.

  5. 5

    Step 5: Consider a CDN with auto-optimization

    Cloudflare, Cloudinary, Imgix, and Bunny.net can automatically serve WebP/AVIF to supporting browsers and resize images on-the-fly based on the requesting device. Set-and-forget optimization — no manual conversion workflow needed.

Why convert JPG to WEBP?

Google's Core Web Vitals (specifically Largest Contentful Paint / LCP) measures how long before the page's main image appears. Unoptimized images are the primary cause of slow LCP scores, which directly affect Google search rankings. A page with 10 unoptimized 2MB photos loads in 20+ seconds on 3G; with optimized 200KB WebP images, it loads in 2-3 seconds. Image optimization is the highest-ROI technical SEO and UX improvement for most websites.

Your files never leave your device

FormatDrop runs the conversion engine entirely inside your browser using WebAssembly. No file upload. No server. Nothing stored. You can verify this by opening DevTools → Network tab and watching: zero upload requests.

Frequently asked questions

What image format is best for websites?
Photos: WebP with JPG fallback (or AVIF + WebP + JPG for maximum optimization). Logos and icons: SVG. Transparent graphics: WebP lossless or PNG. Animations: WebM/MP4 video. Screenshots: WebP lossless. The <picture> element with multiple sources lets you serve the optimal format to each browser without any single format compromise.
How much should I compress website images?
Target file sizes: Hero images (full-width, above the fold): 100-200KB. Gallery images (400-800px wide): 50-100KB. Product images (300-600px): 30-80KB. Thumbnails (100-200px): 5-20KB. These targets achieve fast loading without visible quality loss at typical viewing distances and screen densities.
Convert JPG to WEBP Now — Free

No account. No upload. Works in any browser.