Free tool A/B test sample size calculator
Before you launch a test, decide how many visitors it needs. Enter your current conversion rate and the smallest lift worth detecting, and the calculator returns the visitors per variant and the days your traffic will take.
- Two-proportion z-test
- Duration from daily traffic
- Runs locally
Size the test before you start it
The minimum detectable effect is relative: 10% on a 4% baseline means detecting 4.0% → 4.4%, not 4% → 14%.
The control’s current rate for the page and event you will test. Enter 4 for 4%.
The smallest lift worth detecting, relative to the baseline. 10 means a 10% relative lift.
The false-positive rate you accept. 5% is the usual choice.
The chance of detecting the lift if it is real. 80% is common; 90% needs more traffic.
Control plus variants. 2 for a classic A/B test.
Eligible visitors per day across all groups. Optional; used only for the duration.
Visitors per group
39,475
Every group, the control included, needs at least this many visitors.
Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/ab-test-sample-size-calculator
Version v1.0Updated Update history
What the four numbers mean
The result is a stopping rule. Decide it before the test starts, run until you reach it, and only then read the outcome.
Visitors per group
The sample each group must reach. With a 4% baseline and a 10% relative lift, that is 39,475 visitors in the control and 39,475 in the variant.
Total visitors
All groups together. Adding a third group adds another full group of visitors, so the test takes longer.
Days to run
Total visitors divided by the daily traffic that enters the test. 78,950 ÷ 3,000 is 26.3, so 27 days. Round up to whole weeks so every weekday is covered equally.
Variant rate to detect
The rate the variant would need for the test to pick up the difference reliably. Smaller real lifts can still happen; this test is just unlikely to detect them.
Power is a probability, not a promise. At 80% power, a real lift of exactly this size is still missed one time in five.
Four inputs, decided in this order
The two settings that move the result most are the baseline and the minimum detectable effect.
-
1
Measure the baseline
Take the conversion rate of the exact page and event you will test, over a recent normal period. A site-wide rate is usually the wrong baseline.
-
2
Choose the lift worth finding
Ask what lift would justify shipping the change. Smaller effects need far more traffic: halving the MDE roughly quadruples the sample.
-
3
Keep α and power standard
5% and 80% are the common defaults. Move to 1% or 90% when a wrong decision is expensive and you have the traffic.
-
4
Add daily traffic
Enter the visitors who will actually enter the test each day, after targeting. The calculator turns the sample into days.
Sample size for comparing two conversion rates
The calculator uses the standard formula for a two-sided, two-proportion z-test with a fixed sample size and no continuity correction. It finds the sample at which a real lift of the chosen size would cross the significance threshold with the chosen power.
- The minimum detectable effect is relative: p₂ = p₁ × (1 + MDE)
- z₁₋α/₂ is 1.960 at 5%, 2.576 at 1% and 1.645 at 10%; z₁₋β is 0.842 at 80% power and 1.282 at 90%
- Each extra group gets the same sample; the significance level is not adjusted for multiple comparisons
- Calculators that add a continuity correction, test one-sided or use sequential methods give somewhat different numbers
Variant rate
p₂ = p₁ × (1 + MDE)
4% × (1 + 10%) = 4.4%
Visitors per group
n = ( z₁₋α/₂ × √(2 p̄ (1 − p̄)) + z₁₋β × √(p₁(1 − p₁) + p₂(1 − p₂)) )² ÷ (p₂ − p₁)², p̄ = (p₁ + p₂) ÷ 2
p̄ = 4.2%: (1.960 × 0.2837 + 0.842 × 0.2837)² ÷ 0.004² = 39,474.8 → rounded up to 39,475
Total and duration
total = n × groups; days = total ÷ daily visitors
39,475 × 2 = 78,950; 78,950 ÷ 3,000 = 26.3 → 27 days
How the baseline and the MDE move the sample
Every row uses a 5% significance level, 80% power and two groups. The duration column assumes 3,000 visitors a day enter the test.
| Baseline | Relative MDE | Variant rate | Visitors per group | Days at 3,000 a day |
|---|---|---|---|---|
| 4% | 5% | 4.2% | 154,304 | 103 |
| 4% | 10% | 4.4% | 39,475 | 27 |
| 4% | 20% | 4.8% | 10,317 | 7 |
| 1% | 10% | 1.1% | 163,095 | 109 |
| 20% | 10% | 22% | 6,510 | 5 |
Halving the MDE from 10% to 5% almost quadruples the sample (39,475 → 154,304). The same relative lift on a 1% baseline needs 25 times the visitors it needs on a 20% baseline. Sample figures, calculated with this tool.
How A/B tests end up underpowered
Most inconclusive tests were too small from the start.
Absolute and relative MDE mixed up
A "1% lift" on a 4% baseline is either 4.0% → 4.04% or 4% → 5%. The first needs about 3.8 million visitors per group, the second 6,745.
Stopping at the first significant day
The formula assumes one look at the planned sample. Checking daily and stopping early inflates false positives well above 5%.
The wrong baseline
Using the site-wide rate for a checkout test, or a sale week’s rate for a normal week, makes the sample wrong in either direction.
Ignoring the weekly cycle
A 10-day test that starts on a Friday sees two weekends but only one Monday. Run whole weeks so every day of the week counts equally.
Where the baseline comes from
The calculator needs a baseline rate and daily traffic you trust. TapCub funnels compute conversion between every step with a fixed time window, split by channel, device or segment.
Funnels
Conversion per step with the drop-off highlighted: the baseline for the step you plan to test.
Learn moreGoals and events
Define the converting event once; every report uses the same definition.
Learn moreBots counted separately
Crawlers never convert. Keeping them out of the denominator keeps the baseline honest.
Learn moreA/B test sample size questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I calculate the sample size for an A/B test? What is the formula?
You need four inputs: the baseline conversion rate p₁, the minimum detectable effect (so p₂ = p₁ × (1 + MDE)), the significance level and the power. Then n per group = (z₁₋α/₂ × √(2p̄(1 − p̄)) + z₁₋β × √(p₁(1 − p₁) + p₂(1 − p₂)))² ÷ (p₂ − p₁)², with p̄ = (p₁ + p₂) ÷ 2. With a 4% baseline, a 10% relative lift, 5% significance (z = 1.960) and 80% power (z = 0.842), that is 39,475 visitors per group.
What is the minimum detectable effect (MDE)?
The smallest real difference the test is designed to detect reliably. This calculator takes it as a relative lift: 10% on a 4% baseline means 4.4%. Pick it from what would be worth shipping, not from what you hope to see.
What are statistical power and significance level?
The significance level (α) is the false-positive rate you accept: at 5%, one test in twenty with no real difference will still look significant. Power is the chance of detecting a real lift of the MDE size: at 80%, one in five is missed. Raising power from 80% to 90% takes the default example from 39,475 to 52,846 visitors per group.
Why is my result different from another calculator?
Calculators make different choices. Some add a continuity correction, which gives slightly larger samples; some treat the MDE as absolute percentage points; some test one-sided, which needs fewer visitors; others use sequential or Bayesian methods that let you check results as they come in and size the test differently. This one is a two-sided z-test, fixed sample, no continuity correction.
What if I test more than two variants?
Each group still needs the per-group sample, so the total grows with every variant. The calculator does not adjust the significance level for multiple comparisons; with several variants, consider choosing the 1% level to keep false positives down.
Can I stop the test as soon as it is significant?
Not with this method. A fixed-sample test is valid when you read it once, at the planned size. Peeking and stopping at the first p below 0.05 makes a false positive much more likely than 5%.
What if I do not have enough traffic?
Test bolder changes, so the lift worth detecting is larger; test a step with a higher baseline rate, such as add-to-cart instead of purchase; or accept a longer test. Lowering power below 80% is possible but you will miss more real effects.
Is this the same as a survey sample size calculator?
No. Survey calculators size one estimate to a margin of error; an A/B calculator sizes a comparison between two groups. For a survey-style margin of error, use the confidence interval calculator.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Read the test when it finishes
Once each group reaches its sample, compare the two conversion rates with a significance test and a confidence interval.