Upload a JPG, PNG, WebP or AVIF image and this tool will automatically target a 5MB file size — entirely in your browser, nothing is ever uploaded to a server.
Why compress to 5MB?
Target file sizes like 5MB usually come from a hard limit somewhere else — an email attachment cap, a job application portal, a government form, a website's upload guidelines, or a slow connection you want to keep fast. Instead of guessing a quality percentage and hoping the result lands under the limit, this mode runs an iterative search: it re-encodes your image at progressively lower quality (and, if needed, slightly smaller dimensions) until the file fits at or under 5MB, then stops — so you get the best quality possible within that budget, not the smallest file the tool can technically produce. Everything happens locally using the Canvas API, so your photo never leaves your device.
How to Use It
- Drag and drop your JPG, PNG, WebP or AVIF image into the upload area.
- The target size is already set to 5MB — adjust it if you need something different, or switch to "By Quality" mode instead.
- Click Compress and let the tool search for the best quality that fits your target size.
- Compare the original and compressed versions with the before/after slider.
- Download the result, or start over with a new image.
Other Target Sizes