Reduce JPEG, PNG, and WebP file size

To compress images online without a queue or an account, drop files above. Image compression on the web is not a contest to hit the smallest number. It is a negotiation between sharpness where the eye rests and bytes on the first request. A product shot on a white field can take more compression than a hero with type already baked into the pixels. A screenshot of a UI should often stay PNG; running it through JPEG at 50 will smear the letters and save less than you hoped.
This compressor uses the encoder your browser already ships. That is a different bargain than TinyPNG's server. You get no queue, no five-megabyte cap, and no copy of the file on a disk you do not own. You may lose a little efficiency on a pathological PNG. For the daily pile of JPEGs from a shoot, it is the right default - especially when the shoot is still confidential.
JPEG, WebP, and AVIF quality (and unused pixels)
Quality 82 is a grown-up starting point for photographs. Below 70, skin and gradients start to band. Above 90, you are often paying for noise. If the file is still heavy after that, the width is the real issue. A 4000-pixel JPEG at quality 80 is still a 4000-pixel JPEG. Set a max longest edge - 1920 for most desktop heroes, 1280 for articles, 800 for cards - then compress. Resize if you need exact width and height instead of a cap.
WebP is the default upgrade from JPEG for pages you control. AVIF can go further on photos when this browser can encode it; if the control is disabled, it cannot. Do not use either for og:image. Social crawlers are still uneven. Compress a JPEG for the card, and serve WebP on the site.
HTML img width and height after you compress
After you download, the HTML should still reserve space. Use the pixel size of the file you actually serve. loading="lazy" is for images below the fold.
<img src="/media/hero-1920.webp"
alt="Desk with camera and prints"
width="1920" height="1280"
decoding="async">Batch compress photos and download a ZIP
Drop a folder's worth, apply once, download all. The ZIP is built in the browser. If you only needed one file, download that card. Clear when you are done; nothing is kept on a server because nothing arrived.
If the inspector later shows that you compressed a graphic that should have been PNG, convert instead of squeezing it again. If the crop is wrong, crop first - compressing unused background is a hobby, not a workflow. For a full pass on metadata after compress, use remove EXIF from the image; canvas output already drops EXIF, which is usually what you wanted.
Frequently asked questions
Does this compress images without uploading?
Yes. The browser reads the file, draws it, and encodes a new blob. We never see it.
Why did my PNG get larger as JPEG?
A screenshot or graphic with few colors is often smaller as PNG. Photographs are usually smaller as JPEG or WebP. Use convert if you want to force a format on purpose.
What JPEG quality should I use to compress photos?
Start at 82. Drop toward 70 if the page is a gallery of many photos. Stay near 88 for a single hero you will stare at. The preview is the judge, not the number.
Is AVIF always smaller than WebP or JPEG?
Often, for photos, if the browser can encode it. If the option is disabled, this browser cannot. WebP is the usual next step. Keep JPEG for Open Graph.
Does compress image remove EXIF and GPS?
Yes. Canvas output is a new file without the original wrapper. Use Remove EXIF if metadata is the only job and you want a high-quality re-encode at quality 90.
Should I resize an image before I compress it?
If the photo is wider than the layout, yes. A 4000-pixel JPEG at quality 80 is still a 4000-pixel decode. Set max longest edge here (1920, 1280, or 800) or use the resize tool for exact width and height.
Can I batch compress a folder of photos?
Yes. Drop several files, apply once, download all. The ZIP is built in this tab.