How to Calculate Image File Size From Dimensions and Bit Depth

Every digital image is a grid of pixels, and each pixel stores colour information in bits. Multiply pixels by bits and you get the raw size. That raw size is the starting point for storage estimates, upload times, and print quality decisions.

The formula

Uncompressed size (bytes) = width in pixels x height in pixels x bit depth / 8. Bit depth is bits per pixel. A standard colour photo uses 24 bits per pixel: 8 each for red, green, and blue. A greyscale image uses 8 bits per pixel. Divide by 8 to convert bits to bytes.

Watch the units. File sizes are quoted in MB, but MB can mean 1,000,000 bytes or 1,048,576 bytes (MiB). The difference is about 5%, which matters when you are close to an upload limit. State which one you mean when it matters.

Worked example

A 4000 x 3000 pixel photo at 24-bit colour: 4000 x 3000 = 12,000,000 pixels. Times 24 bits = 288,000,000 bits. Divide by 8 = 36,000,000 bytes, about 36 MB (or 34.3 MiB). A 1920 x 1080 image at 24 bits is 1920 x 1080 x 24 / 8 = 6,220,800 bytes, about 6.2 MB.

The same 4000 x 3000 photo as greyscale (8 bits) is only 12,000,000 bytes, about 12 MB. And a 4000 x 3000 image with an alpha transparency channel uses 32 bits per pixel, giving 48 MB. Bit depth is a multiplier on everything, so check it before blaming the pixel count.

Why saved files are smaller

A JPEG of that 36 MB photo might be only 4 to 8 MB, because JPEG compression discards detail the eye barely notices. A PNG of a simple logo might be tiny, because PNG compression is excellent on flat colours but poor on photos. A RAW file stays near the full uncompressed size because it keeps all sensor data for editing.

So the formula gives the uncompressed size, which is the ceiling. The saved size depends on format and content: busy, noisy photos compress badly, while smooth skies and flat graphics compress well. For storage planning, use the uncompressed figure; for upload estimates, use the actual saved file size.

Practical uses

Before a shoot, multiply expected shots by uncompressed size to size your memory cards. Before uploading, compare the saved file with a platform’s limit. Before printing, check pixels per inch: a 4000 x 3000 image prints at 300 dpi as 13.3 x 10 inches, which is plenty for A4 but thin for a large poster.

Megapixels and print size

Megapixels = width x height / 1,000,000. A 4000 x 3000 image is 12 megapixels. Megapixels describe pixel count only, not quality: a sharp 12-megapixel photo beats a blurry 48-megapixel one every time.

For printing, divide pixel dimensions by your print dpi. At 300 dpi, 4000 x 3000 prints at 13.3 x 10 inches, fine for A4. At 150 dpi, the same image prints at 26.7 x 20 inches, acceptable for a poster viewed from a distance. Decide the print size first, then check whether your pixels support it, not the other way round.

One more practical check: before sending images to a printer or a client, confirm the colour profile as well as the size. An sRGB file and a CMYK file with identical pixel dimensions can print differently, and a file saved with an embedded profile carries that information with it. Size gets the image through the door; the profile decides how it looks on arrival.

Try it faster with the tool

You can follow every step above by hand, but the free Online Image Size Calculator does the arithmetic for you. Enter your numbers and it gives the answer right away, so you can check your hand calculation or skip straight to the result.

Quick tips

  • Bytes = width x height x bit depth / 8.
  • 24-bit colour is the standard photo depth.
  • The formula gives the ceiling; compression decides the saved size.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top