How to use the image file size calculator
- Enter the image width and height in pixels, or use a preset such as 1920 x 1080.
- Choose the bits per pixel. 24 bit means 8 bits for each of red, green and blue, and 32 bit adds an 8 bit transparency channel.
- Enter the number of frames for an animation or for a batch of images of the same size.
- Open the advanced options to enter a compression ratio, such as 10, to see an example of the saved size. Read the exact bytes and the size in KiB or MiB.
Formula
pixels = width x height
bytes = pixels x bits per pixel / 8 x frames
1 KiB = 1,024 bytes, 1 MiB = 1,024 KiB
saved size = raw size / compression ratio
The page also shows a decimal figure in megabytes (1 MB = 1,000,000 bytes). Most operating systems show file sizes in KiB, MiB and GiB, which divide by 1,024 but are usually labeled KB, MB and GB.
A 12 megapixel photo
A photo of 4,000 x 3,000 pixels has 12,000,000 pixels. At 24 bits (3 bytes) per pixel the raw size is 36,000,000 bytes, which is 34.33 MiB or 36 MB in decimal units.
A 1,920 x 1,080 image with 32 bits per pixel is 2,073,600 pixels and 8,294,400 bytes, or 7.91 MiB. At an example compression ratio of 10 to 1 it would be 829,440 bytes, which is 810 KiB. One hundred 1,920 x 1,080 RGB frames take 593.26 MiB raw.
Raw size and file size are different
The raw size is how much memory the pixels take once an image is open. A saved file is almost always smaller because formats such as JPG, PNG and WebP compress the data, by an amount that depends on the picture. Flat colors and screenshots compress a lot, while noisy photos compress less.
Because of that, the compression ratio box is only an example you set. To see what your own image comes to, try the image compressor.
Related image tools
To work out how big an image can print at a given quality, use the print size and DPI calculator. To change the dimensions, use the image resizer. For the size of audio and video files, use the media file size calculator.
Assumptions and limits
- The size is for uncompressed pixel data. Headers, color profiles, metadata and compression are not counted.
- Every frame is the same size and depth.
- Bits per pixel is taken from the list you choose. Paletted and special formats may differ.
- The compression ratio is an example you enter. No format or ratio is assumed.
Frequently asked questions
How do I calculate the size of an image in megabytes?
Multiply width by height by the bytes per pixel, then divide by 1,000,000 for decimal megabytes or by 1,048,576 for mebibytes. The page shows both so you can compare with what your system reports.
Why is my saved image much smaller than this?
Saved formats compress the pixels. A JPG of a photo may be a tenth of the raw size or less, and a PNG of a screenshot can be smaller still. The raw figure is the size before compression.
What does 24 bit versus 32 bit mean?
24 bit stores 8 bits each for red, green and blue, which is 3 bytes per pixel. 32 bit adds 8 bits for transparency, which is 4 bytes per pixel.
What is the difference between MB and MiB?
A megabyte is 1,000,000 bytes and a mebibyte is 1,048,576. Many programs show MiB but label it MB, which is why two tools can give slightly different numbers for the same file.