Processed in your browser · No uploads

Image Compression Tool

Compress JPG, PNG, WebP images. All processing in your browser.

Drag & drop image here, or click to select

Select File
JPGPNGWebPBMPGIF

Max 50MB · Browser local processing

Original

Original

Settings

80%
Original
-
Compressed
-
Reduction
-

Result

Compressed

Online Image Compression: A Trade-off Between Quality and Size, Not "Smaller Is Always Better"

Image compression is not simply "making a file smaller" — it is a trade-off between acceptable quality loss and a smaller file size. This tool's quality slider (default 80%) is exactly that trade-off knob: lower it and the file shrinks but detail softens; raise it and quality holds but the file grows. Once you see it that way, you stop chasing the lowest possible quality and start picking a level that fits the job.

All compression runs locally in your browser through the Canvas API — files never leave your device, so it is private and gives instant feedback. It suits site owners, e-commerce sellers, creators, and anyone who wants to trim image weight and improve load performance.

Lossy vs Lossless: Two Very Different Ways to "Slim Down"

Compression algorithms split into two families with completely different mechanics, which decide how small you can go and whether information is discarded:

DimensionLossy (JPEG, lossy WebP, AVIF)Lossless (PNG)
MechanismDrops high-frequency detail the eye barely misses (chroma subsampling, quantization)Rewrites pixels more compactly without dropping anything
TransparencyJPEG: no; WebP, AVIF: yesYes
SizeCan get very small (photos often 1/5–1/10 of original)Photos barely shrink, often larger than the source JPEG
Best forPhotos, gradients, complex real-world scenesLine art, text, icons, anything needing alpha
Re-compressEach pass adds generation lossCan be re-encoded losslessly any number of times

When you compress a PNG below quality 100, this tool smartly converts it to JPEG to win real savings — the cost is that transparency turns white. If you must keep transparency, keep PNG or switch to WebP (see the format table below).

Format Efficiency Compared (Same 4000×3000 Sample Photo, Measured in Browser)

We built a 4000×3000, 24-bit true-color sample (sky gradient, colored building blocks, and high-frequency detail to mimic a real photo) and measured each format's output with the exact same canvas.toBlob logic this tool uses. Raw pixel data is about 34.3 MB; as a camera-export baseline its high-quality JPEG (quality 95) is about 5.73 MB.

Format & qualityOutput size% of raw pixelsQuality note
JPEG quality 955734.8 KB~16.3%Near-lossless, file is large
JPEG quality 853232.5 KB~9.2%Hard to tell apart on screen (recommended ceiling)
JPEG quality 752068.3 KB~5.9%Slightly soft, more than half the size
JPEG quality 601244.5 KB~3.5%Visible artifacts, thumbnails only
WebP quality 802856.3 KB~8.1%Better detail than JPEG at equal size
WebP quality 955216.5 KB~14.8%High-quality tier close to JPEG
PNG (lossless)20546.8 KB~58.5%Lossless but photos balloon; not advised
AVIF quality 80*~40%–50% smaller than same-quality JPEG—Not exported by this tool; official docs only

* AVIF encoding needs a server or dedicated tool; this tool (and most in-browser Canvas encoders) does not export it directly. The figure above is the typical saving from Google / AOMedia documentation, for format-choice reference only.

Note: Measured size varies a lot with image content — busier, noisier photos compress harder in JPEG and WebP; flat solid-color images compress even smaller. The table is a relative reference from a real sample, not a fixed multiplier.

Quality–Size Curve: Measured Output at Each Level (Tool Default = 80)

Using the same 5.73 MB baseline photo, we changed only the quality slider and watched this tool's real output (everything else unchanged):

QualityOutput sizeSaved vs baseline
40748.0 KB87.0%
601244.5 KB78.3%
752068.3 KB63.9%
80 (default)2574.5 KB55.1%
853232.5 KB43.6%
955734.8 KB0% (the baseline itself)
1009844.7 KB+71.7% (larger)

Key finding: quality 100 is 71.7% larger than 95. Quality 100 triggers near-lossless re-encoding, discarding far less, so the file balloons. For web use, 80–85 is already the sweet spot; pushing past 95 usually just adds bytes.

Standard Differences: Local Web/Print Norms vs International Core Web Vitals

The same image has different "pass lines" per context. Below we put local and international norms side by side so you can benchmark:

ScenarioCommon local normInternational norm (Core Web Vitals etc.)
Mobile hero imageBaidu mobile landing-page guidelines advise keeping each image lean; total page image weight should stay smallLCP (Largest Contentful Paint) should be under 2.5 s; hero images often compressed to tens of KB–200 KB
Total page image weightKeep above-the-fold images under ~1 MB where possibleFrom bandwidth / Total Blocking Time, less is better; prefer WebP, AVIF
Print resolutionPrint shops' standard 300 DPIPrint industry's same 300 DPI (PPI) standard
Recommended formatJPG (legacy compatibility), WebP (modern browsers)WebP, AVIF (Google recommends, ~25%–50% savings)

Pixels, DPI, and Physical Size: Screen Display Does Not Need 300 DPI

Note: "DPI (dots per inch)" only matters for printing. Screens render by CSS pixels and ignore DPI — a 1920-pixel-wide image shows at 1920 pixels wide whether the display is 72 DPI or 300 DPI. Only printing needs enough pixels for the physical size.

The formula: required pixels = physical inches × DPI, and 1 inch = 2.54 cm. In other words, DPI does not create pixels out of nothing; if the source lacks pixels, raising DPI only prints bigger and blurrier.

UsePhysical sizeRecommended DPIRequired pixels (W×H)
Web full-width bannerBy screen72 (display only)1920 × 1080
6-inch photo print6 × 4 in3001800 × 1200
A4 document print8.27 × 11.69 in3002480 × 3508
Mobile square shareBy screen721080 × 1080
E-commerce main imagePer platform72800 × 800 (common floor)

Takeaway: for web images, set pixels to the display size first (e.g., phone width ~375–750 px), then compress to a good size here. Do not let "300 DPI" push you to export giant images the screen cannot use. To change dimensions first, use the Resize & Crop tool.

Three Real Examples (Tool Defaults, Numbers From the Measurements Above)

Example 1 (compress a camera photo): A 4000×3000 camera JPEG, baseline 5.73 MB. Compressed with this tool's default quality 80, output is 2574.5 KB — a 55.1% saving. Plenty for a web hero image.

Example 2 (PNG to JPEG rescue): The same shot saved as lossless PNG is 20546.8 KB. At default quality 80 the tool auto-converts to JPEG, output 2574.5 KB — an 87.5% saving. Note: if the source PNG had transparent areas, they turn white; to keep transparency, use Format Converter to switch to WebP instead.

Example 3 (reverse quality from a target size): You want the 5.73 MB original down to "about 2 MB, still decent". From the curve, quality 75 gives 2068.3 KB (63.9% saved) — the closest; if ~1.2 MB is acceptable, use quality 60. "Set the target size first, then read the curve to pick quality" beats blind dragging.

Frequently Asked Questions

Q: Why does compressing a PNG turn it into a JPG and drop the transparency?
A: PNG is lossless, so lossy compression at low quality barely helps. To get a real size win, the tool converts PNG to JPEG below quality 100 — and JPEG has no alpha, so transparent areas fill white. To keep transparency, stay PNG or move to WebP or AVIF.

Q: Why is quality 100 sometimes larger than quality 95?
A: Quality 100 triggers near-lossless re-encoding, discarding almost nothing, so the file is about 71.7% larger than at 95 (measured). Web use never needs 100.

Q: What quality should I use for web images?
A: Photos: 80–85 is the sweet spot (this tool defaults to 80, ~55% saved); thumbnails can go to 60; text and line art should use PNG or WebP to avoid jaggies.

Q: WebP or JPEG for the same image — which do I pick?
A: Prefer WebP on modern browsers — better detail at equal size, smaller at equal quality (measured: WebP q80 beats JPEG q85 on size). Keep a JPEG copy only for legacy systems. Convert with Format Converter.

Q: How much DPI do I need for screen? Is 300 DPI necessary?
A: Screens render by CSS pixels and ignore DPI; 300 DPI is for print only. Size web images by display pixels and skip the 300 DPI chase. See the table above.

For a full optimization walkthrough, read the blog post How to Compress Images Online: Complete Guide; to squeeze an image into text for transfer, see Text Compress / Decompress.