Technology

JPG Quality vs File Size Calculator

Calculator Free · Private
Was this calculator helpful?

The JPG Quality vs File Size Calculator estimates the resulting file size of a JPEG image based on its resolution (in megapixels) and the chosen quality setting (1–100). JPEG compression uses a Discrete Cosine Transform (DCT) algorithm that discards high-frequency visual data — the lower the quality, the more data is thrown away and the smaller the file. A 2 MP image at 85% quality produces roughly 300 KB, while the same image at 100% quality can reach 2–3 MB. Use this tool when optimizing images for web performance, email attachments, app assets, or storage budgets.

Last reviewed: May 12, 2026 Verified by Hacé Cuentas Team Source: Wikipedia – JPEG (Compression artifacts & quality settings), NIST – Image Quality Assessment Methods 100% private

When to use this calculator

  • Choosing the optimal JPEG quality setting before uploading product photos to an e-commerce site so pages load under Google's 200 KB per-image recommendation.
  • Estimating how many vacation photos (each ~12 MP) will fit on a 32 GB SD card at different quality levels before a trip.
  • Deciding whether to export a 24 MP DSLR portrait at Q=75 or Q=90 to stay within a 1 MB email attachment limit.
  • Benchmarking file-size trade-offs for a news website's hero images to hit Core Web Vitals LCP targets under 2.5 seconds on a 4G connection.

Example Calculation

  1. 2MP, 85%
  2. ~300 KB
Result: ~300 KB

How it works

3 min read

How It's Calculated

JPEG file size depends on three factors: pixel count, color depth, and the DCT quantization table selected by the quality setting. The practical estimation formula is:

Raw Bytes  = Megapixels × 1,000,000 × 3        (3 bytes/pixel for 8-bit RGB)
JPEG Bytes = Raw Bytes / Compression_Ratio(Q)
KB         = JPEG Bytes / 1024

Typical compression ratios by quality level (empirically measured across thousands of natural photos):

Quality (Q)Compression RatioRelative Visual LossTypical Use Case
95–1002:1 – 4:1ImperceptibleArchival, print pre-press
85–9410:1 – 15:1None to very slightHigh-quality web, portfolios
75–8415:1 – 25:1Slight on close-upGeneral web, blog images
60–7425:1 – 40:1Noticeable artifactsThumbnails, social previews
40–5940:1 – 60:1Visible blockingLow-bandwidth delivery
1–3960:1+Severe degradationPlaceholder / blur previews

> Note: Compression ratio varies with image content — sky and flat areas compress far better than complex textures (foliage, fabric). The ratios above assume natural photographic content.

---

Reference Table

File size estimates for common resolutions (natural-photo content):

MegapixelsResolution ExampleQ=100Q=90Q=85Q=75Q=60
0.3 MP640 × 480~270 KB~60 KB~45 KB~30 KB~18 KB
2 MP1920 × 1080 (FHD)~1.8 MB~400 KB~300 KB~180 KB~110 KB
8 MP3264 × 2448~7 MB~1.6 MB~1.2 MB~700 KB~420 KB
12 MP4000 × 3000~10 MB~2.4 MB~1.8 MB~1.1 MB~650 KB
24 MP6000 × 4000~20 MB~4.8 MB~3.6 MB~2.1 MB~1.3 MB
50 MP8688 × 5792~42 MB~10 MB~7.5 MB~4.4 MB~2.6 MB

---

Typical Cases

Case 1 — E-commerce product photo (2 MP, Q=85)
A 1920×1080 image has 2,073,600 pixels × 3 bytes = ~5.9 MB raw. At Q=85 (ratio ~15:1): 5.9 MB / 15 ≈ 393 KB, real-world output is ~300–400 KB after encoder overhead. This is within Google PageSpeed's recommended budget per image for hero assets.

Case 2 — Smartphone photo for Instagram (12 MP, Q=75)
A 12 MP phone shot at Q=75 (ratio ~20:1): 12M × 3 bytes / 20 / 1024 / 1024 ≈ 1.7 MB. Instagram recompresses uploads to ~85 KB–500 KB internally, so uploading at Q=75 saves bandwidth without double-compression penalty.

Case 3 — Archival scan of a document (8 MP, Q=95)
At Q=95 (ratio ~4:1): 8M × 3 / 4 / 1024 / 1024 ≈ 5.7 MB. For archival or OCR purposes, Q=90–95 is the industry standard to preserve fine text details.

---

Common Mistakes

1. Using Q=100 for all web images. Q=100 produces files 5–10× larger than Q=85 with differences imperceptible at screen resolution (72–96 PPI). Browsers can't display the extra fidelity.
2. Confusing "quality" scales across software. Photoshop's Q=8 (0–12 scale) ≈ Lightroom's 80% ≈ libjpeg's Q=80. Always check what scale your tool uses before comparing sizes.
3. Ignoring image content type. The JPEG algorithm performs poorly on flat-color graphics, text, and illustrations — PNG or WebP will be 60–80% smaller for those. JPEG excels on continuous-tone photography.
4. Re-saving JPEGs multiple times. Each save at any quality below 100 applies lossy compression again. A Q=80 image saved again at Q=80 is NOT the same as one save — artifacts accumulate multiplicatively.
5. Assuming megapixels = file size linearly. A 24 MP photo in a solid blue room compresses to under 500 KB at Q=85, while a 12 MP shot of a forest at the same quality may be 2 MB — content entropy is the dominant variable.

---

Related Calculators

  • Aspect Ratio Calculator

  • Screen Resolution Calculator

  • Data Storage Unit Converter

  • Internet Speed & Download Time Calculator

  • Frequently asked questions

    What JPEG quality should I use for website images?

    For most web use cases, Q=75–85 (on a 0–100 scale) is the industry sweet spot. Google's WebP benchmarks and Mozilla's SSIM studies both show that quality below 85 saves 30–50% in file size with no perceptible visual degradation at typical screen resolutions (96 PPI). For hero images, target under 200 KB; for thumbnails, under 30 KB.

    How does megapixel count affect JPEG file size?

    File size scales roughly linearly with pixel count. Doubling resolution (e.g., 2 MP → 4 MP) doubles raw data and doubles the compressed output at the same quality setting. A 12 MP photo at Q=85 is approximately 6× larger than a 2 MP photo at the same quality, because 12/2 = 6× the pixels.

    Is JPEG compression lossy? Can I recover the original?

    Yes — JPEG is inherently lossy. Once compressed, the discarded DCT coefficients cannot be reconstructed. NIST and image forensics literature confirm that any quality setting below 100 permanently removes data. For lossless storage use PNG, TIFF, or WebP Lossless. JPEG at Q=100 is still technically lossy, just minimally so.

    What is the difference between Q=85 in Photoshop vs. libjpeg?

    Photoshop uses a proprietary quality scale (0–12) mapped internally to quantization tables, while libjpeg (used in most open-source tools) uses a 0–100 scale. Photoshop's 'Quality 10' (0–12) roughly corresponds to libjpeg Q=85, and Photoshop's 'Quality 12' is approximately libjpeg Q=97. Always verify output file size directly; quality numbers are not interoperable.

    Why is my JPEG sometimes larger after re-saving at the same quality?

    Re-saving a JPEG decodes it to raw pixels, then re-encodes. Decoder rounding errors introduce tiny pixel-value changes that the encoder treats as new high-frequency data. Studies show a 5–15% size increase per re-save cycle even at identical quality settings, plus cumulative visual artifact buildup. Always edit from a lossless master (RAW or PNG).

    Does JPEG quality affect color accuracy?

    Yes. JPEG compression typically works in YCbCr color space and often applies 4:2:0 chroma subsampling (halving color resolution) at quality settings below ~90 in most encoders. This can cause color fringing on red text or saturated edges. At Q≥90, most encoders switch to 4:4:4 chroma, preserving full color data. For accurate color reproduction, use Q≥90 or PNG.

    How does WebP compare to JPEG in file size at equivalent quality?

    According to Google's own 2010 WebP study (updated in subsequent releases), WebP achieves 25–34% smaller file sizes than JPEG at equivalent SSIM quality scores. For a 2 MP image that produces 300 KB at JPEG Q=85, a WebP equivalent would be approximately 200–225 KB. All major browsers as of 2024 support WebP natively.

    What quality level is used by default in smartphones and social media?

    Most Android and iOS cameras capture JPEGs at Q=92–96. Instagram re-encodes uploads to approximately Q=85 and caps resolution at 1080px on the long edge. Twitter/X compresses to approximately Q=85 at up to 2048px. Facebook uses Q=85 with progressive encoding. Understanding these pipelines helps you pre-optimize uploads to avoid double-compression quality loss.

    Sources and references