Skip to content
← Code Tools

File Size Estimator

Predict image output size in KB or MB from dimensions, format, and compression

Image File Size Estimator (KB/MB from Dimensions and Format)

There are good reasons to know how big an image will be before you encode it: the Core Web Vitals LCP budget on a landing page sets a ceiling on the hero image, CDN bandwidth costs scale with bytes served, and an image content management system needs to validate uploads against per-asset caps. This tool gives a fast estimate from three inputs that are usually known up front (pixel dimensions, target format, target quality), based on bits-per-pixel rates we measured on 38 photographs at every setting the tool offers. It is meant for planning, not for replacing the actual encoder when bytes need to be exact.

Bits Per Pixel by Format

We encoded 38 photographs (landscapes, people and architecture from Wikimedia Commons, each resized to 1920 px wide) at every setting the tool offers and measured the bits per pixel. Medians: JPEG 1.13 at quality 75, 1.57 at 85 and 1.99 at 90; WebP 0.84 at quality 75 and 1.81 at 90; AVIF 0.86 at quality 60; PNG-24 11.95 (lossless). Same-number quality settings are not equivalent across formats, which is why AVIF at 60 comes out about the same size as WebP at 75. The tool multiplies the median by width times height for the estimate, and uses the 10th and 90th percentile for the typical range.

Why It Is an Estimate, Not an Exact Number

The real encoder output depends on the actual content. A photo of a busy outdoor scene with lots of detail will encode larger than a photo of a uniform blue sky at the same dimensions and quality setting. A graphic with hard edges and flat colors will encode smaller as PNG than as JPEG. The spread is wide even among ordinary photos: at JPEG quality 85 the middle 80 percent of our test set ran from 0.92 to 2.06 bits per pixel, a factor of more than two. That is why the tool shows a range next to the median rather than a single confident number. Busy, detailed scenes land near the top of the range and smooth skies or studio backgrounds near the bottom; flat graphics, text and line art can fall outside it entirely. Use the tool for budgeting and the real encoder for the final bytes.

Planning an LCP Budget

The most common reason to estimate image size up front is to fit within the Core Web Vitals LCP (Largest Contentful Paint) budget on a landing page. A hero image at 1920x1080 in JPEG quality 85 comes to 1920 × 1080 × 1.57 / 8 = about 397KB at the median (233 to 521KB across the typical range), which is heavy for a fast LCP on a mid-range mobile connection. Switching the same image to WebP at quality 75 drops the median estimate to about 213KB. AVIF at quality 60 lands at about 218KB, so to get a real saving from AVIF you need a lower quality number (AVIF at 50 is about 139KB). The tool lets you compare all four format-quality combinations side by side, which is the right framing for the LCP-budget decision.

CDN Bandwidth and Image Cap Planning

For CDN cost projection at a given monthly impression count, the per-image average size times the impression count times the cost-per-gigabyte gives a rough bandwidth bill. The tool helps in the format-selection step: a switch from JPEG quality 85 to WebP quality 75 across all images on a high-traffic site can cut the image bandwidth roughly in half, which is the kind of savings that pays for the engineering effort to add format negotiation to the asset pipeline. The same calculation works in the other direction for per-upload validation: if your application caps images at 1MB, the tool tells you which combinations of dimensions and quality stay under that cap and which require dimensional or quality compromises.

This tool plans the encode; Advanced Image Optimizer performs it, Image Converter handles the format switch alongside, and SVG Optimizer picks up the vector case where bits-per-pixel does not apply. Use the estimator to set the target, then use the optimizer to hit it.

Frequently Asked Questions

Is anything uploaded to a server?+
No. The tool runs a pure-math calculation in your browser. No file is ever uploaded — in fact, no file is ever needed; the inputs are just the dimensions, format, and quality you type or pick. The Network tab confirms no outbound calls during estimation.
How accurate is the estimate?+
It shows a median and a typical range measured on 38 photographs at each setting. About 8 in 10 ordinary photos fall inside the range shown; the median alone can be off by a factor of two in either direction for a given image. Flat graphics, screenshots, text and line art can fall outside the range, so encode a sample when the exact number matters.
Which formats are supported?+
JPEG (qualities 60 through 95 in 5-point steps), PNG (8-bit indexed, 24-bit lossless, with and without alpha), WebP (qualities 50 through 90 lossy, and lossless mode), and AVIF (qualities 40 through 80). These cover the four formats that dominate modern web delivery. GIF is not included because for photographic content it is never the right choice; for animated GIFs, the size depends on frame count and the static estimate is not useful anyway.
Does it account for image metadata (EXIF, ICC profiles)?+
It assumes metadata is stripped, which is the common posture for web-delivery images. If your pipeline preserves metadata, add an overhead of 8 to 64KB per image (depending on what is preserved) to the estimate. EXIF camera metadata is typically a few hundred bytes; ICC profiles for color-managed images can be tens of kilobytes.
Why does PNG show such a wide size range?+
PNG compresses by run-length and predicted-pixel encoding, so the output size is highly content-dependent. PNG is lossless, so the output size depends entirely on the content. In our 38-photo test, PNG-24 photos came in between about 9 and 15 bits per pixel (median 12); a flat-color graphic can be well under 1 bit per pixel. The tool’s range is for photographs; for graphics-heavy content the actual encoder is the only reliable answer.
How does WebP compare to JPEG at the same quality number?+
At the same quality number, WebP came out smaller than JPEG in our test, but by how much depends on the number: 26 percent smaller at quality 75 (0.84 vs 1.13 bits per pixel) and only 9 percent at quality 90 (1.81 vs 1.99). Quality numbers are each encoder’s own scale, not a shared measure of visual quality, so compare formats by looking at the output, not by matching numbers.
Can I estimate the size of an animated WebP or animated AVIF?+
Not directly. The static estimate is per-frame, so an animation is roughly frame-count times the per-frame estimate, with a small reduction (10 to 20%) for inter-frame compression when the frames share content. For accurate animated estimates, encode a representative short clip and scale up.
Does the tool tell me whether the image will be "good enough"?+
No — perceptual quality is a separate question from bytes. The estimate is for the byte budget; the visual-quality decision is made by previewing the actual encoder output. Use the tool to narrow the format-quality combinations to a small set that fits the byte budget, then encode and inspect to pick the winner on visual quality.

Built by Derek Giordano · Part of Ultimate Design Tools

Privacy Policy · Terms of Service