How the compression works
The tool draws your image onto an HTML canvas and asks the browser to encode it again with canvas.toDataURL(), passing the slider position as the quality value (10 to 100 on the slider becomes 0.1 to 1.0). MDN notes that this value only applies to formats with lossy compression, such as JPEG and WebP. That single fact explains most of what you will see.
- JPEG and WebP are lossy: a lower quality means a smaller file and more visible blockiness in fine detail and smooth gradients. The preview and both file sizes update as you move the slider, so you can stop where the trade-off suits you.
- PNG is lossless: the slider has no effect, and the re-encoded file is often the same size as the original or larger, in which case the tool reports "No savings". The output keeps the input format, so a PNG cannot be turned into a JPEG here.
- Pixels only: a canvas holds no metadata, so EXIF data, camera settings, location tags and embedded colour profiles are dropped. That trims a little size and also removes data you may not want to publish. Width and height are unchanged.
For a sense of scale, one test with an 800 by 600 pixel generated image: a 136 KB JPEG became 62 KB at quality 80, 36 KB at 50 and 20 KB at 20; a 76 KB WebP became 21 KB at 80; a 464 KB PNG stayed at 464 KB whatever the slider said. Your results depend on the picture, so judge by the preview rather than by percentages.
Where your image is processed
The file is read with the browser's FileReader and drawn to a canvas on your device. It is never uploaded, so there is no server queue and no size limit other than your device's memory. Very large photos can make the tab slow, because the canvas holds every pixel uncompressed while it works. The download link is a data URL built in the page, which is why it appears the moment the preview does.
Every browser can write PNG from a canvas. MDN's image file type guide covers JPEG and WebP support, and toDataURL falls back to PNG when a browser cannot encode the requested type, so a very old browser could hand you a PNG with a .webp name. In our test a current Chromium browser encoded all three formats as expected.
Choosing a quality setting
Start at the default of 80 and move down while watching the compressed preview at full size; stop when you first notice halos around edges or banding in skies and shadows. Photographs hide compression better than screenshots, where JPEG artefacts around text show quickly; screenshots and flat graphics are better kept as PNG, or saved as WebP where supported. Re-saving an already compressed JPEG at a higher quality than its original cannot bring detail back and may make the file bigger.
Related tools on this site work the same way, in your browser: the Favicon Generator turns an image into 16 by 16 and 32 by 32 icons, the Image Color Picker reads exact colour values from an image, and the Zip / Unzip Tool bundles a set of compressed images for sending.