The form is clear: Maximum file size: 5 MB. Your export is 17.4 MB. You are not building a media company. You are trying to submit one document before a deadline.
This is one of the most common upload failures on the modern web, and one of the least well-served by “free compressors” that bury the download behind signup walls.
Why Limits Exist
Portals cap uploads to control storage costs, email attachment pipelines, malware scanning time, and ancient server configs. The number is arbitrary from your point of view. From theirs, 5 MB (or 2 MB, or 500 KB) is a hard gate.
What Actually Shrinks a File
For photos and screenshots, size comes from resolution × quality:
- Lower JPEG quality (e.g. 90 → 75) often cuts size dramatically with little visible change on a form photo
- Resize dimensions if the image is 4000 px wide and the form only displays 800 px
- Convert HEIC/PNG to JPEG when the portal allows JPG; PNG screenshots are often huge for no benefit
The single biggest, least-obvious win: a 4000×3000 phone photo displayed in a 400px form box is carrying 10× the pixels anyone will ever see. Resizing to a sane dimension often gets you under the cap before you touch quality at all.
The quality/size relationship, concretely
JPEG quality is a dial from 100 (huge, lossless-looking) to ~1 (tiny, blocky). For a typical form photo:
- Quality 100 → 85: often halves the file with no difference you can see.
- Quality 85 → 75: another big drop, still fine for a headshot or document photo.
- Below ~70: artifacts start showing on text and skin; stop here for anything that must stay readable.
By File Type
PDFs: size usually comes from embedded images scanned at 600 DPI when 150 DPI would read fine, plus embedded fonts. Downsampling the images is the main lever, and if the PDF is really a stack of photos, rebuilding it from compressed images (see photo → clean PDF) is often smaller than “compressing” the bloated original.
Video: a different game. Re-encode to H.264/H.265 at a lower bitrate or resolution. A 180 MB clip for a 25 MB portal cap needs video under size, not image tricks.
Screenshots saved as PNG: PNG is lossless and enormous for photographic content. If the portal accepts JPG, converting a PNG screenshot to JPEG can cut it by 80%.
Name the constraint, not the algorithm
People don’t want “compression.” They want: make this under 5 MB. That’s exactly what Under-X MB does as a $1 utility: you set the max, it iterates quality and scale until the file fits, and hands it back. Agents can call the same operation over x402.
A Sensible Manual Approach
- Note the exact limit: 500 KB, 2 MB, 5 MB, 10 MB?
- If it’s an iPhone HEIC, convert to JPG first.
- Resize to the largest dimension the form actually needs (rarely more than ~1500 px).
- Export JPEG and check the size; step quality down (90 → 80 → 75) until it’s under the cap.
- If they also demand exact pixels (600×600, say), use exact image fit instead of guessing.
When You Should Not Crush Quality
Passport photos, medical scans, and legal exhibits have readability requirements. Keep JPEG quality above ~70 when text or faces must stay sharp. If you genuinely can’t hit the limit without destroying the content, split the document into pages or ask the recipient for an alternate channel, but try a smart recompress first. Most “too large” phone photos have plenty of headroom.
Questions that come up when you are stuck
Why does my file look small but upload as huge?
On-screen size is display pixels; file size is stored pixels × quality. A photo can look modest and still be 4000px wide at maximum quality.
Does converting to JPG lose quality?
JPEG is lossy, but at quality 80+ the loss is invisible for photos. Don’t use JPEG for line art or text-heavy graphics; use PNG there.
What if the portal also has a dimension rule?
Size and dimensions are separate gates. Handle both at once with UploadFix.
Sometimes 5 MB is not really 5 MB
A detail that explains a lot of otherwise baffling rejections: files do not always travel as raw bytes. Email attachments, and a good many JSON APIs, encode binary data as base64 in transit, which inflates it by roughly 33 percent.
The practical consequence is that a 4.8 MB file can genuinely exceed a 5 MB limit, because the thing being measured is the encoded payload rather than the file on your disk. If you are hovering just beneath a ceiling and being told you are over it, this is very often why. Target around 70 to 75 percent of the stated limit and the problem stops occurring.
PDFs shrink differently from everything else
General-purpose compression does comparatively little to a large PDF, because a PDF is a container and its size is almost always dominated by one of two things.
Embedded images are the usual culprit, particularly in anything produced by scanning. A scanner set to 600 dpi stores roughly four times the data of 300 dpi, and for a document that will be read on screen or printed normally, that extra resolution is invisible. Downsampling images to 150–200 dpi routinely cuts a scanned PDF by most of its size with no perceptible difference.
Embedded fonts are the quieter one. A PDF can carry complete font files, and a document using several families with bold and italic variants can spend a surprising amount on typefaces alone. Subsetting (keeping only the characters actually used) is usually a checkbox in the export dialog, and it is close to free.
Worth knowing before you reach for a compressor: if the PDF is a scan, converting the pages to greyscale often beats compressing them at full colour, and a scan of black text on white paper loses essentially nothing in the process.
How to approach it
The limit is the spec: optimize to the number, resizing before you sacrifice quality. Use Under-X MB for $1 when you don’t want to run the quality loop by hand, or start from the tools hub if you also need HEIC conversion or dimension fixes.
