About the Image Compressor
This image compressor makes photos and graphics smaller so they load faster, fit email and form upload limits and take up less storage. Upload an image, choose the output format (JPG, WebP or PNG), drag the quality slider and optionally cap the longest side in pixels; the tool re-encodes the image in your browser and shows the original size, the compressed size and the percentage saved, with a preview so you can judge the quality before downloading.
It is built for bloggers and web developers optimising page speed, online sellers preparing product photos, students and job seekers meeting “maximum 2 MB” upload rules, and anyone sharing phone photos. Everything runs locally with the HTML canvas — no files are uploaded, stored or watermarked.
For photos, JPG or WebP at 70–85% quality usually cuts the size by 60–90% with little visible change, and reducing the pixel dimensions saves even more. PNG output is lossless, so the quality slider has no effect on it; for PNG the savings come only from resizing. The calculator below also works without a file: enter the before and after sizes to compute the savings, compression ratio and bits per pixel.
With the default inputs, the size reduction is 87.2%. Change any value above to recalculate instantly.
How to use the image compressor
- 1Upload or drop a JPG, PNG, WebP or GIF image.
- 2Choose JPG or WebP for photos, or PNG for graphics that need lossless output.
- 3Drag the quality slider — start around 75% and compare the preview.
- 4Optionally limit the longest side, for example to 2048 px for the web.
- 5Check the before/after sizes and click Download.
Formula and method
The size reduction compares the file sizes before and after compression. The compression ratio expresses the same thing as “how many times smaller”, and bits per pixel shows how efficiently the image is stored: an uncompressed 8-bit RGB image uses 24 bits per pixel, while a good-quality JPEG photo typically needs only 1–4.
When you limit the longest side, the other side is scaled by the same factor and rounded to whole pixels, so the aspect ratio is kept. In the browser the image is drawn on a canvas and re-encoded with the canvas toBlob() encoder; for JPG and WebP the quality setting (0–100%) controls how aggressively fine detail is discarded. File sizes use decimal units (1 kB = 1,000 bytes).
- original
- Original file size (kB)
- compressed
- Compressed file size (kB)
Worked examples
Phone photo for the web: 3.2 MB → 410 kB
Limiting a 4032 × 3024 photo to 2048 px on the long side gives 2048 × 1536 px. Saving it as a 75% JPG at 410 kB cuts the size by 87.2% — about 7.8 times smaller — at roughly 1.04 bits per pixel.
Same dimensions, WebP at 80%
Keeping the 1920 × 1080 size and re-encoding an 850 kB JPG as WebP at 80% produces 240 kB, a 71.8% reduction at about 0.93 bits per pixel.
Meeting a 1 MB upload limit
Halving a 24 MP camera JPG to 3000 × 2000 px and compressing it to 950 kB saves 90.3%, getting it under a 1 MB limit. The uncompressed bitmap at that size would be 18 MB.
Frequently asked questions
How can I reduce an image’s file size?+
The biggest savings come from reducing pixel dimensions and using lossy compression. Resizing a phone photo to 2048 px wide and saving it as a 75–80% JPG or WebP usually cuts it from several megabytes to a few hundred kilobytes.
Which is better for photos, JPG or WebP?+
Google’s published tests found lossy WebP files 25–34% smaller than JPGs of comparable quality, and WebP also supports transparency. JPG is still the most universally compatible, so use it when you are unsure where the image will be opened.
Why did my PNG barely get smaller?+
PNG is lossless, so re-saving it keeps every pixel and the browser encoder cannot discard detail. Reduce its dimensions, or convert photos to JPG or WebP for much larger savings.
What quality setting should I use?+
For photos, 70–85% is the usual sweet spot: below about 60% blocky artefacts appear around edges and in skies, while above 90% file sizes grow quickly with little visible improvement.
Are my images uploaded anywhere?+
No. Compression runs entirely in your browser using the canvas API, so your images stay on your device. The output also drops EXIF metadata such as GPS location.