Skip to content

Compress Images Online — JPEG, PNG & WebP

Compress JPEG, PNG, WebP & AVIF up to 80% smaller — in your browser, no upload. Batch 20 images, resize, compare before & after, download as ZIP. Free & private.

No Tracking Runs in Browser Free
All processing happens in your browser. Your images never leave your device.

Drop images here or click to browse

Supports JPEG, PNG, WebP, AVIF · Max 10MB per file · Up to 20 images

75

EXIF and other metadata are removed during compression for privacy.

Reviewed for compression accuracy and cross-browser compatibility — Go Tools Engineering Team · Mar 22, 2026

Our team tests compression quality across JPEG, PNG, and WebP formats and verifies Canvas API behavior across major browsers.

What Is Image Compression?

Image compression reduces file size by removing redundant or imperceptible visual data, enabling faster page loads and reduced bandwidth consumption. According to the HTTP Archive Web Almanac, images account for approximately 50% of total page weight on average — making image optimization one of the highest-impact performance improvements available to web developers.

As Google's web performance guidance notes, optimizing images is consistently among the top recommendations from Lighthouse and PageSpeed Insights, directly improving Core Web Vitals metrics such as Largest Contentful Paint (LCP). The WebP specification (Google, 2010) demonstrated that modern compression algorithms can reduce image file sizes by 25–35% compared to JPEG at equivalent visual quality, a finding that has since driven widespread adoption of next-generation formats (HTTP Archive, WebP specification).

There are two main compression approaches:

Lossy compression discards some image data to achieve smaller file sizes. JPEG and WebP use lossy compression by default — a quality setting of 75% typically reduces file size by 60–80% with minimal visible difference. The tradeoff is irreversible: once data is discarded, it cannot be recovered from the compressed file.

Lossless compression reduces file size without discarding any data. PNG uses lossless compression by default — the decompressed image is bit-for-bit identical to the original. The compression ratio is lower (typically 10–30%), but image quality is perfectly preserved.

This tool compresses your images entirely in your browser — your images are never uploaded to any server, at any point. For JPEG and WebP files, the quality slider directly controls the lossy compression level through the Canvas API. PNG files come back as PNG: because the Canvas API cannot encode a lossy PNG, the tool compresses them with palette quantization instead, which trims the number of distinct colors and keeps transparency intact, including soft anti-aliased edges. If you want a different container, the output format selector lets you request PNG or WebP for any input. Every compression operation stays on your device, giving you the performance gains without the privacy cost.

For embedding small compressed images directly in HTML or CSS, you can Base64-encode the output to create data URIs — a common technique for icons and logos under 5 KB. For a deeper comparison of browser-based vs Node.js compression solutions — including Squoosh, Sharp, and Imagemin — read our image compression guide.

// Compress a JPEG image in the browser using the Canvas API
async function compressImage(file, quality = 0.75) {
  const img = await createImageBitmap(file); // decode the image
  const canvas = document.createElement('canvas');
  canvas.width = img.width;
  canvas.height = img.height;
  canvas.getContext('2d').drawImage(img, 0, 0);
  // quality: 0.0 (smallest file) → 1.0 (original quality)
  return new Promise((resolve) =>
    canvas.toBlob(resolve, 'image/jpeg', quality)
  );
}

// file comes from an <input type="file"> or drag-and-drop
const blob = await compressImage(file, 0.75);
console.log(`Original:   ${file.size} bytes`);
console.log(`Compressed: ${blob.size} bytes`);
// → Original:   2100000 bytes
// → Compressed:  672000 bytes  (~68% reduction)

Key Features

100% Browser-Side Processing

All compression happens locally in your browser using the Canvas API. Your images never leave your device — no uploads, no server processing, complete privacy.

Batch Compression

Compress up to 20 images at once. Drop multiple files or select them from your file browser. All files are compressed with the same quality setting and can be downloaded individually or all at once.

Adjustable Quality Control

Fine-tune compression with a quality slider from 0 to 100. See the compressed file size update in real time as you adjust, so you can find the perfect balance between quality and file size.

Before/After Sliding Comparison

Visually compare the original and compressed versions of any image with an interactive sliding divider. Drag left and right to inspect compression artifacts at any point in the image.

Multi-Format Support

Compress JPEG, PNG, and WebP images. PNG stays PNG — it is compressed by palette quantization, so transparency is preserved. Use the output format selector when you do want a different format: keep the input format, or force PNG or WebP.

JPEG vs PNG vs WebP

JPEG

Lossy compression, no transparency

Best for photographs and complex images with many colors and gradients. Excellent compression ratios (60–90% reduction at quality 75). Does not support transparency. The most widely supported image format on the web.

PNG

Lossless compression, supports transparency

Best for graphics with sharp edges, text, logos, and images requiring transparency. Larger file sizes than JPEG for photographs. This tool keeps PNG as PNG and shrinks it with palette quantization, preserving transparency — PNG output never goes through the Canvas API, which can only encode PNG losslessly.

WebP

Lossy and lossless, supports transparency

Google's modern format offering 25–35% smaller files than JPEG at equivalent quality, with transparency support like PNG. Supported by all modern browsers. The most efficient format for web images in 2026.

Compression Examples

JPEG Photo Compression

photo-landscape.jpg (2.1 MB, 4000×3000)
photo-landscape.jpg (680 KB at quality 75)

A typical high-resolution JPEG photo compressed at quality 75. The file size is reduced by approximately 68% with minimal visible quality loss. JPEG is the best format for photographs and complex images with gradients.

PNG Logo/Icon Compression

logo-transparent.png (43 KB, 1200×800)
logo-transparent.png (19 KB at quality 80)

A transparent PNG logo compressed at quality 80 — 57% smaller and still a PNG. Palette quantization reduces the number of colors instead of switching the container, so the transparency survives: in this file both the fully transparent background and the soft anti-aliased edges and drop shadow are still there. Choose WebP in the output format selector if you would rather trade the format for an even smaller file.

WebP Banner Compression

hero-banner.webp (800 KB, 1920×1080)
hero-banner.webp (250 KB at quality 75)

A WebP image re-compressed at quality 75. WebP's built-in lossy compression achieves a 69% reduction while maintaining good visual quality. WebP is generally the most efficient format for web images.

How to Compress Images Online

  1. 1

    Upload Your Images

    Drag and drop images into the upload area, or click to browse your files. You can select up to 20 JPEG, PNG, or WebP images at once, each up to 10MB.

  2. 2

    Adjust Quality

    Use the quality slider to set your desired compression level (0–100). The default is 75, which offers a good balance. Watch the file sizes and compression ratios update in real time.

  3. 3

    Download Results

    Click Download on any individual file, or use Download All to save every compressed image. Use the Compare button to visually inspect the quality before downloading.

Use Cases

Website Performance Optimization
Reduce image file sizes before uploading to your website. Smaller images load faster, improving Core Web Vitals scores (especially Largest Contentful Paint), reducing bandwidth costs, and improving SEO rankings.
Email Attachment Size Reduction
Compress images before attaching them to emails to stay within attachment size limits (typically 10–25MB). A batch of 20 photos can often be compressed from 50MB to under 10MB.
Social Media Upload Preparation
Pre-compress images before uploading to social media platforms. While platforms re-compress images automatically, starting with an optimally compressed file gives you more control over the final quality.
App and Game Asset Optimization
Compress UI assets, textures, and sprites for mobile apps, games, and progressive web apps. Smaller assets mean faster downloads, less storage usage, and smoother user experiences.
Document and Presentation Optimization
Reduce the size of images embedded in PDFs, Word documents, and presentations. A 50MB slide deck with high-resolution photos can often be reduced to 10MB without noticeable quality loss.

Technical Details

Canvas API Compression
This tool uses the HTML5 Canvas API's toBlob() method for compression. The image is drawn onto an invisible canvas element, then re-encoded with the specified quality parameter. For JPEG and WebP, the quality parameter (0.0–1.0) controls the lossy compression level. For PNG, the Canvas API ignores the quality parameter entirely — PNG encoding through Canvas is always lossless.
PNG Palette Quantization
Because Canvas toBlob() ignores the quality parameter for PNG, PNG output does not go through Canvas at all. The image is quantized to a color palette instead: the quality slider maps to a palette size — quality 75 gives 192 colors — and the result is written back as a real PNG with its alpha channel intact. Quality 100 maps to a lossless re-encode that changes no pixels. If the quantized file is not smaller than the original, the tool discards it and keeps your original bytes.
Quality Parameter Behavior
The quality slider maps to the Canvas toBlob() quality parameter: 100 = 1.0 (highest quality, largest file), 0 = 0.0 (lowest quality, smallest file). For JPEG, quality 75 (0.75) is generally the sweet spot — below 50, artifacts become noticeable. For WebP, the same quality value produces slightly smaller files than JPEG with comparable visual quality.
Browser Memory and Limits
Each image exists in memory as both the original File object and the compressed Blob, plus two object URLs for preview display. With 20 images at 10MB each, peak memory usage can reach approximately 400MB. Object URLs are revoked when images are cleared or the page is unloaded to prevent memory leaks.

Best Practices

Start at Quality 75 for JPEG/WebP
Quality 75 is the recommended starting point for most use cases. It typically reduces file size by 60–80% with minimal visible quality loss. Only increase quality above 85 for images where fine detail preservation is critical (e.g., medical imaging, print-quality photography).
Use WebP When Possible
WebP produces 25–35% smaller files than JPEG at the same visual quality and supports transparency like PNG. All modern browsers support WebP as of 2024. Convert JPEG and PNG images to WebP for the best compression-to-quality ratio on the web.
Keep Original Files
Always keep your original, uncompressed images as source files. Lossy compression is irreversible — re-compressing an already-compressed image degrades quality further without significant size reduction (known as generation loss).
Check Quality Before Downloading
Use the Compare button to visually inspect compression artifacts before downloading. Pay special attention to areas with text, sharp edges, and subtle gradients — these are where JPEG artifacts are most visible.
Batch Similar Images Together
Images with similar characteristics (same subject type, resolution, color depth) compress best with the same quality setting. Batch your photos separately from your graphics/logos for optimal results.

Frequently Asked Questions

Is it safe to compress images online?
Yes — this tool is completely safe because it processes images entirely in your browser. Your images are never uploaded to any server. The compression uses the browser's built-in Canvas API, and all data stays on your device. You can verify this by opening your browser's Network tab in Developer Tools — you will see zero network requests during compression. When you close or refresh the page, all image data is cleared from memory.
What is the difference between lossy and lossless compression?
Lossy compression permanently removes some image data to achieve smaller file sizes. JPEG and WebP use lossy compression — a quality setting of 75 typically reduces file size by 60–80% with minimal visible difference, but the removed data cannot be recovered. Lossless compression reduces file size without removing any data. The decompressed image is bit-for-bit identical to the original. PNG uses lossless compression. The tradeoff is that lossless compression achieves smaller reductions (typically 10–30%). For web use, lossy compression at quality 75–85 is almost always the right choice — the file size savings are dramatic and the quality difference is imperceptible to most viewers.
Do my PNG files stay PNG?
Yes. A PNG you upload comes back as a PNG. The browser's Canvas API cannot encode a lossy PNG, so rather than change the format, this tool quantizes the image to a color palette — it reduces the number of distinct colors and writes a real PNG back out, with transparency preserved, including soft anti-aliased edges. If you do want a WebP, pick WebP in the output format selector above the file list. Same as input is the default and leaves every file in its own format; PNG forces PNG output even for JPEG or WebP input. At quality 100 the PNG is re-encoded losslessly, so no pixels change and the size reduction depends entirely on how efficiently your original was already encoded — it can be zero. Whenever the result is not smaller than the file you uploaded, the tool discards it and keeps your original.
What quality setting should I use?
It depends on your use case: - Quality 85–95: Visually indistinguishable from the original. Use for professional photography, portfolio sites, or anywhere image quality is critical. Typical reduction: 30–50%. - Quality 70–85: Excellent quality with significant size savings. The recommended range for most web use. Typical reduction: 50–75%. - Quality 50–70: Good quality with aggressive compression. Suitable for thumbnails, social media, and images viewed at small sizes. Typical reduction: 70–85%. - Quality below 50: Noticeable artifacts. Only use when file size is more important than quality (e.g., email constraints, very low bandwidth). Use the Compare button to find the lowest quality that looks acceptable for your specific image.
Can I compress images without losing quality?
Technically, yes — set the quality slider to 100 for lossless compression. However, the file size reduction will be minimal (0–10% for most images) because lossless compression can only remove redundant encoding data, not image data. In practice, quality 80–85 is effectively "no visible quality loss" for most images. The human eye cannot distinguish between quality 85 and quality 100 in typical viewing conditions. The Compare slider lets you verify this for your specific image. For maximum file size reduction without visible quality loss, start at quality 75 and use the Compare button to check. If you see artifacts, increase the quality in increments of 5 until the result looks acceptable.
How many images can I compress at once?
You can compress up to 20 images in a single batch. Each image can be up to 10MB in size. All processing happens in your browser, so performance depends on your device's CPU and available memory. For large batches of high-resolution images, compression may take a few seconds. The tool processes all images and shows a per-file progress indicator and the total space saved.
What happens if the compressed file is larger than the original?
This can happen with images that are already well-optimized, or when compressing at very high quality settings (90–100). The tool then keeps your original file and shows "0% saved", with a tooltip explaining why nothing was replaced. If this happens, the original image was likely compressed with an advanced encoder (like mozjpeg, cjpeg, or pngquant) that is more efficient than the browser's built-in encoder. In this case, your original file is already optimally compressed — no further action is needed.
Does compression change my image dimensions?
By default no — pixel dimensions are preserved. A 4000×3000 image stays 4000×3000 after compression and only the file size changes. If you want to resize, set a max width in pixels and keep the Keep aspect ratio checkbox enabled. The image is downscaled (never upscaled) and height is derived from the original aspect ratio. Resizing and compression compound — a 4000 px photo dropped to 1600 px max width before quality 75 compression often shrinks 5–10× total.
What image formats are supported?
This tool supports four formats: - JPEG (.jpg, .jpeg): The most common format for photographs. Supports lossy compression with the quality slider. - PNG (.png): Best for graphics with transparency. Compressed by palette quantization and saved as PNG, with transparency preserved. - WebP (.webp): Modern format with the best compression efficiency. Supports both lossy compression and transparency. - AVIF (.avif): Next-generation format with the best compression ratios in 2026. AVIF input is supported on every modern browser; AVIF encode (re-saving as AVIF) requires Chrome 85+ — on browsers without AVIF encode, AVIF input is transparently re-encoded as WebP. Other formats (GIF, SVG, HEIC, TIFF) are not currently supported.
How does this compare to TinyPNG or Squoosh?
The main difference is privacy: this tool processes images entirely in your browser — your files never leave your device. TinyPNG uploads images to their servers for processing. TinyPNG uses server-side compression with advanced algorithms (pngquant for PNG, mozjpeg for JPEG) that can produce slightly smaller files than browser-based compression. However, your images must be uploaded to their servers, and the free tier limits you to 20 images per day at 5MB each. Squoosh (by Google) also processes images in the browser using WebAssembly, offering more codecs and finer control. This tool is simpler and faster for the common case of batch-compressing JPEG, PNG, and WebP files with a single quality setting. Choose this tool when privacy is a priority, you need quick batch compression, and you don't need advanced codec options.

Related Tools

View all tools →