ThisCalculator

Technology

Bitmap File Size Calculator: How to Estimate

Updated · Standard formula, shown below

Raw data size 6,220,800 bytes
Total file size
6,220,854 bytes
Result
Total size (KB)
6,075.05 KB
Result
Total size (MB)
5.93 MB
Result

Bitmap File Size Calculator: How to Estimate

This calculator estimates the uncompressed file size of a bitmap image in bytes, kilobytes, and megabytes. You enter the image width and height in pixels, the color depth in bits per pixel, and optionally a file header size; the calculator returns the raw data size and the total file size. It uses the standard formula: file size = (width × height × bit depth) / 8, plus any header bytes.

Formula

The core formula for an uncompressed bitmap is:

File size (bytes) = (width × height × bits per pixel) / 8 + header size

  • Width – image width in pixels (px)
  • Height – image height in pixels (px)
  • Bits per pixel (bpp) – color depth: 1 (monochrome), 8 (256 colors), 24 (true color), 32 (true color with alpha)
  • Header size – bytes used by the file format (e.g., 54 bytes for a typical BMP header, 0 for raw data)

Division by 8 converts bits to bytes. The result is the uncompressed size; compressed formats like PNG or JPEG will be smaller.

Worked Example

Using the default values: width = 1920 px, height = 1080 px, bit depth = 24 bpp, header = 54 bytes.

  1. Total bits = 1920 × 1080 × 24 = 49,766,400 bits
  2. Raw data bytes = 49,766,400 / 8 = 6,220,800 bytes
  3. Total file size = 6,220,800 + 54 = 6,220,854 bytes
  4. In kilobytes: 6,220,854 / 1024 ≈ 6075.05 KB
  5. In megabytes: 6,220,854 / (1024 × 1024) ≈ 5.93 MB

The calculator shows the same: raw data 6,220,800 bytes, total 6,220,854 bytes, 6075.05 KB, 5.93 MB.

Why Bitmap Size Matters

Uncompressed bitmaps are used in contexts where every pixel must be preserved exactly: medical imaging, scientific analysis, archival scans, and certain graphic design workflows. Knowing the file size helps you plan storage, estimate transfer times, and decide whether compression is needed. For example, a single 24-bit 1920×1080 image takes about 6 MB uncompressed; a 10-second video at 30 frames per second would be 180 frames × 6 MB = 1.08 GB before any compression.

How Bit Depth Affects Size

Bit depth determines how many bits store each pixel’s color. Common depths:

  • 1 bpp – black and white (2 colors). A 1920×1080 image = 2,073,600 bits = 259,200 bytes.
  • 8 bpp – 256 colors (indexed). Same image = 2,073,600 bytes ≈ 1.98 MB.
  • 24 bpp – true color (16.7 million colors). = 6,220,800 bytes ≈ 5.93 MB.
  • 32 bpp – true color with alpha channel. = 8,294,400 bytes ≈ 7.91 MB.

Doubling the bit depth doubles the size. This is why 32-bit images are about 33% larger than 24-bit images of the same dimensions.

Common Mistakes and Misconceptions

One frequent error is mixing up bits and bytes. A 24-bit image is not 24 bytes per pixel; it is 3 bytes per pixel. Another mistake is forgetting the header or metadata. While a BMP header is typically 54 bytes, other formats like TIFF can have headers of hundreds of bytes. Also, many people assume the calculator gives the size of a compressed file – it does not. JPEG, PNG, and GIF use compression, so their actual sizes are usually much smaller and depend on image content. For example, a solid blue 1920×1080 PNG might be only a few kilobytes, while a noisy photo could be several megabytes.

How to Use the Calculator Correctly

Enter the exact pixel dimensions of your image. If you have a bitmap file (like .BMP), you can find the width and height in the image properties. For a raw sensor or framebuffer, use the sensor’s active pixel count. Choose the bit depth that matches your data: 8 for grayscale, 24 for RGB, 32 for RGBA. If you are calculating for a specific file format, include its header size; otherwise, set header to 0 for raw data. The result is the minimum size – actual files may be slightly larger due to padding or extended metadata.

Limits of the Formula

This formula works only for uncompressed raster images. It does not apply to vector graphics (SVG, EPS) or to compressed formats (JPEG, PNG, WebP). For compressed files, size depends on image complexity and compression settings, so no simple formula can predict it. Also, some formats add row padding (e.g., BMP rows are padded to multiples of 4 bytes). For a 1-bit or 8-bit image, the padding can slightly increase the size. The calculator ignores row padding, but the error is usually small for typical images.

Frequently Asked Questions

How do I convert the result to megabytes?

Divide the byte count by 1,048,576 (1024 × 1024). Some use 1,000,000 for marketing purposes, but storage and memory use binary multiples. The calculator uses 1024-based KB and MB, which is standard in operating systems.

Why is my BMP file larger than this calculator says?

BMP files often include extra metadata, color profiles, or row padding. The header can be larger than 54 bytes, and rows are aligned to 4-byte boundaries. Also, if you have an indexed color image, the palette (up to 1024 bytes for 256 colors) adds to the size.

Does this work for PNG or JPEG?

No. PNG and JPEG use lossless or lossy compression, so their sizes depend on the image content and compression settings. The formula only applies to uncompressed formats like BMP, raw, or uncompressed TIFF.

What is the file size of a 4K image at 24 bpp?

A 4K image is typically 3840×2160 pixels. Using the formula: 3840 × 2160 × 24 / 8 = 24,883,200 bytes ≈ 23.7 MB. That is the uncompressed size; a compressed JPEG would be much smaller.

How many images can fit on a 32 GB SD card?

Assuming 24-bit 1920×1080 images (about 6 MB each), 32 GB (about 33,554,432 KB) divided by 6 MB ≈ 5,592 images. But if you use 12 MP photos at 24 bpp, each is about 36 MB, so only about 930 images fit.

Is a higher bit depth always better?

Higher bit depth preserves more color information, but it increases file size and may not be visible on displays that support only 8 bits per channel. For final delivery to web, 24 bpp is standard; 32 bpp is used when transparency is needed.

Related

Formula used
in w | Width | px | 1920 | 1
in h | Height | px | 1080 | 1
in bpp | Bits per pixel | bits | 24 | 1
in hdr | Header size | bytes | 54 | 0
out bytes | Raw data size | bytes | (w * h * bpp) / 8 | 0
out total | Total file size | bytes | ((w * h * bpp) / 8) + hdr | 0
out kb | Total size (KB) | KB | (((w * h * bpp) / 8) + hdr) / 1024 | 2
out mb | Total size (MB) | MB | (((w * h * bpp) / 8) + hdr) / (1024 * 1024) | 2

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.