Calculate image file size in MB from pixel width and height and the color depth, with common resolution presets and estimated JPEG sizes.

The bits stored for each pixel. Most photos and screenshots are 24-bit color.

Compression (optional)
Enter 10 for 10:1 to see the size after compression. Blank skips it.

Calculator Functions

The calculator converts an image’s pixel dimensions to its uncompressed file size in KB, MB or GB, with the exact byte count, the size in binary units and the megapixels. For 24-bit color it also estimates the size of the same picture saved as a JPEG.

FunctionUse it whenYou enter
Image file size from pixelsYou know an image’s width and height in pixels and want its size in MBWidth and height in pixels, or a common size from the list

The color depth starts at 24-bit color, which suits most photos and screenshots, and can be changed to 32-bit, 48-bit, grayscale, 1-bit or any number of bits per pixel. An optional compression ratio shows the size after compression. For video, use the Video File Size Calculator.

Image File Size Formulas

B = W × H × b ÷ 8
MB = B ÷ 1,000,000 [3]
BSize of the pixel data in bytes, rounded up to a whole byte
WImage width in pixels
HImage height in pixels
bBits per pixel. A color image with 8-bit red, green and blue samples uses 24, and 32 with an alpha sample [4]
MBMegabytes. One megabyte is 1,000,000 bytes and one mebibyte (MiB) is 1,048,576 bytes [3]

A 1920 × 1080 image at 24 bits per pixel holds 1920 × 1080 × 24 ÷ 8 = 6,220,800 bytes, which is 6.22 MB or 5.93 MiB. With a compression ratio r, the compressed size is B ÷ r.

JPEG size estimate

BJPEG ≈ W × H × q ÷ 8 [1]

q is the number of compressed bits per pixel. The JPEG standard’s author gives these typical levels for color images with moderately complex scenes [1], and the calculator shows the file size range for each one.

Compressed bits per pixelPicture quality1920 × 1080 image
1.5 to 2Usually indistinguishable from the original388.8 to 518.4 KB
0.75 to 1.5Excellent194.4 to 388.8 KB
0.5 to 0.75Good to very good129.6 to 194.4 KB
0.25 to 0.5Moderate to good64.8 to 129.6 KB

Limits of This Estimate

  • The uncompressed size counts pixel data only. A real file adds a header and any metadata, and a BMP file pads each row of pixels to a multiple of 4 bytes [2], so files are slightly larger.
  • The JPEG sizes are a guideline. Quality and compression vary significantly with the picture: detailed, noisy photos compress less than smooth ones [1]. These estimates are based on the best available data and estimations.
  • Lossless formats such as PNG depend on the picture even more. Lossless coding of a color photo typically reaches about 2:1 [1], while flat graphics and screenshots shrink far more. Enter your own compression ratio to model them.
  • Sizes use 1 MB = 1,000,000 bytes. Software that counts 1,048,576 bytes to a megabyte shows a smaller number for the same file, which is the binary result [3].

Sources

  1. Gregory K. Wallace, The JPEG Still Picture Compression Standard, IEEE Transactions on Consumer Electronics: picture quality by compressed bits per pixel, and typical lossless compression
  2. Microsoft Learn, BITMAPINFOHEADER structure: bits per pixel and row padding in an uncompressed bitmap
  3. NIST, Prefixes for binary multiples: megabyte and mebibyte in bytes
  4. W3C, Portable Network Graphics (PNG) Specification (Third Edition): samples per pixel and bit depths by color type