How to Compress Images for a Website Without Losing Quality
A phone photo is often ten times larger than the page needs. Fixing that is the cheapest speed win there is.

In this article
Images are usually the heaviest thing on a web page. A photo straight from a phone can be 4,000 pixels wide and three or four megabytes; shown in a 800-pixel column, almost all of that data is wasted, and every visitor on mobile data waits for it. Google measures the wait as Largest Contentful Paint, one of its Core Web Vitals.
Optimising an image is three separate steps, and most people only do one.
Step 1: resize
Dimensions matter more than anything else. Halving the width and height cuts the pixel count — and roughly the file size — to a quarter.
- Full-width hero or banner: about 1,600px wide
- Blog or product image in a column: 800–1,200px
- Thumbnail or card: 400–600px
Uploading a 4,000px photo and shrinking it with CSS does not help; the browser still downloads the full file.
Step 2: compress
Compression throws away detail the eye does not notice. For photographs, a quality setting of around 80% is the usual sweet spot: a large saving with no visible difference on a screen. Go to 90% for a hero image, 70% for thumbnails. Below about 60% you begin to see blocks around edges and text.
Step 3: choose the format
- WebP — the best default for websites. Typically 25–35% smaller than JPEG at the same visible quality, and supported by every current browser.
- JPEG — for photographs when a platform or uploader will not accept WebP.
- PNG — for logos, icons and graphics that need a transparent background. It is the wrong choice for photos and will often be larger than the JPEG.
- SVG — for logos and icons drawn as vectors.
Do all three at once
The Image Compressor and Converter resizes to a maximum width, compresses at the quality you choose and converts to WebP, JPEG or PNG — up to twelve files at a time. It runs in your browser, so the images are never uploaded, which matters when the photos belong to a client.
In our own test a 728 KB image came out at 162 KB with no visible change.
After compressing
- Give the file a descriptive name — "blue-ceramic-mug.webp", not "IMG_4821.webp".
- Write alt text. See how to write alt text for images.
- Set width and height in the HTML so the page does not jump as images load.
- Lazy-load images below the first screen.
- Keep your originals. Compression cannot be undone.
Related: on-page SEO guide for beginners · YouTube thumbnail size guide
FAQs
What is the best image format for a website?
WebP for most photos and graphics, SVG for logos and icons, and JPEG where WebP is not accepted.
How much can I compress an image without losing quality?
Around 80% quality usually shows no visible loss on screen while cutting file size substantially.
What size should website images be?
About 1,600 pixels wide for full-width images and 800–1,200 for images inside content.
Do large images affect SEO?
Yes. They slow loading, which hurts Core Web Vitals and makes mobile visitors leave.
Learn it properly
Turn this knowledge into income
Join a practical, mentor-led course at OEC Tech Institute — on campus in Chunian or online.


