Image Compressor

By Asira Tools Team · Last updated 20 November 2026

Compress JPG, PNG, and WebP images right in your browser — pick a quality level and a maximum size, then download the smaller file.

Advertisement

Image Compressor

Drop an image here or click to choose one

Choose an image to see your compressed size
Original—
New dimensions—
Estimated size—
Actual size—

Your image never leaves your device — compression runs entirely in your browser. Quality affects JPEG and WebP output; PNG is lossless, so its size does not change with the quality slider.

Formulas:

Scale = smallest of 1, Max width ÷ Original width, Max height ÷ Original height

New width = Original width × Scale, New height = Original height × Scale

Estimated size = Original size × Quality × (New pixels ÷ Original pixels)

What Does an Image Compressor Do?

An image compressor makes an image file smaller so it loads faster, takes up less storage, and is easier to send. It does this in two ways at once: it shrinks the pixel dimensions, and it applies stronger compression to the image data itself. A photo straight from a phone camera can be 4,000 pixels wide and several megabytes in size — far bigger than any screen needs. Compressing it to 1,920 pixels wide at a quality of 0.8 can cut the file to roughly a fifth of its original size, with no visible difference on a normal display.

This tool compresses images entirely in your browser. Nothing is uploaded to a server, so your photos stay on your device and there is no waiting for an upload and a download. You choose a file, set a quality level and a maximum width and height, and the tool shows you the estimated size, the actual size, and the new dimensions before you download. It works with JPG, PNG, and WebP files, and you can pick which of those three formats the compressed file should use.

How to Use This Image Compressor

Start by dropping an image onto the upload area or clicking it to choose a file from your device. The tool reads the image and shows a preview along with its original dimensions and file size. Then set the quality slider: 0.8 is a good default for photos, giving a big size saving with quality that looks identical to the original in normal viewing. Set the maximum width and height to the largest size you actually need — 1,920 pixels wide is enough for a full-width website image, and 1,200 pixels is plenty for a blog post image.

As you change the settings, the results update immediately. The estimated size is calculated from the quality and the change in pixel count, and the actual size is measured from the compressed file itself once your browser has produced it. When you are happy, click the download button to save the compressed image. The original file on your device is never changed — the tool always creates a new file with "-compressed" added to its name.

How Image Compression Works

There are two kinds of compression at work here, and understanding both helps you choose good settings. The first is resizing: fewer pixels means less data. Halving both the width and the height of an image leaves only one quarter of the pixels, so the file gets roughly four times smaller before compression even starts. That is why shrinking dimensions is the single most powerful way to reduce a file — a 4,000 by 3,000 photo has 12 million pixels, while the same photo at 1,920 by 1,440 has only about 2.76 million, which is 23 percent of the original.

The second is quality, which applies to lossy formats such as JPEG and WebP. Lossy compression throws away image detail that the human eye is least likely to notice — subtle color changes and fine texture — and a lower quality setting throws away more. A quality of 0.8 keeps most of the detail while removing a large share of the data; a quality of 0.5 removes much more and starts to show visible artifacts, such as blocky patches in smooth areas like skies. PNG is different: it is a lossless format, so it never throws away detail, which means the quality slider has no effect on PNG output and PNG files stay larger than JPEG files of the same photo.

The Compression Formula

The tool estimates the compressed size with a simple formula. First it works out the scale factor: the smallest of 1, the maximum width divided by the original width, and the maximum height divided by the original height. The scale is never more than 1, so the tool never enlarges an image — upscaling would only make the file bigger without adding any real detail. The new width is the original width times the scale, and the new height is the original height times the scale, so the aspect ratio is always preserved.

Then the estimated size is the original size times the quality setting times the ratio of new pixels to original pixels. If you halve both dimensions, the pixel ratio is 0.25, so the estimate is a quarter of the original size times the quality factor. This is an estimate because real compression depends on the image content — a photo of a busy forest compresses less well than a photo of a clear sky — which is why the tool also shows the actual size measured from the file your browser produces.

Worked Example

Take a typical phone photo: 4,000 by 3,000 pixels, 3,000,000 bytes (about 2.86 MB). Set the quality to 0.8 and the maximum width and height to 1,920 pixels. The scale is the smallest of 1, 1,920 divided by 4,000 (0.48), and 1,920 divided by 3,000 (0.64), so the scale is 0.48. The new dimensions are 4,000 times 0.48 = 1,920 pixels wide and 3,000 times 0.48 = 1,440 pixels tall.

The new image has 1,920 times 1,440 = 2,764,800 pixels, while the original has 12,000,000 pixels, so the pixel ratio is 0.2304. The estimated size is 3,000,000 times 0.8 times 0.2304 = 552,960 bytes, which is exactly 540 KB. That is a saving of 81.6 percent — the file goes from nearly 3 MB to just over half a megabyte — and at 1,920 by 1,440 pixels it still fills a full HD screen. This is the example the tool itself computes, so you can check it by entering the same numbers.

What Quality Setting Should You Use?

The right quality depends on what the image is for. For photographs on a website, 0.75 to 0.85 is the sweet spot: files are small and the quality loss is invisible at normal viewing distance. For images people will look at closely, such as product photos or portfolio work, use 0.9 — the file will be larger, but fine detail stays crisp. For thumbnails, previews, and images in emails, 0.6 to 0.7 is usually fine, because the image is displayed small and minor artifacts are not visible.

Below 0.5, JPEG artifacts become obvious: edges get halos, smooth gradients turn into visible bands, and text in the image becomes hard to read. Avoid going that low unless file size is far more important than quality, such as a tiny preview image. Also remember that every JPEG save loses a little more quality, so always compress from the original file rather than compressing an already compressed copy — repeated compression stacks the damage.

How Small Should Your Images Be?

Match the dimensions to where the image will be shown. A full-width hero image on a website rarely needs to be wider than 1,920 pixels, because that is the width of a full HD screen. Blog post images are usually displayed at 800 to 1,200 pixels wide, so compressing to 1,200 pixels is plenty. Social media profile pictures and thumbnails are displayed at a few hundred pixels, so 400 to 800 pixels wide is enough. Sending images by email? Most email clients display images at 600 pixels wide or less, so a 1,200 pixel image is already generous.

As a rule of thumb, aim for web images under 200 KB each and hero images under 500 KB. A page with ten uncompressed 3 MB photos forces visitors to download 30 MB, which takes several seconds even on fast broadband and far longer on a phone connection. The same page with compressed images under 200 KB each loads in a fraction of the time, which matters for both visitors and search rankings — page speed is a ranking factor, and slow pages lose readers.

Tips for the Smallest File Without Visible Loss

Resize first, then compress. Shrinking dimensions gives the biggest saving of all, so set the maximum width and height before worrying about the quality slider. An image that is twice as wide as it needs to be carries four times the pixels.

Use WebP when you can. WebP typically produces files 25 to 35 percent smaller than JPEG at the same visual quality, and it is supported by all modern browsers. If you need the widest possible compatibility, JPEG is the safe choice; if you control the website, WebP is the better one. Our WebP Converter explains the format in detail.

Do not compress PNG photos. PNG is a lossless format designed for graphics, screenshots, and images with transparency. A PNG photo can be several times larger than the same photo as a JPEG. If your image is a photo with no transparency, choose JPEG output — our PNG to JPG Converter is built for exactly that job.

Keep the original. Compression throws away data that cannot be recovered. Always keep the original full-size file somewhere safe, and compress a copy for each use. That way you can always go back and make a larger or higher-quality version later.

Common Mistakes to Avoid

The most common mistake is compressing an image that is already small. If a photo is already 800 pixels wide and 120 KB, running it through a compressor at quality 0.5 will visibly damage it while saving only a few kilobytes. Check the original size first — if it is already under your target, leave it alone.

The second mistake is setting the maximum dimensions too small for the job. A 400 pixel image looks fine as a thumbnail but blurry and pixelated when stretched to fill a 1,200 pixel blog column. Always compress to the largest size the image will actually be displayed at, not the smallest size that happens to look fine on your phone screen.

Finally, do not expect compression to fix a bad photo. Compression removes data; it cannot add sharpness, fix bad lighting, or remove noise. If an image looks soft or noisy before compression, it will look worse after it. Fix the photo first — crop, straighten, and adjust it — then compress the finished version as the last step before publishing.

Advertisement

Frequently Asked Questions

How much can image compression reduce file size?

A lot. A 4,000 x 3,000 phone photo of 3 MB compressed to 1,920 x 1,440 at quality 0.8 drops to about 540 KB — an 81.6% saving. Shrinking dimensions helps most, because halving width and height leaves only a quarter of the pixels.

What is the best quality setting for compressing images?

0.75 to 0.85 for web photos: the quality loss is invisible at normal viewing distance. Use 0.9 for product or portfolio photos people inspect closely, and 0.6 to 0.7 for thumbnails. Below 0.5, JPEG artifacts become obvious.

Does compressing an image reduce its quality?

JPEG and WebP compression is lossy, so some detail is removed — but at quality 0.8 the loss is not visible in normal viewing. PNG compression is lossless and never loses quality, but PNG files stay much larger than JPEG files of the same photo.

Is it safe to compress images online?

With this tool, yes: compression runs entirely in your browser and your image is never uploaded to any server. The original file on your device is never changed either — the tool always creates a new file to download.

Should I compress to JPEG, PNG, or WebP?

JPEG for photos when you need maximum compatibility, WebP for photos on your own website (typically 25-35% smaller than JPEG), and PNG only when you need transparency or perfectly crisp text and graphics.