Calculate image file size in MB from pixel width and height and the color depth, with common resolution presets and estimated JPEG sizes.
- All Unit Converters
- Video File Size Calculator
- Megapixel Calculator
- Bits Per Pixel Calculator
- DPI To File Size Calculator
- Resolution Calculator
- Pixel Resize Calculator
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.
| Function | Use it when | You enter |
|---|---|---|
| Image file size from pixels | You know an image’s width and height in pixels and want its size in MB | Width 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
MB = B ÷ 1,000,000 [3]
| B | Size of the pixel data in bytes, rounded up to a whole byte |
| W | Image width in pixels |
| H | Image height in pixels |
| b | Bits per pixel. A color image with 8-bit red, green and blue samples uses 24, and 32 with an alpha sample [4] |
| MB | Megabytes. 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
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 pixel | Picture quality | 1920 × 1080 image |
|---|---|---|
| 1.5 to 2 | Usually indistinguishable from the original | 388.8 to 518.4 KB |
| 0.75 to 1.5 | Excellent | 194.4 to 388.8 KB |
| 0.5 to 0.75 | Good to very good | 129.6 to 194.4 KB |
| 0.25 to 0.5 | Moderate to good | 64.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
- 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
- Microsoft Learn, BITMAPINFOHEADER structure: bits per pixel and row padding in an uncompressed bitmap
- NIST, Prefixes for binary multiples: megabyte and mebibyte in bytes
- W3C, Portable Network Graphics (PNG) Specification (Third Edition): samples per pixel and bit depths by color type
