Getting a file under 5MB is rarely the hard part, almost any reasonable photo compresses well within that budget. The tool actually checks a full quality 100 encode first, and for most photos at a 5MB target that already fits, so no search is needed at all and you get the maximum quality the format allows. Only if quality 100 overshoots does it search downward for the highest quality that fits, rather than guessing at a fixed value. That search, and the fast-path check before it, both run in a background Web Worker, so even a large source file doesn't lock up the tab while it processes.
There's also a safety net most compressors don't bother with. If hitting 5MB somehow required dropping quality low enough to look genuinely bad, the tool won't just deliver that. Instead it trims the pixel dimensions down slightly and re-runs the quality search at that smaller size. At a 5MB target this almost never triggers, it exists mainly to protect the much smaller targets on this site, like compress to 100KB, where a strict file size and a large source photo are more likely to collide.
Adjusting after the fact
Once a result appears, changing the target size field or switching between JPEG and WebP doesn't require dropping the file in again. The tool keeps the decoded image cached and reruns compression automatically, typing a new target waits briefly until you stop typing, clicking a format button applies immediately. That's useful here in particular, since it's easy to start at 5MB and realize afterward that a platform's actual limit is closer to 2MB or 1MB.
RAW and HEIC exports
If you're coming from a camera or an iPhone, your source file may already be in a format this tool doesn't output directly. HEIC and HEIF photos are accepted as input, but if you'd rather convert first and inspect the result before compressing, use HEIC to JPG as a separate first step. The same applies to PNG source files, they're accepted here too, but the output is always JPEG or WebP, never PNG.
Before you deliver the file
For professional delivery, file size usually isn't the only thing that matters. If the shoot includes location data you'd rather not share, run the compressed file through remove EXIF data as well, compression alone already strips this, but it's worth confirming if privacy matters for the shoot. If you need to protect proofs before a client has paid, an watermark added before compression is a common step. And if a specific platform actually caps pixel dimensions rather than file size, pair this with the resize tool first.