How to compress an image
- Click Choose an image, drop a file anywhere on this page, or paste a screenshot with Ctrl+V (⌘V on a Mac).
- Check the output format. The tool preselects JPEG for JPEG photos and WebP for everything else, as long as your browser can save WebP.
- Set the quality slider. 80 is a sensible starting point for photos that will be shown on a website or sent by email.
- Click Compress image. The original and the compressed version appear side by side with their dimensions, file sizes and the percentage saved.
- Look closely at detailed areas such as faces, text and skies. If you see blocky patches or smeared edges, raise the quality and compress again; if you cannot see any difference, try a lower value.
- Click Download compressed image. The file keeps your original name with “-compressed” added.
What happens when you press Compress
The compressor never uploads your file. Your browser decodes the picture, draws it onto an HTML5 canvas at its full original size and then asks the browser’s own encoder to write a new file with canvas.toBlob(), passing the format and quality you selected. The width and height stay exactly the same; only the way the pixels are stored changes.
The savings come from lossy encoding: JPEG and lossy WebP discard fine detail the eye is least sensitive to, and the quality number (1–100) controls how much. It is the browser’s own scale, so “80” here is not the same as “80” in Photoshop or another website.
- JPEG is the best choice for photographs. It cannot store transparency, so any transparent areas are filled with white before encoding.
- WebP is usually smaller than JPEG at a similar visual quality and keeps transparency. Chrome, Edge and Firefox can write WebP from a canvas; if your browser cannot, the option is marked as unavailable.
- PNG is lossless, so the quality slider is disabled. The browser’s PNG encoder does not reduce the number of colors the way dedicated PNG optimizers do, which means saving as PNG rarely makes a file smaller. Choose it only when you specifically need a PNG file.
Because the picture is re-encoded from scratch, the new file contains no EXIF metadata: camera details and the GPS coordinates phones store in photos are not carried over. That is good for privacy, but copyright fields and embedded color profiles are dropped too, so keep your original if you need them.
Choosing the right quality setting
The right setting depends on the picture and where it will appear. These ranges are good starting points:
| Image | Format | Quality to try |
|---|---|---|
| Hero banners and product photos | JPEG or WebP | 80–90 |
| Photos inside blog posts and articles | JPEG or WebP | 70–85 |
| Thumbnails and small previews | JPEG or WebP | 60–75 |
| Screenshots, logos and graphics with text | WebP (or keep PNG) | 85–100 |
Fine texture such as grass or hair hides compression well; smooth skies show banding first and sharp text develops faint halos. Judge the result at 100% zoom on the part of the image that matters most.
If the file is still too large, check the pixel dimensions before you lower the quality further. A photo 4,000 pixels wide that is displayed in an 800-pixel column carries 25 times more pixels than a standard screen can show at that size, and still about six times more than a high-density screen needs. Shrinking it with the Resize Image tool first saves far more than dropping the quality from 80 to 50, and it looks better too.
When compressing an image helps
- Upload forms with size limits. Job portals, applications and marketplaces often reject files above 1, 2 or 5 MB.
- Email attachments. A few full-resolution phone photos can exceed common attachment limits.
- Websites and blogs. Lighter images load faster on mobile connections and help page-speed measures such as Largest Contentful Paint.
Limitations to know about
- One image at a time. There is no batch mode; repeat the steps for each file.
- Already-compressed files can grow. Re-encoding an efficiently saved file at a high quality may make it larger; the tool warns you when this happens.
- Every lossy save loses a little more detail. Compress from the best original you have, not from a copy that was already compressed.
- Animated GIFs become still images. A canvas holds a single frame, so only the first frame is kept.
- Very large pictures may fail on phones. Images of tens of megapixels can exceed the canvas memory some mobile browsers allow; resize first or use a desktop browser.
- No AVIF output. Browsers do not generally offer AVIF encoding through the canvas, so the formats are limited to JPEG, WebP and PNG.
Frequently asked questions
Are my images uploaded to a server?
No. The file is decoded and re-encoded by your own browser. Nothing is sent to Img Hut or to any other service, and the compressor keeps working if you go offline after the page has loaded.
Why is my compressed file bigger than the original?
The original was probably already compressed efficiently, or you chose PNG for a photo. Re-encoding cannot recover detail that is gone, and at a high quality setting it may spend more bytes than the original encoder did. Lower the quality, switch to JPEG or WebP, or keep the original file.
What quality setting should I use?
Start at 80 for photos and check the result at full size. Go down to 60-70 for thumbnails, and up to 85-90 if you see blocky edges or banding in smooth areas such as skies.
Does compressing change the image dimensions?
No. The width and height stay the same. To reduce the pixel dimensions as well, use the Resize Image tool first and then compress the resized file.
Can I compress a PNG and keep it as a PNG?
You can choose PNG as the output, but the browser writes PNG losslessly and does not reduce the number of colors, so the size barely changes. For real savings convert to WebP, which also keeps transparency, or to JPEG if the image has no transparent areas.
Is there a maximum file size?
There is no fixed limit because nothing is uploaded. The practical limit is your device memory: very large images may fail on phones or older computers, in which case resize them first.
Related tools
Resize Image
Change width and height in pixels or by percentage, with an aspect-ratio lock and smooth downscaling.
PNG to JPG
Convert PNG to JPG with adjustable quality and your choice of background color for transparent areas.
Crop Image
Draw a selection freely or lock it to 1:1, 4:5, 16:9 and other ratios, and see its exact size in pixels.
Related guides
- How to Compress Images for Your Website Without Visible Quality Loss – A practical workflow: size images to how they are displayed, pick a format, find the lowest quality that still looks right, and serve the result with the right HTML attributes.
- JPG vs PNG vs WebP: How to Choose the Right Image Format – How each format stores pixels, where each one wins, what transparency and browser support mean in practice, and a five-question checklist for picking the right format.