Image File Size Calculator: Uncompressed Size from Pixels and Bit Depth
Work out the uncompressed size of an image from its width, height and bit depth (1 to 128 bits): bytes, MB and MiB, the exact BMP file size, megapixels, aspect ratio, print size at any DPI, a batch total and a table for common resolutions.
How it works
Bytes = width × height × bit depth ÷ 8 · MB = bytes ÷ 1,000,000 · MiB = bytes ÷ 1,048,576 · Megapixels = width × height ÷ 1,000,000 · BMP = 54 + palette (4 × 2^depth, up to 8-bit) + ⌈depth × width ÷ 32⌉ × 4 × height · Print size = pixels ÷ DPI
An uncompressed bitmap stores the same number of bits for every pixel, so its size is the pixel count times the bit depth, divided by 8 to turn bits into bytes. True-colour photos use 24 bits per pixel (8 each for red, green and blue); an alpha channel or CMYK makes 32; professional editing at 16 bits per channel makes 48, or 64 with alpha; 8-bit images are grayscale or use a 256-colour palette. The calculator shows the size in decimal units (1 MB = 1,000,000 bytes, as drive makers count) and binary units (1 MiB = 1,048,576 bytes, which Windows labels “MB”), and the exact size of a BMP file, which adds a 54-byte header, a colour palette at 8 bits and below, and pads each row to a multiple of 4 bytes. It also gives megapixels, the aspect ratio and the print size at your DPI. Saved JPEG, PNG, WebP or AVIF files are much smaller because they compress. A photo saved as a good-quality JPEG is often 5–20 times smaller than its raw size, but the ratio depends on detail, noise and quality setting, so the JPEG figure is only a rough guide. The raw size is still the memory an app needs to hold the decoded image.
Worked example
A 1920 × 1080 true-colour image has 1,920 × 1,080 = 2,073,600 pixels. At 24 bits each that is 49,766,400 bits ÷ 8 = 6,220,800 bytes, which is 6.22 MB (5.93 MiB) uncompressed, or 2.07 megapixels with a 16:9 aspect ratio. Saved as a BMP it is 6,220,854 bytes with the header, and at 300 DPI it prints at 6.40 × 3.60 in.
Sources: Omni Calculator: Image file size calculator (640 × 480 × 24-bit example) · toolstud.io: Video and image frame size calculator (1920 × 1080 RGB 3×8 bit = 6.22 MB) · Wikipedia: BMP file format (headers, palette and 4-byte row padding)
Frequently asked questions
How do I calculate image file size?
Multiply width × height × bit depth and divide by 8 to get bytes. A 640 × 480 image at 24-bit is 307,200 pixels × 24 = 7,372,800 bits, or 921,600 bytes (921.6 KB). Divide by 1,000,000 for MB or by 1,048,576 for MiB.
Why is my JPEG much smaller than this number?
This is the raw, uncompressed size. JPEG, WebP and AVIF throw away detail the eye barely notices and PNG packs repeated data, so a 6 MB raw photo might save as a 400 KB to 1 MB JPEG. Flat graphics compress far more than noisy photos.
What bit depth should I choose?
Use 24-bit for ordinary colour photos, 32-bit for images with transparency (PNG with alpha) or CMYK print files, 8-bit for grayscale or palette graphics, 48-bit for raw-converted photos edited at 16 bits per channel, and 96 or 128-bit for floating-point HDR work.
How big is a 12 megapixel photo uncompressed?
At 24-bit, 12,000,000 pixels × 3 bytes = 36,000,000 bytes, or 36 MB (34.3 MiB). At 48-bit it is 72 MB. A camera raw file is smaller than this because it stores one 12–14 bit value per pixel before demosaicing, and is usually compressed.
Why does Windows show a smaller number of MB?
Windows divides by 1,048,576 (binary MiB) but labels the result “MB”. The 6,220,800-byte image above shows as 5.93 “MB” there and as 6.22 MB on macOS, which uses decimal units.
How large can I print this image?
Divide the pixels by the print resolution. At 300 DPI a 1920 × 1080 image prints at 6.4 × 3.6 inches; at 150 DPI, fine for posters seen from a distance, it prints at 12.8 × 7.2 inches.
Related calculators
This calculator is for educational purposes. Double-check important results before acting on them.