Compress JPG and PNG Online: The Complete Guide
Everything you need to know about shrinking image files for the web — formats, compression types, target sizes, and the best free tools that respect your privacy.
Table of contents
Image compression basics
Image compression reduces the file size of an image while keeping it looking as close to the original as possible. Smaller images load faster, cost less bandwidth, and rank better in search engines. Google's Core Web Vitals explicitly reward pages with optimised images.
There are two fundamentally different approaches: lossy and lossless. Understanding the difference is the key to choosing the right tool and settings.
JPG vs PNG: when to use which
JPG / JPEG
- ✓ Best for photographs
- ✓ Lossy — smaller files
- ✓ 16 million colours
- ✗ No transparency support
- ✗ Artefacts on text and sharp edges
- ✗ Quality degrades with each re-save
PNG
- ✓ Best for graphics, logos, screenshots
- ✓ Lossless — no quality loss
- ✓ Full transparency support
- ✓ Crisp text and sharp edges
- ✗ Much larger files for photos
- ✗ Not ideal for photographs
Rule of thumb: if it's a photo, use JPG. If it has text, transparency, or sharp geometric shapes, use PNG. If you're not sure, try both and compare file size vs visual quality.
Lossy vs lossless explained
Lossy compression permanently discards image data that the human eye is unlikely to notice. This achieves dramatic size reductions (70–90% smaller) with minimal visible quality loss. JPG is always lossy. Once data is discarded, it cannot be recovered.
Lossless compression re-encodes the image data more efficiently without throwing anything away. The decompressed image is pixel-for-pixel identical to the original. PNG and WebP both support lossless mode. The trade-off is that file sizes remain significantly larger than lossy alternatives.
Practical tip: For web images, lossy compression at quality 75–85 is the sweet spot. The file is 80% smaller and looks identical to the original at normal viewing distance.
How to compress JPG and PNG online
Choose a browser-based compressor
Pick a tool that runs client-side so your images never leave your device. Our free image compressor is 100% private.
Drag and drop your files
Add one or many images. Most modern compressors accept drag-and-drop or file picker. Batch mode saves time when you have many images.
Set quality or target size
Use a quality slider (75–85 for web) or set an exact target file size like 100KB for form uploads and email attachments.
Download the results
Preview the compressed output, compare to the original, and download. Pro users can grab a ZIP of the entire batch.
Should you use WebP?
WebP is Google's modern image format. It supports both lossy and lossless compression, transparency, and produces files 25–35% smaller than equivalent JPGs and PNGs. Every modern browser (Chrome, Firefox, Safari, Edge) supports it.
| Format | Avg size (same quality) | Transparency | Browser support |
|---|---|---|---|
| JPG | 100% (baseline) | No | Universal |
| PNG | ~300% of JPG | Yes | Universal |
| WebP | ~70% of JPG | Yes | All modern browsers |
If your platform supports WebP, convert your images. If you need maximum compatibility (email, old CMS, government portals), stick with JPG and PNG.
Hitting specific file sizes
Many real-world scenarios require hitting an exact file size, not just “make it smaller.” Common targets include:
Use a compressor with a target file size feature, like our image compressor, to hit these exactly. Learn more about the most common target in our guide to compressing images to 100KB.
Common compression mistakes
Frequently asked questions
What is the difference between JPG and PNG compression?
JPG uses lossy compression (discards data for smaller files), while PNG uses lossless compression (preserves all data but results in larger files). JPG is best for photos; PNG is best for graphics with text, transparency, or sharp edges.
Can I compress images without losing quality?
PNG can be compressed losslessly. For JPG, some quality loss is unavoidable beyond basic metadata stripping, but modern algorithms make it barely noticeable at quality 80+. The visual difference is often invisible at normal viewing size.
Should I convert my images to WebP?
WebP produces files 25-35% smaller at equivalent quality and is supported by all modern browsers. If your platform supports WebP, convert. For maximum compatibility (email, old systems), stick with JPG and PNG.
How much can I compress an image?
Most images can be reduced by 50-90% with minimal visible quality loss. A 5MB photo can typically become 500KB or less. The exact ratio depends on the original image, format, and acceptable quality level.
Is online image compression safe?
It depends on the tool. Server-based compressors upload your images to a third-party server, which is a privacy risk. Client-side compressors (like ours) process images entirely in your browser — nothing is uploaded.