How to Compress Images Without Losing Quality
Large images are one of the most common reasons websites load slowly. Slow pages frustrate visitors and can hurt search performance. The good news is that you can usually reduce an image's file size by 50 to 80 percent with little visible difference. Here is how.
Why image size matters
A single unoptimized photo from a phone can be 4 to 8 MB. If a page has five of them, visitors on mobile data must download 20 to 40 MB before the page feels complete. Optimized, the same page might need under 1 MB.
Lossy vs lossless compression
- Lossy compression removes small details that most eyes cannot notice. It gives much smaller files. JPG and WebP use it.
- Lossless compression shrinks the file without removing any pixel data, but the savings are smaller. PNG uses it.
Choose the right format
| Format | Best for | Notes |
|---|---|---|
| JPG | Photos | No transparency. Works everywhere. |
| PNG | Logos, screenshots, graphics with sharp edges or transparency | Larger files for photos. |
| WebP | Photos and graphics on websites | Usually smaller than JPG and PNG, supported by modern browsers. |
| SVG | Icons and simple logos | Scales to any size with tiny file size. |
Five steps to smaller images
- Resize first. If your page shows an image at 800 pixels wide, a 4,000-pixel original is wasted data. Resize to the largest size you actually display, or about twice that for sharp screens.
- Compress. For JPG or WebP photos, a quality setting of roughly 70 to 85 percent is often a good balance. Compare the result with the original at normal viewing size.
- Pick the right format. Convert large PNG photos to JPG or WebP. Keep PNG for transparent logos.
- Strip extra data. Cameras store location and other information inside files. Removing it saves a little space and protects privacy.
- Lazy load. Let images below the fold load only when the visitor scrolls near them. Most modern websites support this with a single attribute.
Example
A 5.2 MB phone photo at 4,000 x 3,000 pixels is resized to 1,600 pixels wide and saved as a WebP at quality 75. The result is around 150 to 250 KB, which is over 95 percent smaller, and looks nearly identical in a blog post.
How to work out the right size
The most useful number is the width at which the image actually appears on the page. Say your blog column is 700 pixels wide. On a standard screen, a 700-pixel image fills it exactly. On a high-density phone or laptop screen, the browser packs twice as many pixels into the same space, so a 1,400-pixel image looks sharpest. Anything beyond 1,400 pixels wide adds file size without adding visible detail in that column.
A quick rule: multiply the displayed width by two, round up, and use that as the maximum. A full-width hero banner that spans a 1,200-pixel layout rarely needs more than about 2,000 pixels.
Worked example: a recipe blog post
Imagine a post with one banner photo and eleven step photos. Straight from a phone, each is about 4 MB, so the page carries roughly 48 MB of images. That is a long wait on a mobile connection and a real cost for anyone with a limited data plan.
Now resize the step photos to 1,000 pixels wide and save them as WebP around quality 75, which often lands near 100 KB each. Resize the banner to 1,800 pixels wide, which might be around 250 KB. The total is about 1.35 MB (eleven times 100 KB plus 250 KB), a drop of more than 95 percent. Exact numbers vary with the photo, because detailed images such as foliage compress less than smooth ones such as a plain wall, but the pattern holds.
Walkthrough: from camera file to web-ready image
- Copy the original into a folder named "originals" and never edit it directly.
- Decide the largest size the image will be shown, then resize a copy to about twice that width.
- Export as WebP or JPG at quality 75. Open it at actual size and compare it with the original.
- If you can see blocky patches or fuzzy edges around text, raise the quality in small steps of 5 until it looks clean.
- Check the file size. For a normal in-article photo, a few hundred kilobytes or less is a sensible goal.
- Give the file a descriptive name such as "lemon-cake-slice.webp" rather than "IMG_4821.webp".
When PNG is the right choice
Screenshots with small text and logos with flat colors usually look better as PNG, because lossy formats can leave faint smudges around sharp edges. If a screenshot PNG is still large, try reducing its dimensions first, then run it through a PNG optimizer, which can often trim the file without changing a single visible pixel. Photographs saved as PNG, by contrast, are often several times larger than they need to be.
Lazy loading and layout shifts
Lazy loading tells the browser to wait on images that are far down the page. It helps a long article, but do not use it on the very first image visitors see, since that one should load right away. Also set the width and height of each image in your page code. That lets the browser reserve space, so text does not jump around as pictures appear.
Common mistakes
- Compressing the same JPG repeatedly. Each round loses quality, so always start from the original.
- Using tiny sizes for large banners. Test on a large screen too.
- Forgetting alt text. Describe each image briefly for accessibility and search.
- Saving a screenshot with text as a heavily compressed JPG. The letters turn fuzzy and harder to read.
- Scaling a small image up. Enlarging a 300-pixel picture to fill a wide banner makes it blurry, and compression cannot fix that.
- Overwriting your only copy of the original. Once detail is thrown away, it cannot be recovered.
Quick takeaways
- Resize before you compress. It is the single biggest saving.
- Use JPG or WebP for photos, PNG or SVG for logos and sharp graphics.
- Quality settings around 70 to 85 percent are a good starting range for photos.
- Always compress from the original, not from an already compressed copy.
- Lazy load images below the fold, but not the first one.
Frequently asked questions
Will compressing an image make it look blurry?
Not if you go gently. Moderate lossy compression removes detail that is hard to notice at normal size. Blurriness usually comes from shrinking the dimensions too far or from pushing quality very low, so compare the result before you publish it.
Is WebP safe to use?
All current major browsers display WebP. If you need to send an image to someone who might open it in older software, such as an old email program or document editor, JPG is the safer choice.
What is a good file size for a web image?
There is no single number, but many in-article photos look fine at a few hundred kilobytes or less. A large hero image may reasonably be larger. Judge by whether the page feels fast on a phone.
Does compressing in the browser upload my photo anywhere?
That depends on the tool. Some services send files to a server. A tool that works locally on your device keeps the file on your computer, which is better for private photos and documents.
Compress in your browser
Our free Image Compressor shrinks images on your device, so the file is never uploaded to a server. You can also use the Image Resizer to set exact dimensions and the Image Format Converter to switch between JPG, PNG and WebP. Always keep your original file as a backup.
Try the tool: Image Compressor
Shrink JPG, PNG and WebP files in your browser. Nothing is uploaded.
Open tool