Image File Size Estimator
Estimate how big a JPEG, PNG, WebP, AVIF or HEIC image will be from its pixel dimensions and quality setting, before you actually encode anything. Useful for budgeting page weight, planning bulk uploads, or deciding which format is worth the trouble.
Explain like I'm 5 (what even is this calculator?)
Tell it the width, the height, the format and how aggressively you want to compress, and it works out roughly how many kilobytes the saved file will be. It uses the same rough rules of thumb a camera firmware engineer or a CDN capacity planner would: pixels times a per-format coefficient that depends on the encoder. It is an estimate within about 30 percent of reality, not a precise prediction.
Estimate a file size
Browser-only. Nothing is uploaded. Numbers are computed locally from per-format heuristics.
Estimated file size
—
All five formats at the same dimensions and quality
Prove it
Enter dimensions, a format and a quality to see the working.
Useful? Save this calculator: press Ctrl + D to bookmark it.
When to use this
Three situations come up regularly. The first is page-weight budgeting: a designer hands you a 4000 by 3000 hero image and asks whether it will fit inside a 200 KB performance budget. Punch the dimensions in, pick the format and quality you would ship, and you have an answer in a couple of seconds without round-tripping through Photoshop. The second is bulk planning: a thousand product photos at 1500 by 1500, JPEG quality 80, gives you a rough storage and CDN egress figure to put in a quote. The third is deciding which format is worth the engineering pain. The comparison table tells you whether dropping JPEG for AVIF saves you 60 percent or 6 percent for the kind of images you serve.
Common mistakes
The biggest mistake is treating the number as exact. Two photos at 1920 by 1080, both JPEG quality 85, can comfortably differ by a factor of two: a clean studio shot of a single subject compresses much smaller than a forest canopy where every pixel is different. The estimator gives a sensible middle, the variance band is real, and a photo with a lot of fine detail will sit at the upper edge of it.
The second mistake is forgetting that PNG quality is not a quality at all. The deflate level changes how long the encoder spends searching for a shorter representation, not what comes out the other end. The output is always lossless. What actually changes the size is whether the source is a photo or a flat graphic, which is why this estimator asks about content rather than quality for PNG.
The third mistake is comparing formats at the same numeric quality and concluding one is better. Quality scales are not portable across encoders. JPEG quality 85 in libjpeg-turbo, WebP quality 85 in libwebp, and AVIF quality 85 in libaom encode to different visual qualities. The right comparison is by visual result on the actual content, with file size as the secondary axis. Use the comparison table here to get a rough order-of-magnitude feel, then encode a real test image when the decision matters.
Edge cases
For very small images (favicons, sprite tiles, anything under 100 by 100), fixed-cost overhead in the file format starts to dominate the size. A 32 by 32 PNG might be 200 bytes; the estimate based on raw pixel count is roughly right but the floor is set by the file header, not the data. For very large images (8K stills, panoramas) the estimate stays linear in pixel count, which matches reality reasonably well: more pixels means proportionally more bytes, give or take entropy.
Animated formats are out of scope here. APNG, animated WebP and animated AVIF all multiply the per-frame size by the frame count and add a small inter-frame compression saving. If you are working with animation, estimate one frame and multiply by frame count, then knock 20 percent off as a rough inter-frame compression discount.
Related calculators
File size is one number. These act on the file or the pipe it travels down.
Frequently asked questions
Why is this only an estimate?
Final file size depends on the entropy of the actual pixels, the encoder, the quality scale used, chroma subsampling settings and a dozen smaller knobs. Two photos at the same resolution and the same nominal quality can differ by 30 percent or more. The numbers here are calibrated against typical cameras and encoders, but treat them as a planning figure with a plus or minus 30 percent band, not a guarantee.
Why does PNG have a content toggle instead of a quality slider?
PNG is lossless. The compression knob (deflate level 0, 6 or 9) only changes how hard the encoder works to find a smaller representation, not the visible result. What actually drives PNG file size is the content. A photograph compresses poorly because every pixel is slightly different. A flat UI graphic, logo, or screenshot full of solid colour compresses brilliantly. The toggle picks the right deflate ratio for the kind of image you have.
Why is AVIF roughly half the size of JPEG at the same quality?
AVIF uses the AV1 video codec's intra-frame coding, which is more than 20 years more recent than JPEG. It supports better prediction, larger transform blocks, and modern entropy coding. Across a typical photo set, AVIF lands at roughly 0.45 of the JPEG size at visually matching quality. The trade-off is encoding time: AVIF is much slower to produce, which is why it has not displaced JPEG for camera output yet.
Should I use WebP or AVIF for the web?
Both have effectively universal browser support in 2026. AVIF gives you smaller files at the same visible quality, but encoders are slower and the decoder is heavier on low-end phones. WebP encodes faster, decodes lighter, and is still meaningfully smaller than JPEG. For a media-heavy site, ship AVIF with WebP as a fallback via the picture element. For a small site where build speed matters, WebP alone is the pragmatic choice.
What about HEIC, the iPhone format?
HEIC is Apple's container for HEVC-encoded stills. It is a touch larger than AVIF and a touch smaller than WebP at matching quality. It is excellent on Apple devices and useless on the open web because no major browser decodes it natively. If you are sharing photos beyond the Apple ecosystem, convert HEIC to JPEG, WebP or AVIF first.