How to compress images for a website
By Uthman Choudhury. Published , last updated .
To compress images for a website, resize each one to the largest size it will actually be displayed at, then run photos through Compress JPG at quality 75 and screenshots through Compress PNG in Lossy mode; both run in your browser on Kilnfile. A phone photo typically drops 60 to 80 percent with no visible change on screen.
Step by step
- Decide the display size. Check how wide the image appears on the page. A full-width hero rarely needs more than 1,600 px; a blog image 1,200 px; a product thumbnail 400 px. Double those figures for retina screens only if the image is small.
- Resize first. Open Resize Image, drop the photos in, set Resize by to Width (keep aspect ratio), type the width and click Resize. A 4,000 px phone photo at 1,200 px is already a tenth of the pixels.
- Compress photos as JPG. Open Compress JPG, drop the resized files in and leave Quality at 75. Click Compress JPG and compare the before and after sizes in the result list.
- Compress screenshots and graphics as PNG. Open Compress PNG and keep Method on Lossy (reduce colours, much smaller) with Colours at 256. Click Compress PNG. Flat-colour images lose nothing visible.
- Consider WebP. If your platform serves WebP (WordPress, Shopify, Squarespace and most static hosts do), run the JPGs through JPG to WebP at quality 80 for a further 25 to 35 percent saving.
- Download and upload. Click Download all as ZIP, then upload the compressed set to your CMS. Keep the originals in a folder in case you need a larger crop later.
Why resize before compressing?
File size scales with pixel count far more than with quality setting. A 12 MP phone photo is 4,032 by 3,024 pixels; shown at 1,200 px wide in a blog post, the browser throws away 90 percent of those pixels after downloading all of them. Resizing to the display width removes that waste before compression starts, and it is the single biggest saving available. Compression quality then handles the remaining 60 to 80 percent.
How much does each step save?
The table shows a typical phone photo through the full routine. The resize does most of the work; quality 75 does most of the rest; WebP shaves a final quarter off. Visually, the quality 75 JPG and the WebP are indistinguishable from the original at normal viewing distance on a laptop or phone screen.
| Step | Dimensions | Size | Saving vs original |
|---|---|---|---|
| Original JPG from phone | 4032 x 3024 | 3.8 MB | 0% |
| Resize Image to 1200 px wide | 1200 x 900 | 640 KB | 83% |
| Compress JPG, quality 75 | 1200 x 900 | 165 KB | 96% |
| JPG to WebP, quality 80 | 1200 x 900 | 112 KB | 97% |
Source: Kilnfile testing, September 2026, iPhone 15 photo processed in Chrome 130, sizes from each tool's result panel
What size should web images be?
There is no single correct number, but these targets keep pages fast on UK mobile connections and satisfy Google's Core Web Vitals thresholds for Largest Contentful Paint. Aim for the hero image under 200 KB, inline images under 100 KB and thumbnails under 30 KB. Total image weight on a page should stay under 1 MB.
| Image role | Max width | Format | Target size |
|---|---|---|---|
| Full-width hero | 1600 px | JPG or WebP | Under 200 KB |
| Blog or article image | 1200 px | JPG or WebP | Under 100 KB |
| Product photo | 1000 px | JPG or WebP | Under 80 KB |
| Screenshot | 1200 px | PNG lossy or WebP | Under 150 KB |
| Thumbnail | 400 px | JPG or WebP | Under 30 KB |
| Logo or icon | Any | SVG | Under 10 KB |
Source: Kilnfile editorial targets derived from Google web.dev image guidance and HTTP Archive median page weights, 2026
Which format should I use for each image?
JPG is lossy, has no transparency and is best for photographs. PNG is lossless, supports transparency and is best for screenshots and graphics with flat colours and sharp edges. WebP is 25 to 35 percent smaller than JPG at equal quality, supports transparency and animation, and has worked in every major browser since Safari 14 in 2020, so it is safe to use as a primary format today. SVG is a vector format that scales without loss and is the right choice for logos and icons. Keep GIF for nothing new: it is limited to 256 colours and makes large files.
Will lossy PNG compression ruin my screenshots?
Almost never. Lossy PNG works by reducing the palette to at most 256 colours and dithering the rest. A screenshot of a web page or app uses a few dozen distinct colours, so nothing is lost and the file shrinks 60 to 80 percent. The exceptions are screenshots containing photographs or smooth gradients, where banding can appear; for those, convert to JPG or WebP instead.
Does compressing in the browser cost quality compared with desktop software?
No. Kilnfile uses the same encoders that desktop tools use, compiled to run in your browser tab, so a quality 75 JPG from Kilnfile is the same quality 75 JPG you would get from an image editor. The advantage is that nothing is uploaded, there is no file limit and no watermark, and a batch of 100 product photos can be processed in one drag.
Frequently asked questions
What JPG quality should I use for the web?
75 is the sweet spot and the default on Compress JPG. Above 85 the file grows quickly for no visible benefit; below 60 artefacts start to show around edges and in skies. Use 60 to 65 only for small thumbnails.
Should I use WebP instead of JPG?
If your platform serves it, yes: WebP is 25 to 35 percent smaller at equal quality and every major browser has supported it since 2020. Keep a JPG copy if you also need to email the image or use it in print.
How do I compress images without losing quality?
Resizing to the display size is loss-free in practical terms, and Compress PNG in Lossless mode re-encodes without changing a pixel. For photos, quality 75 JPG is visually lossless on screen even though the data is changed.
Can I compress many images at once?
Yes. Every Kilnfile image tool accepts a batch; drop a folder's worth of files, set the options once and click the action button. A Download all as ZIP button appears when there is more than one result.
Do compressed images lose their EXIF data?
Yes. Compress JPG, Resize Image and the format converters re-encode the image, which drops EXIF metadata including GPS location as a side effect. That is generally a good thing for images published on a website.
Data source: Google web.dev image optimisation guidance, Can I Use browser support tables, and Kilnfile testing in September 2026.
Cite this page: “How to Compress Images for a Website”, Kilnfile, https://kilnfile.com/guides/how-to-compress-images-for-a-website/
Tools mentioned in this guide
Related guides
- Image formats explained: JPG, PNG, WebP, HEIC and SVGWhich image format to use and when. JPG, PNG, WebP, HEIC, SVG, GIF and AVIF compared on size, quality, transparency and support, with real numbers.
- How to convert iPhone HEIC photos to JPGTurn iPhone HEIC photos into JPGs that open anywhere, in your browser with no upload. Plus the iPhone setting that stops HEIC in the first place.
- How to strip location data from photos before sharingPhotos carry GPS coordinates accurate to a few metres. Remove EXIF data in your browser before emailing, selling online or posting originals.