MP

Image File Size Calculator

The uncompressed size of an image from its width, height and bit depth (greyscale, RGB, RGBA, 16 bits a channel), its megapixels, and how much a saved JPEG, PNG or other file is compressed.

Technology & ComputingRuns in your browser

Result…

px
px

Bits for one pixel, all channels together. A normal photo is 24-bit; a transparent PNG is 32-bit; a 16-bit TIFF from a raw converter is 48-bit.

Several images of the same size, such as the frames of an animation or a batch of photos.

The size of the saved file, to work out its compression ratio. Leave it empty or 0 to skip.

Saved size in

kB and MB are decimal (10³ and 10⁶ bytes); KiB and MiB are binary (2¹⁰ and 2²⁰ bytes).

 

…

How it's calculated

Pixels = width × height; megapixels = pixels ÷ 1,000,000
Uncompressed size (bytes) = width × height × bits per pixel ÷ 8 × number of images
Compression ratio = uncompressed size ÷ saved file size

A bitmap image stores a value for every pixel, so its raw size is the pixel count times the bits each pixel needs, divided by 8 for bytes. Greyscale uses 8 bits a pixel, RGB colour 24 (8 bits for each of red, green and blue), RGB with a transparency (alpha) channel 32, and 16-bit-a-channel editing files 48 or 64. A 24-megapixel photo is therefore 72 MB uncompressed, which is the memory an editor needs for one layer. Comparing that with the saved file gives the compression ratio: a high ratio means the format (often JPEG) has thrown away or packed a lot of data. MB is 10⁶ bytes and MiB is 2²⁰ bytes.

Your numbers, step by step

    About the Image File Size calculator

    This image file size calculator works out how many bytes the pixels of an image take before any compression. Enter the width and height in pixels and the bit depth, from 1-bit black and white through 8-bit greyscale, 24-bit RGB and 32-bit RGBA to 48-bit and 64-bit files with 16 bits a channel, and it multiplies width × height × bits per pixel and divides by 8. You also get the megapixel count. Add the size of the saved JPEG, PNG, WebP or HEIC file and it gives the compression ratio, so you can see how much the format packed away. Photographers, web developers, game artists and anyone planning memory or storage use it to estimate editing memory, uncompressed TIFF sizes and batch storage. Results come in decimal MB and binary MiB, and the working is shown with your own numbers.

    How to use it

    1. Enter the “Width” and “Height” in pixels.
    2. Pick the “Bit depth per pixel”: 24-bit for a normal colour photo, 32-bit for an image with transparency, 48-bit for a 16-bit-a-channel edit.
    3. Set the “Number of images” for a batch or animation frames of the same size.
    4. Optionally enter the “Saved file size” and choose whether it is in kB, MB, KiB or MiB.
    5. Read the uncompressed size, the megapixels and, if you gave a saved size, the compression ratio.

    Worked example

    A 4,032 × 3,024 phone photo has 12,192,768 pixels, about 12.19 megapixels. In 24-bit RGB that is 12,192,768 × 24 ÷ 8 = 36,578,304 bytes: 36.58 MB, or about 34.88 MiB. Saved as a 3.2 MB JPEG, the compression ratio is 36,578,304 ÷ 3,200,000 ≈ 11.43 : 1, so the file is about 8.75% of the raw pixels. The same photo edited at 48-bit takes 73.16 MB uncompressed.

    Updated

    Questions people ask

    How do I calculate an image's file size from its resolution?

    Multiply the width by the height to get the pixel count, multiply by the bits per pixel and divide by 8 for bytes. A 1,920 × 1,080 image in 32-bit RGBA is 1,920 × 1,080 × 32 ÷ 8 = 8,294,400 bytes, about 8.29 MB.

    How many bits per pixel does an RGB image use?

    Standard RGB stores 8 bits for each of red, green and blue, so 24 bits a pixel; adding an alpha (transparency) channel makes 32. Files edited at 16 bits a channel use 48 bits for RGB and 64 for RGBA, and greyscale uses 8 or 16.

    What does a compression ratio of 10 : 1 mean?

    The saved file is a tenth of the size of the raw pixels, 10% of the uncompressed bytes. JPEG can reach high ratios because it discards detail, while PNG is lossless and usually compresses photos much less.

    Why is my JPEG not the size the calculator shows?

    The calculator gives the raw pixel data, which is what an image takes in memory or in an uncompressed TIFF or BMP. A JPEG, PNG, WebP or HEIC file is compressed by an amount that depends on the picture and the quality setting, so enter its real size to see the ratio.

    Does the result apply to camera raw files and prints?

    Not directly. Raw files store one value per pixel at 12 or 14 bits before the colours are worked out, plus their own compression, so they do not follow the RGB figures. To see how large an image will print at a given DPI, use the print size calculator, and to convert units, the data storage converter.

    More in Technology & Computing