What decides an image file size?
Three things decide how big an image file is: how many pixels it has, how many bytes each pixel needs, and how much compression the format applies. A 4000 by 3000 photo has 12 million pixels. In RGB colour each pixel needs 3 bytes, so the raw image is 36 million bytes, or about 34 megabytes. Nothing stores photos raw, so the format matters most.
JPEG throws away detail your eyes barely notice, and at quality 80 it keeps about 8 percent of the raw size. PNG keeps every pixel exactly, so it is bigger, but it is the right choice for logos and text. WebP is a modern format that beats JPEG at the same quality. This calculator applies those typical factors to your numbers.
How to use the calculator
Enter the width and height in pixels. You can find these in your photo app or by right-clicking the file and checking its details. Then pick the colour mode: RGB for normal colour photos, RGBA if the image has transparency, and grayscale for black and white.
Pick the format and a quality number from 1 to 100. Quality only affects JPEG and WebP; PNG and GIF ignore it. The tool shows the estimated file size, the raw uncompressed size, and what share of the raw size the compression keeps.
Worked example: a 4000 by 3000 photo as JPEG quality 80
A photo of 4000 by 3000 pixels in RGB has 12,000,000 pixels times 3 bytes, which is 36,000,000 bytes uncompressed. As a JPEG at quality 80, the tool applies a factor of 0.08, giving 2,880,000 bytes, or about 2.75 megabytes. That is a normal size for a phone photo.
Save the same photo as PNG and the factor is 0.5, so the estimate is 18,000,000 bytes, or about 17 megabytes. As WebP at quality 80 the factor is about 0.067, giving 2,400,000 bytes, or about 2.29 megabytes. The same pixels, three very different file sizes, which is why format choice matters.
How to make images smaller for the web
The fastest win is fewer pixels. A photo shown at 800 pixels wide does not need to be 4000 pixels wide, and shrinking it cuts the file by 25 times. Resize first, then pick the format. Use JPEG for photos, PNG only for graphics with sharp edges or transparency, and WebP when your site supports it.
Quality 80 is a good default for JPEG photos. Below 60, blocky artefacts appear in skies and skin. Above 90, the file grows fast for almost no visible gain. For PNG graphics, run them through a PNG optimiser, since plain PNG files are often twice as big as they need to be.
Limits of this calculator
These are estimates from typical compression factors. A busy photo full of leaves and texture compresses worse than a plain sky, so two photos with the same pixels can differ by half. The tool also cannot see your image, so it cannot know how detailed it is. Treat the number as a planning guide, not an exact size.
Real files also carry metadata, like camera settings and thumbnails, which add a few kilobytes. And some apps save JPEGs with their own quality tables, so the same quality number can mean different sizes in different apps.
Frequently asked questions
How big is a 12 megapixel photo as JPEG? About 2.75 megabytes at quality 80. The same photo as PNG is about 17 megabytes.
Is WebP smaller than JPEG? Usually yes, by about 15 to 25 percent at the same quality. Most modern browsers support it.
Why is my PNG so big? PNG is lossless, so it keeps every pixel. A photo saved as PNG is often 5 to 10 times bigger than the same photo as JPEG.
Does quality 100 mean no compression? No. JPEG quality 100 still compresses, but gently. Only PNG and other lossless formats keep every pixel exactly.
También disponible en español: Calculadora de tamaño de archivo de imagen.
