Compress an image to a file size
Choose a maximum size in kilobytes. This page keeps the picture in this browser, tries to produce a file at or below that size, and lets you download it.
A couple of uses
- A photo that is too large to attach to a message.
- A picture you need under a size limit before you send it on.
How to use it
- Choose a JPEG, PNG, WebP, GIF, or AVIF image.
- Set the maximum file size and, if you want, the maximum width and height.
- Choose an output format this browser can encode.
- Compress, check the size and the preview, then download the file.
Privacy
The image is read and encoded in this browser. This tool does not upload it and does not send it to an image API. It stays in this tab until you leave or choose another file. The journal pages load an existing analytics script with the site shell; this tool does not give that script the image.
Limits
- Resizing, or saving as JPEG, WebP, or AVIF, is lossy. This does not promise a lossless copy, or a file of an exact byte length. Success means the result is at or under your maximum.
- JPEG cannot store transparency. If the image has transparent pixels and you choose a format that cannot keep them, you confirm a background color first. The tool will not switch format on its own.
- PNG keeps transparency. This browser’s PNG encoder has no quality slider, so the size target is pursued by reducing dimensions. A re-encoded PNG can be larger than an optimized original.
- GIF animation is not recompressed. If the original GIF is already under the limit and you keep that format, it is downloaded unchanged. Any other format uses the first frame only, after you confirm that.
- Camera orientation stored in the image is applied before resizing. Files over 15 MB, or images over 16 million pixels or 8000 pixels on a side, are rejected before they are decoded.
- If the quality floor and the dimensions make the target impossible, the page says so and still offers the smallest file it produced under those settings.
- WebP and AVIF appear only when this browser can encode them. An unsupported format is refused rather than saved as something else.
JPEG, PNG, WebP, GIF, or AVIF. Up to 15 MB. The file stays in this browser.
Result