Updated · how we check
Compress an image to 5 MB
To get an image under 5 MB, PixelFit aims at 5,000,000 bytes or less, so forms counting a megabyte as 1,000,000 or 1,048,576 bytes both accept it. That is roomy: by our estimate (extrapolated from encodes up to 3,000 px) a full 12 MP phone photo (4032 × 3024) fits at quality 92, with no resizing.
Under 5 MB
JPG · under 5 MB (at most 5,000,000 bytes) · original pixel size · white background
PixelFit aims at 5,000,000 bytes or less, so the file passes whether the form counts 1 MB as 1,000,000 or 1,048,576 bytes.
Fit, background and padding white background
Saving presets is part of Pro.
The result appears here: the exact byte count, pixel size and quality, the size before and after, a preview and a download button.
The batch kit (one ZIP for up to 500 photos, several photos merged into one PDF) is part of Pro.
What 5 MB means in bytes
5 MB is 5,242,880 bytes when a megabyte is 1024 × 1024 bytes and 5,000,000 bytes when it is 1000 × 1000. For megabyte limits PixelFit aims at 5,000,000 bytes or less (5 × 1,000,000), which passes both readings, and also the 5,120,000 bytes a server gets when it counts 5,120 KB of 1000 bytes. The exact byte count is printed, so you can compare it with the form.
The safety margin costs 242,880 bytes, 5 % of the binary reading. For a 4:3 photo at quality 75 that is the difference between 5,914 × 4,435 (extrapolated) and 5,758 × 4,318 (extrapolated) pixels, so playing safe loses little.
Largest pixel size that fits 5 MB
The biggest image of each kind, in its own aspect ratio, that stays at or below 5,000,000 bytes.
| Image | JPG q60 | JPG q75 | JPG q90 | WebP q75 |
|---|---|---|---|---|
| Head-and-shoulders portrait | over 7,158 × 8,940 | over 7,158 × 8,940 | 5,286 × 6,602* | over 7,158 × 8,940 |
| Outdoor landscape (12 MP phone photo) | 6,683 × 5,012* | 5,758 × 4,318* | 4,351 × 3,263* | 6,600 × 4,950* |
| Scanned typed document page | over 7,136 × 8,967 | over 7,136 × 8,967 | 5,532 × 6,951* | over 7,136 × 8,967 |
| Handwritten letter with signature | over 8,823 × 7,253 | over 8,823 × 7,253 | 7,090 × 5,828* | over 8,823 × 7,253 |
A 12 MP phone photo at 5 MB
Our 12 MP landscape sample (4032 × 3024) is about 4.15 MB at quality 90 and 4.73 MB at quality 92, under 5 MB (extrapolated from encodes up to 3,000 px). Here the tool keeps every pixel and only lowers quality (it starts at 92); a noisier photo may still need a small resize.
JPEG quality for fixed pixel sizes under 5 MB
When a form fixes the pixels, only quality can move. Highest quality (of 100) that keeps each size at or under 5,000,000 bytes:
| Pixel size | Measured on | JPG | WebP |
|---|---|---|---|
| 1080 × 1080 (square social post) | landscape photo | quality 95+ (640 KB) | quality 95+ (596 KB) |
| 1920 × 1080 (Full HD frame) | landscape photo | quality 95+ (1.09 MB) | quality 95+ (1.01 MB) |
| 2480 × 3508 (A4 page at 300 DPI) | scanned typed page | quality 95+ (2.05 MB) | quality 95+ (1.45 MB) |
| 3000 × 4000 (12 MP portrait frame) | portrait photo | quality 95+ (2.58 MB) | quality 95+ (1.86 MB) |
| 4032 × 3024 (12 MP phone photo) | landscape photo | quality 92 (4.73 MB) | quality 94 (4.71 MB) |
| 6000 × 4000 (24 MP camera photo) | landscape photo | quality 76 (4.74 MB) | quality 80 (4.61 MB) |
JPG, WebP or PNG at 5 MB
At quality 75, WebP holds 6,600 × 4,950 (extrapolated) of the landscape photo in 5 MB, JPG 5,758 × 4,318 (extrapolated): 31 % more pixels. A moderate gain at 5 MB. Many portals accept only JPG/JPEG, so this page starts in JPG.
A full-colour PNG is lossless, so its size follows the content. In 5 MB it holds a flat graphic of more than 9,561 × 6,692 pixels but a photo of only 1,837 × 1,377, against 5,758 × 4,318 (extrapolated) as a quality-75 JPG. Reducing a PNG to a palette of up to 256 colours (PixelFit does this when a PNG must shrink) helps graphics far more than photos.
5 MB is a quality decision
With 5,000,000 bytes, a 4:3 photo at quality 90 can be 4,351 × 3,263 (extrapolated) and a lossless PNG photo 1,837 × 1,377. A full 12 MP frame fits at quality 92 (extrapolated); a 24 MP camera photo (6000 × 4000) fits at quality 76 (extrapolated).
How to compress an image to 5 MB
-
Open the tool above
It is preset to 5 MB (5,000,000 bytes or less), JPG output.
-
Add your image
Drop, paste or pick it; a PNG, WebP or (where the browser opens it) HEIC file becomes a JPG under 5 MB.
-
Pixel size: only if asked
On auto, a 12 MP photo keeps all its pixels; quality goes to about 92 by our estimate.
-
Download and check
name-5mb.jpg comes with its byte count, pixels and quality.
Forms that ask for 5 MB
Upload specs in our dataset with exactly 5 MB. Verify with the official notice before you submit.
5 MB limits
Sources
- Measured by PixelFit with sharp 0.35.5 / libvips 8.18.7 on 31 October 2026.
- Sample images, Wikimedia Commons, checked 31 October 2026: landscape (CC0 1.0) commons.wikimedia.org/w/index.php?curid=154070378; portrait commons.wikimedia.org/w/index.php?curid=23956389; typed page commons.wikimedia.org/w/index.php?curid=194775753; handwritten letter commons.wikimedia.org/w/index.php?curid=90423615; flag commons.wikimedia.org/w/index.php?curid=361734 (public domain).
- Binary prefixes, NIST, checked 31 October 2026: physics.nist.gov/cuu/Units/binary.html
Frequently asked questions
How do I compress an image to 5 MB?
Drop it into the tool here, preset to 5 MB. It searches JPEG quality (at most 8 encodes per pixel size), then scales pixels down if needed, until the file is 5,000,000 bytes or less. By our estimate (extrapolated), a 12 MP photo fits with all its 4032 × 3024 pixels at quality 92.
How do I compress an image to less than 5 MB without losing quality?
At 5 MB there is little to give up: a 12 MP photo fits with all its pixels at quality 92, about 4.73 MB (extrapolated).
Is 5 MB 5,000,000 or 5,242,880 bytes?
Both readings exist: 5,242,880 bytes (1 MB = 1024 × 1024) or 5,000,000 bytes (1 MB = 1000 × 1000). PixelFit aims at 5,000,000 bytes or less, which passes both.
Can I compress a PNG to 5 MB?
Yes, but a full-colour PNG photo stays big: about 1,837 × 1,377 pixels in 5 MB, versus more than 9,561 × 6,692 for a flat graphic. As a JPG the photo reaches 5,758 × 4,318 (extrapolated).
Why is my photo already under 5 MB?
Our 12 MP sample is 4.15 MB at quality 90 (extrapolated), under the 5,000,000-byte target, so a phone JPEG of similar detail can meet 5 MB as it is.
Related
Nearby file sizes
- Compress to 4 MB photo ≈ 5,076 × 3,807
- Compress to 3 MB photo ≈ 4,315 × 3,236
- Compress to 2 MB photo ≈ 3,432 × 2,574
- Compress to 10 MB photo ≈ 8,515 × 6,386
More ways to hit 5 MB
- JPG to PDF under 5 MB One image as a PDF
- Image resizer with KB target Any size, pixels and format
Pixel sizes that fit 5 MB
- 12×18 inch print about 3.83 MB as a quality-75 JPG
- A3 (297×420 mm) about 3.48 MB as a quality-75 JPG
- 4000×4000 square about 3.23 MB as a quality-75 JPG
- 5120×2880 (5K) about 3 MB as a quality-75 JPG