JPEG/PNG Compressor
Compress JPG, PNG, or WebP images with a quality slider and a real side-by-side before/after preview. The output format picker now auto-matches your first upload's format (PNG stays PNG, WebP stays WebP) unless you manually change it, so transparency is no longer silently flattened by default.
Drop images here or browse files
JPG, PNG, WebP — multiple files supported
How to Use This Tool
Upload one or more images (JPG, PNG, or WebP)
the output format picker automatically matches your first upload's format (PNG or WebP stays as-is; other formats default to JPEG).
Change the output format anytime with the JPEG/PNG/WebP buttons
once you do, your choice sticks for the rest of the session regardless of what you upload next.
Pro Tip
The format picker now auto-matches your first upload, so for a single-format batch you usually don't need to touch it at all. If you're mixing formats in one session (say, PNGs first, then JPEGs), remember the picker only auto-matches once, on your very first upload — check it before compressing a later batch if you want a different format than whatever you started with.
About This Tool
When to Use
- A web developer compresses a batch of unoptimized PNG UI screenshots for documentation, with the format picker auto-matching PNG so transparency and sharp text edges stay intact by default.
- A photographer compresses a folder of JPEG wedding proofs at 80% quality before uploading them to a client gallery with a storage cap.
- A game developer compresses PNG sprite sheets with transparency to reduce app bundle size before a mobile release, relying on the format picker's automatic PNG match rather than remembering to switch it manually.
Key Details
This compressor shrinks JPG, PNG, and WebP files using the browser's Canvas API, with a genuinely correct implementation for the two formats where quality is adjustable: lowering the quality slider fo...
Worked example
A user uploads a 3.4MB PNG screenshot first. The format picker automatically switches to PNG to match it, with an on-screen note confirming the auto-match. Compressing preserves the screenshot's sharp text edges and any transparency it had. If that same user had instead started with a JPEG wedding photo, the picker would have defaulted to JPEG as before — compressing at 80% quality down to roughly 760KB with imperceptible quality loss. Manually switching the format at any point (say, to WebP for extra savings) turns off the auto-matching for the rest of that session, so later uploads won't override the user's explicit choice.
Interpreting your result
A negative-looking result (the badge shows a '+' with a percentage) means the output actually grew, not shrank — this happens almost exclusively with PNG output on an already-optimized source image, since PNG has no adjustable quality here. If a PNG or WebP result unexpectedly shows a white background, check whether you'd manually switched the format picker to JPEG earlier in the session — the auto-match only applies before you've made your first manual choice.
JPEG/PNG Compressor FAQ
What quality setting should I use for web images?
For web photos, 75–85% quality is the sweet spot. Google recommends 80% for WebP. At 85%+, most compression benefit disappears. Below 70%, visible artifacts appear on photographs. Note this only applies to JPEG and WebP output — the quality slider has no effect at all on PNG output, confirmed via code read, since PNG re-encoding through Canvas is always lossless regardless of the slider position.
Does this tool auto-detect my upload format and apply the right compression strategy?
It auto-matches the output format picker to your first upload's format (PNG stays PNG, WebP stays WebP), so a transparent PNG defaults to a transparency-preserving output rather than silently becoming JPEG. It doesn't go further than that — there's no per-pixel transparency detection or per-file format switching within a mixed batch, and once you manually pick a format it stays fixed for the rest of the session regardless of what you upload next. An on-screen note confirms when the picker is still in its auto-matched state.
Does compression change image dimensions?
No. This tool reduces file size only, not pixel dimensions (width × height) — there's no resize control in the interface, confirmed via code read. To reduce dimensions, use the Image Resizer tool first, then compress here.
Should I use JPG, PNG, or WebP for web images?
WebP is best for web — 25–35% smaller than JPEG with similar quality. Use PNG for images requiring transparency (logos, icons) — the format picker now defaults to PNG automatically if your first upload is a PNG, though you can still switch to WebP or JPEG manually. Use JPEG for photographs without transparency needs.
Is my image uploaded to a server?
No. Compression runs entirely in your browser using the Canvas API, with no file size limits. Safe for confidential photos and sensitive documents.
How much smaller will my compressed image be, and can a 'compressed' file end up larger?
JPEG and WebP typically shrink 30–70% with little visible quality loss around 80% quality, since lowering the quality slider genuinely discards more image data. PNG is different: since PNG output is always lossless with no quality control, the result size depends entirely on how well-optimized your original PNG already was — an already-optimized PNG can end up the same size or even slightly larger after re-encoding through the browser's default PNG encoder, and the tool's own result badge shows a '+' with the size increase in that case rather than hiding it.
Master Your Entire Toolkit
Access 500+ specialized calculators and tools designed for precision. No sign-up required, 100% free.
Built and reviewed by the Toolzip Team · Based on Mozilla Developer Network — Canvas API