Image File Size Calculator
Megapixels and uncompressed size from pixel dimensions and depth.
What it does
Every digital photo is a grid of pixels with a fixed cost per pixel. A 1200 by 1600 shot holds 1,920,000 pixels, and at 24 bit color each pixel costs 3 bytes, so the raw data runs 5,760,000 bytes. Compression shrinks saved files, but memory, uploads, and raw captures follow the full figure.
The tool above runs that math for any size. Enter width and height in pixels, pick the bit depth, and it prints megapixels, binary MiB, and decimal MB. The default photo frame gives 1.92 MP at 5.49 MiB (5.76 MB); a 4K frame at 3840 by 2160 runs 8.29 MP at 23.73 MiB.
Standards fix each factor. The W3C PNG spec defines the byte as 8 bits with sample depths of 1 to 16 bits, NIST defines the MiB as 1,048,576 bytes against the decimal MB, and the Library of Congress preservation guides prefer high resolution 24 bit RGB over 8 bit indexed for still images.
Bit depth is the quality lever. One bit suits line art, 8 covers gray and indexed color, 24 covers normal photos, and 32 adds an alpha channel for transparency. Each step up multiplies the file: the same pixels at 48 bit cost twice the 24 bit size.
How to use
- Enter the image width in pixels.
- Enter the image height in pixels.
- Pick the bit depth: 24 for normal color photos.
- Read megapixels first, then MiB and MB uncompressed.
- Compare with the saved file size to see compression at work.
- For scans, divide flatbed dpi by print inches to get pixels first.
Formula
- width
- Image width in pixels, 1 to 100000.
- height
- Image height in pixels, 1 to 100000.
- depth
- Bits per pixel: 1, 8, 24, 32, or 48.
- MiB
- 1,048,576 bytes, the binary megabyte per NIST.
One byte is 8 bits by definition. Depths follow the PNG spec range of 1 to 16 bits per sample across its color types.
Worked example
Example: 1200 x 1600 at 24 bit
Defaults: 1200 by 1600 px, 24 bit RGB (8 bits times 3 channels).
- Inputs: 1200 x 1600 px at 24 bit RGB.
- Pixels: 1200 x 1600 = 1,920,000.
- Megapixels: 1,920,000 / 1,000,000 = 1.92 MP.
- Bytes: 1,920,000 x 24 / 8 = 5,760,000.
- MiB: 5,760,000 / 1,048,576 = 5.49. MB: 5.76. Tool shows 1.92 MP, 5.49 MiB, 5.76 MB.
Reference table
| Frame | MP | MiB |
|---|---|---|
| 640 x 480 VGA | 0.31 | 0.88 |
| 1920 x 1080 Full HD | 2.07 | 5.93 |
| 3840 x 2160 4K | 8.29 | 23.73 |
| 6000 x 4000 | 24.0 | 68.66 |
Limits
- Uncompressed math only. Compression ratios sit outside the numbers.
- Ignores headers, thumbnails, and metadata overhead.
- Assumes full frames; crops need their own dimensions.
- Print size needs dpi too, which this page does not cover.
Common mistakes
- Mixing MiB and MB when sizing uploads.
- Forgetting alpha: RGBA at 32 bit costs a third more than RGB.
- Using megapixels alone to guess file weight across depths.
- Reading compressed JPEG size as sensor data size.
- Scanning at low dpi then blaming pixel math.
Try it yourself
Quick checks. Answers sit tucked under each question.
2400 x 3000 at 24 bit?
7,200,000 px = 7.2 MP. Bytes 21,600,000 = 20.6 MiB = 21.6 MB.
640 x 480 VGA at 24 bit?
307,200 px = 0.31 MP. Bytes 921,600 = 0.88 MiB = 0.92 MB.
Questions
What is a megapixel?
Total pixels divided by one million. A 1200 x 1600 shot is 1.92 MP.
How is uncompressed size figured?
Width times height times bit depth over 8. At 24 bit that is 3 bytes per pixel.
MiB versus MB: what differs?
1,048,576 bytes (binary) versus 1,000,000 bytes (decimal). The tool prints both: 5.49 MiB and 5.76 MB here.
What do the bit depths mean?
Bits per pixel: 1 bitonal, 8 gray or indexed, 24 RGB, 32 RGBA, 48 deep color. Deeper files hold smoother tones at bigger sizes.
Are saved files smaller?
Yes, often far smaller. JPEG and PNG compress; raw, BMP, and TIFF run near the full uncompressed figure.
What do archives prefer?
The Library of Congress prefers high resolution with 24 bit RGB over 8 bit indexed, and 16 bit per channel over 8 where kept.
Sources
- Library of Congress: Still Image Preferences
- W3C: PNG Specification (bytes, sample depths)
- NIST: Prefixes for Binary Multiples (MiB)