
A/B Testing File Size Formula
Learn how an A/B test's traffic split, file sizes, requests, and cache hit rate determine estimated data transfer.
This formula estimates how much more or less data an A/B test transfers than serving the control file to every uncached request. It helps quantify the bandwidth effect of testing a larger or smaller file before considering other performance factors.
- 100% Free
- No Sign-Up Required
- Private & Secure
- Mobile Friendly
A/B Test Bandwidth Difference
Where:
Find the size difference per file download, multiply it by the uncached requests receiving the variant, then convert kilobytes to gigabytes. A positive result means the test transfers more data than an all-control baseline.
Variables Explained
| Variable | What It Means | Unit |
|---|---|---|
| variantFileSize - Variant file size | Downloaded size of the file served to visitors assigned to the variant. | KB |
| controlFileSize - Control file size | Downloaded size of the existing control file. | KB |
| testVisitors - Test visitors | Expected unique visitors included in the experiment. | number |
| downloadsPerVisitor - Downloads per visitor | Average number of times each visitor requests the file. | number |
| cacheHitRate - Cache hit rate | Share of requests expected to be served from cache without a new file transfer. | percent |
| variantTrafficShare - Variant traffic share | Percentage of uncached test requests assigned to the variant. | percent |
Step-by-Step Calculation
Estimate total requests
Multiply expected test visitors by the average number of file requests per visitor.
totalRequests = testVisitors * downloadsPerVisitor
Remove cached requests
Only the uncached share is counted as a new file transfer in this estimate.
uncachedRequests = totalRequests * (1 - cacheHitRate / 100)
Allocate variant requests
Apply the experiment's variant traffic allocation to uncached requests.
variantRequests = uncachedRequests * (variantTrafficShare / 100)
Calculate the all-control baseline
This is the estimated transfer if every uncached request received the control file.
controlOnlyTransferGb = (controlFileSize * uncachedRequests) / 1048576
Calculate A/B test transfer
Add the control and variant transfer amounts based on their assigned uncached requests.
abTestTransferGb = ((controlFileSize * (uncachedRequests - variantRequests)) + (variantFileSize * variantRequests)) / 1048576
Compare the test with the baseline
A positive result indicates additional transfer from the A/B test; a negative result indicates reduced transfer.
bandwidthDifferenceGb = abTestTransferGb - controlOnlyTransferGb
Example: 300 KB variant tested against a 250 KB control
Total file requests
100,000 × 2
200,000 requests
Uncached requests
200,000 × (1 − 30 / 100)
140,000 requests
Variant requests
140,000 × 50 / 100
70,000 requests
Control-only transfer
(250 × 140,000) ÷ 1,048,576
33.38 GB
A/B test transfer
[(250 × 70,000) + (300 × 70,000)] ÷ 1,048,576
36.72 GB
Bandwidth difference
36.72 − 33.38
+3.34 GB
Final Result
The 50/50 A/B test is estimated to transfer 3.34 GB more than serving the 250 KB control file to all uncached requests.
Assumptions
- ✓Entered file sizes represent the typical downloaded response size in KB.
- ✓Each visitor makes the stated average number of file requests.
- ✓The same cache hit rate applies to both control and variant requests.
- ✓Traffic allocation is applied to uncached requests using the entered variant share.
- ✓One GB is treated as 1,048,576 KB.
Limitations
- !The estimate excludes HTTP headers, retries, redirects, and other page resources.
- !Actual cache behavior can vary by browser, device, geography, CDN configuration, and cache-control headers.
- !File compression may vary by client or content encoding and can change transferred size.
- !The calculation measures transfer volume, not loading speed, conversion impact, infrastructure cost, or server load.
Common Mistakes to Avoid
Entering an uncompressed build size instead of the typical transferred size.
Using all site visitors when only a subset is expected to enter the experiment.
Treating a 30% cache hit rate as 0.30 without using percentage input conventions.
Forgetting that a 10% variant allocation limits the transfer impact to roughly one tenth of uncached requests.
Interpreting a positive bandwidth difference as a direct measure of page-speed change.
Related Formulas
Frequently Asked Questions
What is the A/B testing file size formula?
The bandwidth difference equals the variant-minus-control file size multiplied by uncached requests assigned to the variant, then divided by 1,048,576 to express the result in GB.
Why does only variant traffic affect the bandwidth difference?
The control traffic is the same in both the A/B test and the all-control comparison. Only requests receiving a differently sized variant create the difference.
What does a negative bandwidth difference mean?
It means the variant is smaller than the control and the selected test allocation is estimated to transfer less data than the all-control baseline.
Why is cache hit rate subtracted before traffic allocation?
Cached requests are assumed not to download the file again, so the calculation first estimates requests that result in a file transfer.
How is KB converted to GB in this calculator?
The calculator divides kilobytes by 1,048,576, which is 1,024 × 1,024 KB per GB.
Ready to calculate your result?
Use the calculator to get instant results with your own inputs.