Image Compressor
Compress and resize images online without losing quality. Reduce JPEG, PNG, WebP file size. Free image optimization tool with adjustable quality
A 4MB PNG screenshot of mostly-flat UI is 90% wasted bytes — PNG's lossless compression is great for content with sharp edges but terrible for the gradients and dithered shadows in modern interfaces. The right answer is usually WebP at quality 80, which gives near-identical visual output at one-tenth the size. This tool compresses JPEG, PNG, and WebP entirely in your browser; lets you tune quality per format; previews the result side-by-side with the original; and reports the byte savings. No uploads, no privacy concerns.
Which format for which content
- JPEG — photographic content. Lossy DCT-based compression. Tunable quality 0-100. Bad for sharp edges (creates ringing artifacts around text) and large flat areas (banding at low quality). The 1992 format is still ubiquitous.
- PNG — sharp-edged content with limited colors or transparency. Lossless. Good for icons, logos, screenshots of UI. Terrible for photos (file 10-20× larger than JPEG of the same quality).
- WebP — modern (Google, 2010). Both lossy and lossless modes. Roughly 25-35% smaller than equivalent-quality JPEG; 25% smaller than equivalent PNG. Supported in every modern browser since ~2020. Default choice for new content in 2026.
- AVIF — newer (2019). Even better compression (~50% smaller than JPEG at equivalent quality). Encoding is slow; browser support reached parity in 2023 but some image-processing pipelines do not handle it yet.
- GIF — only relevant for animations, and even there WebP and AVIF beat it. Limit to legacy compatibility.
Working example: a screenshot
Input
A 1920×1080 screenshot of a code editor (mostly text on dark background)
Output
Original PNG-24: 3.4 MB Compressed alternatives: PNG-8 (256 colors): 1.1 MB (visible color quantization on syntax highlights) JPEG quality 90: 420 KB (slight blur on text edges — readable but ugly) WebP quality 90 lossy: 180 KB (effectively indistinguishable from original) WebP lossless: 650 KB (pixel-perfect, smaller than PNG due to better entropy coding) AVIF quality 90: 95 KB (best — but encoding takes 5-10x as long) Recommendation for blog/docs: WebP quality 85-90 lossy. ~95% reduction with no visible loss for screenshots.
Lossless PNG is the right answer when you genuinely need pixel-perfect (e.g., archival, technical diagrams that may be re-edited). For end-user display, lossy WebP at 85-90 is almost always the right trade-off.
Quality settings: what the number means
- JPEG quality 100 — minimal lossy compression. File size is high; quality is best but still loses some chroma detail compared to a lossless source.
- JPEG quality 80-90 — sweet spot for most photographic content. Visually indistinguishable from the original on a typical screen for most images.
- JPEG quality 60-79 — visible artifacts on detailed content but acceptable for hero images, thumbnails, social media.
- JPEG quality < 60 — visible artifacts (blocking, ringing). Use only for ultra-low-bandwidth scenarios.
- WebP quality scale is nominally 0-100 but the underlying codec is different; quality 80 in WebP ≠ quality 80 in JPEG. WebP 75-85 typically matches JPEG 90.
Resizing vs compression
Compressing a 4000×3000 photo to quality 80 still keeps it 4000×3000. If you only need it at 1600×1200 (because that is the display size), the right first step is to resize. A 1600×1200 JPEG at quality 85 is much smaller than a 4000×3000 JPEG at quality 30 — and looks better. Always resize to the actual display dimensions before compressing.
For responsive web: serve multiple sizes via srcset, not one giant image scaled by the browser. A 4K hero image scaled to 800px wide on mobile wastes bandwidth.
When to reach for this tool
- You took a screenshot and want to share it without sending a 5MB file.
- You are writing a blog post and need to optimize hero images for fast page load.
- You inherited a website with a 30MB-per-page image budget and want to audit what compressing each image would save.
- You are emailing a contract or invoice scan and need to fit attachment size limits (Gmail: 25MB total; corporate mail servers often less).
What this tool will not do
- It will not OCR or edit your image. For text extraction, use the OCR tool; for cropping/filters, use the image editor.
- It will not produce HEIF/HEIC. Apple's HEIF format is patent-encumbered for encoding (decoding is free); browsers do not support it on the public web. Convert to WebP or AVIF if you need wider compatibility.
- It will not preserve EXIF metadata by default. Stripping EXIF (camera details, GPS coordinates) is the default — most users sharing photos online do not realize how much location data they would otherwise leak.
All compression runs in your browser via Canvas APIs and WebAssembly codecs. Original and compressed images never leave your device. Useful for confidential documents, internal screenshots, or anything you do not want a third-party service touching.
Frequently asked questions
Why is my "compressed" image actually larger?
Two common reasons: (1) the original was already optimally compressed and adding another round of lossy encoding does nothing useful; (2) you converted from JPEG to PNG, which is lossless and bigger on photos. Always check the file size after — if it grew, keep the original.
Is WebP supported everywhere now?
Yes, in every actively-maintained browser since Safari 14 (2020). Some image-processing pipelines (older WordPress installs, Microsoft Office 2019) still cannot import WebP. For maximum compatibility, keep JPEG/PNG fallbacks.
Does compressing the same image multiple times degrade it more?
Yes, for lossy formats. Each lossy compression cycle loses some information; repeated re-encoding (open in editor, save, open, save) compounds the loss. Always re-export from the original lossless source if you need to re-compress.
Why does Save-for-Web in Photoshop give different results?
Photoshop and ImageOptim and Squoosh use different encoder libraries. mozjpeg (used in many tools) outperforms the default libjpeg by 10-15% at equivalent visual quality. The differences are small enough not to matter for most casual use.
Should I strip EXIF metadata?
For images shared online or with strangers: yes. EXIF often contains GPS coordinates (where the photo was taken), camera serial number, timestamp, and lens info. For your personal photo archive: keep it — searchability and chronology depend on it.
What is "progressive JPEG"?
A JPEG variant that encodes the image in multiple passes — low-res first, then progressive refinements. The user sees a blurry version quickly, then sharper details. Same file size as baseline JPEG, sometimes slightly larger. Useful on slow connections; less relevant on broadband.
Related tools
Convert images between PNG, JPEG, and WebP formats. Batch conversion with quality control. Free online image format converter
Convert images to Base64 encoded strings for embedding in HTML/CSS. Support for PNG, JPEG, GIF, WebP. Free online image to data URI converter
Convert file sizes between bytes, KB, MB, GB, TB. Calculate transfer times at different speeds. Free online file size converter
Calculate and convert image/video aspect ratios. Find dimensions for 16:9, 4:3, 21:9 and custom ratios. Free online aspect ratio calculator
Remove background from images using AI. Works offline in your browser. Free online background eraser, no upload to server required
Create beautiful code screenshots with syntax highlighting. Carbon-like code images with themes. Free online code snippet to image converter
Last updated · E-Utils editorial team