Compress Image for Web
Resize with web presets, choose an output format, and target a file size with JPEG or WebP.
Choose image or drag & drop
JPEG, PNG, WebP, AVIF up to 100 MB
Runs locally in your browser. Nothing is uploaded or sent to a server.
Choose an image, select a Use case and Output format, then click Download to save a resized, compressed copy for your website. Five presets pair a maximum width with quality; Custom exposes your own width and quality settings. JPEG and WebP support Target Size mode for a KB budget. PNG keeps lossless encoding, while AVIF depends on browser encoding support. Processing stays on your device, and the before/after preview helps you inspect the result before saving.
Updated
Work on images right from any web page: the free Image Tools extension compresses, converts, resizes and crops a picture with a right-click. Add to Edge · Add to Firefox
Related Tools
Image Compressor
Compress images to 100KB, 200KB or 1MB in your browser. Cap width and height, convert JPEG, PNG, WebP, AVIF, strip EXIF. No upload, no sign-up.
image-toolsBulk Image Compressor
Compress images on your device with shared settings, per-file quality overrides, and ZIP download.
image-toolsCompress PNG
Re-encode PNG locally, compare the result, and keep the original whenever it is smaller.
image-toolsImage Resizer
Set pixel dimensions, scale by percentage, or enter print sizes with DPI, then choose how the image fits.
image-toolsBulk Image Resizer
Resize a batch by size, percentage or longest edge, then rename and download individual files or a ZIP.
How do you compress a web image with predictable dimensions?
Choose your image, select a preset under Use case, and inspect the automatically generated result before clicking Download. For a worked example, a 3000 × 2000 photo with Blog Post becomes 1200 × 800 pixels: the scale is 1200 ÷ 3000 = 0.4, and each dimension is multiplied by that scale and rounded to a whole pixel. Select WebP for this example; the preset supplies 80% quality.
The resulting image has 960,000 pixels instead of 6,000,000, an 84% reduction in pixel count. That is not a prediction of file-size savings. Encoded bytes depend on the image content, output format, and browser encoder. If your download must fit a budget, switch to Target Size with JPEG or WebP and check the actual output rather than inferring bytes from dimensions.
How do the use-case presets work?
Each preset combines a maximum width and an encoding quality. Images wider than the ceiling are reduced proportionally; narrower images keep their dimensions. There is no forced crop, square conversion, or enlargement. The quality value applies to lossy output, so selecting PNG does not make an 80% preset into lossy PNG compression.
| Use case | Maximum width | Quality |
|---|---|---|
| Blog Post | 1200px | 80% |
| E-commerce | 1600px | 85% |
| Thumbnail | 400px | 70% |
| Hero Banner | 1920px | 90% |
| Social Media | 1080px | 85% |
These names describe starting settings, not platform requirements or guarantees of visual quality. Social Media preserves the original aspect ratio, including a portrait image's height. Hero Banner does not add a crop or certify a particular display density. Use Image Resizer when you need a separate resizing workflow rather than this paired compression preset.
What can you control with Custom?
Select Custom to expose Max width, which is constrained to 320–4096 pixels. In Quality mode, the Quality slider spans 1–100. Lower quality changes encoding rather than resizing; lowering Max width changes the pixel dimensions. Inspect fine text, product textures, edges, and gradients after either change because a smaller file can also discard details you need.
Width is a ceiling rather than a required output width. A portrait can remain taller than the selected maximum width, and an already narrow source is not enlarged to meet it. Settings changes trigger another pass from the selected source file. You can compare alternatives without replacing that source with successive downloaded copies.
How does Target Size work, and what if it misses?
For JPEG and WebP, Target Size first resizes the image and encodes it at full quality, then searches encoding quality between 0.1 and 1.0. The search makes at most 10 iterations and stops early when a fitting result is less than 5% below the target. This seeks a fitting quality within those bounds; it does not guarantee an exact byte count or exhaustive quality optimization.
The Target size field accepts 1–102,400 KB, with each KB interpreted as 1024 bytes. When a file is selected, its suggested target is half the input size in KB, rounded to an integer, with a minimum of 50 KB. That suggestion is a starting budget, not evidence that the image will reach it.
If no searched result fits, the encoder tries its minimum quality and returns that output even if it remains too large. The result card warns that the target was not reached. Reduce Max width using Custom, increase the budget, or compare another format. AVIF currently bypasses this search even when Target Size appears in its controls; use JPEG or WebP for this workflow.
Which output format fits your image?
PNG sources initially retain PNG output; other inputs initially select WebP. For photographs, compare WebP and JPEG using the preview and byte sizes. PNG uses lossless encoding and is useful when you want to retain transparency without lossy encoding. Resizing still changes pixels, so lossless encoding does not mean the output is identical to the original image.
JPEG does not preserve alpha transparency, and this tool has no background-color selector. AVIF appears only when the browser passes an encoding check; decoding an AVIF image does not establish encoding support. The AVIF encoding routine also includes a WebP fallback. Compare actual results rather than relying on fixed savings percentages. This canvas workflow produces a still image, not an animation-preserving conversion.
Why can the optimized file be larger?
Re-encoding does not guarantee compression. A source may already use efficient settings, and a lossless output can require more bytes than a lossy original. The result card explicitly reports when output is larger. For PNG-specific work, Compress PNG provides a separate workflow; here, try reducing width or comparing a lossy format when appropriate.
The before/after preview labels the original and optimized byte sizes. The displayed reduction rounds the percentage calculated from the original and output sizes. Review the visible image as well as that percentage: neither an aggressive reduction nor a high quality setting proves that text remains readable or that important details survive.
Does a smaller image guarantee better Core Web Vitals?
Smaller image files reduce the bytes visitors need to download, but this tool does not measure your website's loading performance. Its under-200-KB message appears when the original is at least 200 × 1024 bytes and the output is at or below that boundary. It is a size-based hint, not a Lighthouse test or a measured Largest Contentful Paint result.
Choose dimensions for the actual placement and test the image in your page layout. This tool downloads one image per operation; it does not generate responsive image markup or a set of different widths. For several source images, use Bulk Image Compressor rather than dropping a collection here, where only the first file is processed.
What happens to your original file and its metadata?
Processing reads the local file, decodes its pixels, draws them onto a canvas, and creates a new encoded output. It does not upload the image to a compression server or overwrite your original. The download name adds -web before the selected format's extension, and the filename field lets you rename the output before saving.
Canvas re-encoding does not copy the original EXIF metadata. However, the tool's EXIF detector only scans the first 256 bytes of JPEG files for an APP1 marker; it is not a comprehensive metadata audit. Check sensitive outputs separately if metadata removal is a requirement. The upload hint advertises files up to 100 MB, but successful processing also depends on decoding support and available browser memory.
How to Use Compress Image for Web
-
Choose image or drag & drop
Select a JPEG, PNG, WebP, or AVIF image, drag one into the upload area, or paste an image from the clipboard. Optimization starts automatically.
-
Use case
Choose Blog Post (1200px, 80%), E-commerce (1600px, 85%), Thumbnail (400px, 70%), Hero Banner (1920px, 90%), Social Media (1080px, 85%), or Custom. Custom reveals Max width.
-
Output format
Select WebP, JPEG, PNG (lossless), or AVIF when available. For JPEG or WebP, choose Quality or Target Size; enter your KB budget in Target size.
-
Download
Compare Original and Optimized in the preview and check the output size or target warning. Edit the filename if needed, then click Download. Use Optimize another to start again.