Compress image
How to compress an image
- Add your pictures: drag JPG, PNG, WebP or AVIF files onto the box above or click to browse. Up to 50 at a time.
- Choose an Output format. Same as the original is the safe choice, WebP and AVIF are smaller but older programs may not open them.
- Move Quality (75 is the default) and, if the pictures are very large, set the Longest side in pixels.
- Click Compress images and check the before and after sizes.
- Download each file, or click Download all as ZIP. Names get -compressed added, and a file that could not be made smaller comes back unchanged.
What this image compressor does
You add JPG, PNG, WebP or AVIF pictures and the tool saves a smaller copy of each. Three settings control the result. Output format keeps the original format or switches to WebP or AVIF. Quality runs from 10 to 95 and starts at 75. Longest side in pixels shrinks big pictures and starts at 0, which keeps the size. The work happens in your browser tab, using open source codecs compiled to WebAssembly: MozJPEG, OxiPNG, WebP and AVIF.
We tested the privacy claim. We loaded the page, added a photo and logged every request. The page made 20 requests, none with a body, and the outside hosts were the two Google ad and analytics hosts that every GramFile page calls, and jsDelivr (the codecs). The codec files are requested only after you add a picture: none before, several after. Only Chromium was tested, so Firefox, Safari and phone browsers are unconfirmed.
Each result is named after the original with -compressed added, so photo.jpg becomes photo-compressed.jpg. The result box shows before and after sizes in units of 1,024 bytes, which is why 247,358 bytes appears as 242 kB. There is no before-and-after preview, so open the result yourself to judge it.
What the quality slider does to size
Our test photo is a 1280 by 960 JPG of 247,358 bytes. At the default quality of 75 it became 28,069 bytes, 11 percent of the original. At 40 it was 12,851 bytes and at 10 it was 6,238. The table on this page has every run. We also measured how far the pixels moved: the average difference from the original was 1.9 on a scale of 255 at quality 75 and 4.1 at quality 10. A small number does not mean you cannot see the change, only that it is small on average. Check one converted picture at full size before you process a folder.
The slider stops at 95. On our photo, 95 made a file that was not smaller, so the tool returned the original and said "This image is already compact, so compressing would not make it smaller." The same rule covers every file: a result that is not smaller than the input is never given to you.
The samples are synthetic, not camera photos, and their fine noise affects sizes. Treat the ratios as an example of the pattern and not as a promise for your own pictures.
Compressing without losing quality
Only PNG stays lossless here. The tool repacks the pixels more tightly and checks nothing changes: our 800 by 600 PNG photo went from 620,844 to 597,505 bytes, 96 percent of the original, and the pixels were identical. A transparent logo went from 21,105 to 19,587 bytes with its transparency intact. PNG saves little because it has to keep every pixel. A screenshot of a photo is a typical case.
JPG, WebP and AVIF are lossy. The tool decodes the picture and encodes it again, so every pass adds a little loss. Compressing a JPG that someone already compressed twice costs more than compressing the original once. Keep your originals and compress from them.
Changing the format: WebP and AVIF
The biggest savings come from a new format. The same JPG at the default quality became 15,480 bytes as WebP and 5,700 as AVIF, against 28,069 as a smaller JPG. Pixel difference stayed near 2 for all three, so on our sample accuracy was about equal and size very different. Our PNG photo fell from 620,844 bytes to 8,248 as WebP and 3,699 as AVIF. That saving is large because the output is lossy, which is a different thing from the lossless 4 percent above. The slider means something different for AVIF, so the tool rescales it. Use it the same way.
The costs are speed and support. AVIF took about 1.4 seconds for the photo against 0.9 for JPG and WebP, and PNG took 2.3 seconds. Older programs may not open WebP or AVIF, and some upload forms reject them, so choose JPG or PNG when a form asks. A transparent PNG kept its transparency as WebP, but the file was only 4 percent smaller (21,105 to 20,330 bytes), so a logo gains little.
Do not run the same file through repeatedly. Our WebP sample of 19,836 bytes shrank to 15,206 and our AVIF of 19,912 to 5,952, which is real but costs detail each time.
Longest side in pixels
A photo from a phone often has far more pixels than a screen or an email needs. Set the longest side to 640 and our photo came out 640 by 480 and 9,784 bytes, against 28,069 at full size. The tool shrinks and never enlarges: with the limit at 2,000, our 1,280 pixel photo came out unchanged in size. A PNG with a limit of 400 became 400 by 300 and 124,362 bytes. The aspect ratio is kept.
This field is a convenience. For exact dimensions or a percentage, use the image resizer. To hit a size such as 100 KB, use compress image to size, which searches for the quality that fits.
What is removed and what is not warned about
Pictures are decoded and encoded again, so camera details, date and GPS are dropped, and so is any colour profile. The page tells you after each result. Our photo with a rotation flag was stored sideways at 960 by 1280. The result was upright at 1280 by 960 with no EXIF data left. Keep your originals if the date or camera matters. Our samples had no Display P3 profile, so we did not test how wide-gamut colours look afterwards.
One gap. We gave the tool a three-frame animated WebP. The output had one frame, 8,868 bytes against 30,122, and the page showed only the usual metadata note. It did not say the animation was gone. Animated pictures lose everything but the first frame here, so do not compress them. GIF files are not accepted at all.
Limits and errors
You can add 50 files at a time, each up to 100 MB. A 51st file is refused when you add it with the message "Only 50 files at a time." Fifty copies of our photo (12.4 MB together) finished in 9.4 seconds, about 190 milliseconds each on our test machine. Your computer will differ.
GIF, SVG and HEIC files are refused with "this file type is not supported here." For iPhone photos, run them through HEIC to JPG first. A file that is named .jpg but is not a picture is accepted and then fails with "this is not an image this tool can read." We have not tested files near 100 MB, CMYK or 16-bit images.
Common jobs
Email or chat. Keep the format, leave quality at 75 and, if the file is still large, set a longest side. A website. Try WebP, which our sample made about half the size of the JPG. A form with a size cap. Use compress image to size. A PNG screenshot. Expect a few percent in PNG, or choose WebP and accept the loss. Several photos as one file. Compress them, then use image to PDF. For a different format only, see image format converter, or browse the image tools.
Measured results
| Picture | Setting | Original bytes | Result bytes | Share of original | Pixel difference |
|---|---|---|---|---|---|
| JPG photo | Quality 95 | 247,358 | 247,358 | 100 percent | 0 |
| JPG photo | Quality 75 (default) | 247,358 | 28,069 | 11 percent | 1.87 |
| JPG photo | Quality 40 | 247,358 | 12,851 | 5.2 percent | 2.23 |
| JPG photo | Quality 10 | 247,358 | 6,238 | 2.5 percent | 4.13 |
| JPG photo | WebP, quality 75 | 247,358 | 15,480 | 6.3 percent | 1.97 |
| JPG photo | AVIF, quality 75 | 247,358 | 5,700 | 2.3 percent | 2.05 |
| JPG photo | Longest side 640 | 247,358 | 9,784 | 4.0 percent | 1.68 |
| PNG photo | Same format | 620,844 | 597,505 | 96 percent | 0 |
| PNG photo | WebP, quality 75 | 620,844 | 8,248 | 1.3 percent | 1.87 |
| PNG photo | AVIF, quality 75 | 620,844 | 3,699 | 0.6 percent | 2 |
| Transparent PNG | Same format | 21,105 | 19,587 | 93 percent | 0 |
| Transparent PNG | WebP, quality 75 | 21,105 | 20,330 | 96 percent | 0.57 |
Prefer desktop software?
Use a desktop image program when you want to compare before and after side by side, keep camera and date data, convert pictures in a folder with your own naming, or work on files above 100 MB. This page has no preview, and it removes metadata.
Frequently asked questions
Are my pictures uploaded?
No. Your browser compresses them on your computer. In our test the page made 20 requests, none with a body, and the outside hosts were Google ad and analytics hosts and jsDelivr (the codecs). The codecs now load from jsDelivr.
Can I compress an image without losing quality?
Only PNG, and the saving is small. Our PNG photo went from 620,844 to 597,505 bytes with identical pixels. JPG, WebP and AVIF are lossy, so some detail is always lost.
Which quality should I use?
Start at 75. On our photo that gave 28,069 bytes from 247,358, with an average pixel change of 1.9 out of 255. Try one picture first, because results depend on the photo.
Why did I get my original file back?
The result was not smaller. The tool never returns a bigger file, so it gives you the original and says so. Our JPG at quality 95 did this.
Why does a PNG barely shrink?
PNG keeps every pixel, so there is little to remove. Choose WebP for a much smaller file, knowing it is lossy and some programs cannot open it.
JPG, WebP or AVIF?
On our photo, 28,069 bytes as JPG, 15,480 as WebP and 5,700 as AVIF. Pick JPG when a form or old program asks for it, WebP for websites, and AVIF when you control where it is opened.
Does it remove EXIF and location data?
Yes. Camera details, date, GPS and colour profile are dropped, and a picture with a rotation flag comes out upright.
Does it work on animated pictures?
It keeps only the first frame and does not warn you. A 3-frame WebP came out as a single image. GIF files are refused.
Is it safe to compress images online?
It is safe here because nothing is sent to a server, which we checked with a request log. With a tool that uploads, read what it says about deleting files.
How many pictures at once?
Up to 50, each up to 100 MB. Fifty copies of our photo took 9.4 seconds.