How to Compress Images for the Web Without Losing Quality
Smaller images make pages load faster. Here is how to choose the right format, size and quality, step by step.
Images are usually the heaviest part of a web page. A single photo straight from a phone can be 3โ5 MB, more than all the page's text, code and fonts combined. Shrinking images is one of the easiest ways to make a site load faster, and faster pages keep visitors around and help search rankings.
The good news is that you can usually cut image sizes by 70โ90% with no visible difference. Here is how.
How to compress images for a website: quick steps
- Resize each image to the largest width it will be shown at, usually 1,200โ2,000 pixels.
- Choose the format: JPG or WebP for photos, PNG or WebP for logos and screenshots.
- Compress at a quality of about 70โ85% with the free Image Compressor.
- Check the file size: aim for under 200 KB for most content images.
- Add alt text and lazy-load images below the fold.
Each step is explained below.
1. Resize before you compress
Most photos are far larger than they will ever be displayed. A 4,000-pixel-wide photo shown in an 800-pixel column wastes around 25 times more pixels than needed.
Work out the largest size the image will be shown at, then double it for high-density (retina) screens. For a typical blog column that means 1,200โ1,600 px wide. Use the Image Resizer with Keep ratio turned on so the picture is not stretched.
2. Choose the right format
| Format | Best for | Transparency |
|---|---|---|
| WebP | Photos and graphics on websites | Yes |
| JPEG | Photos that must open everywhere | No |
| PNG | Logos, screenshots, sharp text | Yes |
| SVG | Icons and simple vector graphics | Yes |
WebP is supported by every modern browser and is typically 25โ35% smaller than JPEG at the same visual quality. Convert existing images with the WebP Converter.
3. Pick a sensible quality
Quality settings between 70% and 85% are the sweet spot for photos. Below that, blocky artefacts start to appear around edges and in smooth areas such as skies. Try the Image Compressor at 70%, compare it side by side with the original, and only go lower if you cannot tell the difference.
PNG is lossless, so its quality setting does nothing; to shrink a PNG photo, convert it to WebP or JPEG instead.
4. Don't forget the small stuff
- Remove what you don't need. Crop away empty borders with the Image Cropper.
- Optimise SVG code. Exported icons often contain comments and editor data; the SVG Optimizer strips them.
- Add alt text. It does not change the file size, but it helps screen-reader users and search engines understand the image.
- Lazy-load images below the fold with
loading="lazy"so the browser only downloads them when needed.
A quick checklist
- Resize to at most twice the displayed width.
- Convert photos to WebP (or JPEG for maximum compatibility).
- Compress at 70โ85% quality and compare.
- Keep logos and screenshots as PNG or SVG.
- Write descriptive alt text.
All of the tools mentioned here run in your browser, so your images are never uploaded to a server.