Web Performance · Images

How to Optimize Images for Faster Website Loading

Published April 2026 · 8 min read

Images are the single largest contributor to page weight on most websites. According to HTTP Archive data, images account for over 50% of the average webpage's total byte size. This makes image optimization the highest-impact action you can take to speed up your website.

This guide covers the key techniques for optimizing images — from choosing the right format to resizing correctly and compressing efficiently — with practical steps you can take today without any paid tools.

Why Image Optimization Matters

Page speed directly affects your business in multiple measurable ways:

Step 1: Resize Images to Their Display Size

The single biggest optimization most websites need is resizing images to the size at which they're actually displayed. It sounds obvious, but it's extremely common to upload a 4000 × 3000 pixel camera photo when the image will be displayed at 800 × 600 pixels on the page. The browser downloads the full 4000px image, then scales it down — wasting the extra data entirely.

Rule of thumb: Resize your image so its pixel dimensions match the largest size it will be displayed at on your page, multiplied by 2 for high-DPI (retina) screens. So if an image is displayed at 600px wide, resize it to 1200px wide before uploading.

You can resize images for free using our Image Resizer. All processing happens in your browser — no software needed.

Step 2: Choose the Right File Format

Choosing the correct format can reduce file size by 50% or more with no visible quality difference:

Step 3: Compress Your Images

After resizing and choosing the right format, compression is the next optimization. The goal is to find the lowest quality setting that still looks good at the display size.

For JPG, a quality setting of 80–85% is usually imperceptible to the human eye for photographs on a screen, while reducing file size by 50–70% compared to 100% quality. Use the quality slider in our Image Resizer to control JPG compression.

For PNG, compression tools can remove metadata and apply more efficient lossless encoding to reduce file sizes by 20–40% without any quality change. Tools like PNGQuant or Squoosh work well for this.

Step 4: Use Responsive Images

A single image that looks great at 1400px wide is overkill on a 375px wide phone screen. Responsive images let the browser download the appropriately sized image for the current device, saving significant bandwidth on mobile.

In HTML, you can implement responsive images using the srcset attribute:

<img
  src="image-800.jpg"
  srcset="image-400.jpg 400w, image-800.jpg 800w, image-1200.jpg 1200w"
  sizes="(max-width: 600px) 400px, (max-width: 900px) 800px, 1200px"
  alt="Description of the image"
/>

This tells the browser to use the 400px image on small screens, the 800px image on medium screens, and the 1200px image on large screens. The browser chooses automatically.

Step 5: Use Lazy Loading

By default, browsers load all images on a page — even those that are far below the visible area. Lazy loading delays the loading of off-screen images until the user scrolls near them. This significantly improves initial page load time.

Implementing lazy loading is simple in modern HTML:

<img src="image.jpg" loading="lazy" alt="Description" />

The loading="lazy" attribute is supported by all modern browsers and requires no JavaScript. Add it to any image that isn't visible in the initial viewport.

Step 6: Always Include Alt Text

Alt text isn't a performance optimization, but it matters for SEO and accessibility. Every image on your site should have descriptive alt text that explains what's in the image:

<!-- Bad -->
<img src="photo.jpg" alt="" />

<!-- Good -->
<img src="golden-retriever-puppy.jpg" alt="Golden retriever puppy playing in a green field" />

Alt text is read by screen readers for visually impaired users, and it's what search engines use to understand the content of your images. Descriptive alt text can improve your image search ranking.

How Image Optimization Affects Core Web Vitals

Google's Core Web Vitals measure three aspects of page experience. Images have a major impact on two of them:

Image Optimization Checklist

Resize images to their display size (2× for retina)

Use JPG for photographs, PNG for graphics/logos

Consider WebP for better compression

Compress JPGs to 80–85% quality

Implement responsive images with srcset

Add loading="lazy" to below-the-fold images

Set explicit width and height attributes

Add descriptive alt text to every image

Use a CDN to serve images from a location near your users

Free Tools for Image Optimization

Resize images to the right dimensions — free

The first step in image optimization. Works in your browser, no account needed.

Open Image Resizer

Related Guides