Image lazy-loading savings calculator

Initial image indices are unique.

Your inputs

Separate numbers with commas or spaces.
Input format

Use this format with your own values:

100,200,300,400
Separate numbers with commas or spaces.
Input format

Use this format with your own values:

1,2

Use the units shown.

Initial image bytes
300
Scenario total image bytes
600
Eager-load image bytes
1,000
Scenario bytes saved
400

Your calculation
How is this calculated?

Sum sizes at the initially loaded indices.

Add the first roundUp(remaining count × scroll percentage/100) remaining images to initial bytes.

Sum all image byte sizes.

Eager-load bytes minus scenario total.

Initial image indices are unique. The scenario loads the stated fraction of remaining images in page order, rounding the number upward. It estimates transferred image bytes, not browser behavior, network time or actual user scroll patterns.

OpenStax: percentages and proportions ↗

Try an example

Worked example

Initial image bytes: 300

Inputs
  • Image byte sizes in page order: 100,200,300,400
  • Initially loaded image numbers (1-based): 1,2
  • Remaining images reached by scrolling (%): 50

Compare inputs

Initial image bytes: 10

Inputs
  • Image byte sizes in page order: 10,20
  • Initially loaded image numbers (1-based): 1
  • Remaining images reached by scrolling (%): 100
Share this page
Share this calculator

Leave unchecked to share the page without your entered values.