Compress JPEG
Shrink JPG photos for forms, email and websites. Pick a quality or a size limit, compare the result with the original, and keep the files on your device.
Drop JPG images here
Or any picture: it is saved as JPG. As many as you like.
Your images are compressed on this device and never uploaded. Metadata (EXIF, GPS) is removed.
How this works: Method, 6 sources, Checked against 3 worked examples,
How this works
Method
Each image is decoded by the browser, turned upright, resized if asked and drawn on a canvas in a background worker. JPEGs are encoded with MozJPEG at your quality; PNGs are cut to the colours you choose by median cut with softened Floyd–Steinberg dithering, then packed by OxiPNG; WebPs use the browser’s encoder. For a target size, real encodings are bisected for the best setting that fits, shrinking the picture if even the lowest is too big. Files are rebuilt from pixels, so no EXIF is kept.
Sources
- ITU-T T.81 | ISO/IEC 10918-1: JPEG (digital compression of continuous-tone still images) (1992)
- MozJPEG (Mozilla JPEG encoder)
- W3C: Portable Network Graphics (PNG) Specification (Third Edition, 2025)
- RFC 9649: WebP Image Format (2024)
- OxiPNG, a lossless PNG optimiser
- Heckbert, Color image quantization for frame buffer display (SIGGRAPH) (1982)
How it’s tested
3 worked examples for this page are checked by automated tests before every release: given the inputs, the tool must show the expected answer.
Changes
- First version: JPG, PNG and WebP compression by quality or target size, a before and after view, resize, ZIP download, and Compress JPEG and Compress PNG pages.
What happens to a JPEG when it is compressed
JPEG compression works on 8 × 8 pixel blocks: it turns each block into frequencies and stores the fine ones with less precision, more coarsely the lower the quality. That is why heavy compression shows as blockiness and smudges around sharp edges, and why smooth skies and skin survive it well.
The quality number isn’t a percentage of anything; it chooses how coarse those steps are, and each encoder maps it slightly differently. So the same number can give different sizes in different apps. What matters is how it looks and how big it is, which is why this page shows both.
MozJPEG, the encoder used here, makes smaller files than most built-in encoders at the same visual quality, by trying progressive encoding, better coding tables and trellis quantisation. The result is an ordinary JPEG that opens everywhere.
Recompressing a JPEG always loses a little more detail, so start from the best copy you have. When a photo is much larger than it will be shown, resize it as well: halving the width and height leaves a quarter of the pixels to store.
Good to know
- Baseline JPEG compresses 8 × 8 blocks of samples with the discrete cosine transform and quantises the coefficients; the quantisation step is where detail is lost. Source: ITU-T T.81 | ISO/IEC 10918-1: JPEG (digital compression of continuous-tone still images)
- MozJPEG adds trellis quantisation and progressive encoding with jpegrescan-style optimisation, aiming at smaller files at the same visual quality. Source: MozJPEG (Mozilla JPEG encoder)
Open-source code inside, loaded only when needed: JPEGs are encoded with MozJPEG, PNGs packed with OxiPNG and WebP written with libwebp where the browser can’t. Pictures, HEIC included, are decoded by the browser itself. Licences and source
How to compress JPEG images3 steps, all on your device
- Add the photos. Drop JPGs, or any photos: HEIC, PNG and WebP become JPEGs here. They compress as soon as they arrive.
- Set quality or size. Quality 75 is a good start for photos. For an upload limit, choose Target size and enter it, such as 200 KB.
- Check and save. Drag the divider across the picture to compare, then save each JPEG or all of them as a ZIP.
Frequently Asked Questions
Which quality should I use for a JPEG?
Around 75 suits most photos for the web or email. Use 85 or more for photos people will zoom into or print. At low settings, block patterns and halos around edges start to show; the before and after view makes it easy to judge.
How do I get a JPEG under 100 KB for an online form?
Choose Target size and pick 100 KB. The compressor searches for the highest quality that fits, and if needed shrinks the picture. Keep a little margin if the form counts 1 KB as 1,024 bytes: this page counts 1 KB as 1,000 bytes.
Does compressing remove the photo’s location?
Yes. The new JPEG is written from the pixels, so it has no EXIF data: no GPS position, camera model or date. Sideways phone photos are turned upright first.