PNG vs JPEG File Size Threshold for Web

Choosing between PNG and JPEG formats directly impacts page load speed, bandwidth usage, and visual fidelity. While PNG offers lossless compression ideal for graphics with text and sharp lines, JPEG provides lossy compression suited for complex imagery. This article outlines the specific file size thresholds and visual criteria that justify replacing a static PNG graphic with a web JPEG to optimize website performance.

The 100 KB File Size Benchmark

For general web performance, a file size threshold of 100 KB is the standard benchmark where converting a PNG to a JPEG becomes necessary. When an uncompressed or high-color PNG exceeds 100 KB to 150 KB, switching to a well-compressed JPEG (typically between 75% and 85% quality) often reduces the file size by 50% to 80% without perceptible visual loss.

If converting a PNG to a JPEG saves less than 10 KB to 20 KB, the switch is rarely worth the loss in compression fidelity. However, if the savings exceed 30% of the total asset weight—or roughly 40 KB to 50 KB on a single asset—converting to JPEG is justified to improve Core Web Vitals, specifically Largest Contentful Paint (LCP).

Image Characteristics That Dictate the Switch

File size alone does not dictate format selection; the visual structure of the graphic determines whether JPEG compression is appropriate:

When to Retain PNG Regardless of File Size

There are two primary conditions where a PNG should not be converted to a JPEG, regardless of the size threshold:

  1. Alpha Transparency: JPEG does not support transparency. If a graphic requires a transparent or semi-transparent background to sit over varying design elements, it must remain a PNG (or be converted to a modern format like WebP).
  2. Fine Line Work and UI Text: When an image contains critical small text or fine diagrams, JPEG's discrete cosine transform (DCT) compression introduces noticeable artifacts, making text blurry and difficult to read. In these cases, optimizing the PNG using tools like palette quantization (PNG-8) is preferable to switching to JPEG.