Two-group sample size calculator
Enter the two proportions or means you expect, the significance level and the power. You get how many respondents each group needs to detect that difference.
- Checked against reference values
- Free, no sign-up
- Nothing leaves your browser
Parameters
For example, current conversion 20% → enter 20
Expected conversion after the change. The gap to group 1 is the MDE
Equal variances in both groups are assumed
Assumptions and limitations
- Two-sided test, two groups of equal size.
- Proportions: pooled-variance formula without continuity correction.
- Means: normal approximation with a common standard deviation; a t-test needs one or two more respondents per group when groups are small.
Collect real answers in a SurveyNinja survey and see them in charts in the report.
Use this template See the questions firstData is not stored — calculation runs in your browser.
Ready-made template
Do it with your own respondents
The “Market research survey” template already has the questions. Put in your company name, share the link and watch the answers come in.
- Copy the template: the questions are written
- Share it by link, QR code or a widget on your site
- Read the results in the report with charts
New accounts get 14 days of Premium features, no credit card.
What is the minimum sample for comparing two groups?
The minimum sample for comparing two groups is the number of respondents each group needs so that a test at significance level α detects a set difference, the minimum detectable effect, with the chosen power. It comes from a power formula for two proportions or two means. For example, detecting 20% vs 28% at α = 0.05 and 80% power takes 447 people per group.
Formulas
-
Two proportions
n per group = [z_α/2 × √(2p̄(1−p̄)) + z_β × √(p₁(1−p₁) + p₂(1−p₂))]² / (p₁−p₂)², where p̄ = (p₁+p₂)/2. z_α/2 = 1.96 for α = 0.05, z_β = 0.84 for 80% power. The result is rounded up.
-
Two means
n per group = 2 × (z_α/2 + z_β)² × σ² / (μ₁−μ₂)². σ is the common standard deviation and μ₁−μ₂ the difference you want to detect. This is the normal (z) approximation.
-
Power and MDE
80% power means that if the true difference equals the MDE, the test detects it in 80% of studies. The MDE is the smallest difference worth detecting; a smaller MDE requires a larger sample.
-
When to use which mode
Proportions: conversion, shares, % satisfied (A/B on conversion). Means: continuous metrics such as average order, time or scale score. After collecting data, check significance with a separate calculator.
Sample size planning examples
-
Proportions: A/B on conversion
- Variant A: conversion 20%, variant B: 28% (8 pp difference). α = 0.05, 80% power.
447 per group, 894 in total. Recruit this many in each group, then check significance in the A/B test calculator.
-
Means: when to use "two means" mode
- Not conversion but a continuous metric: average order, time on site, 1–10 scale score.
Enter the expected means μ₁ and μ₂ and the common standard deviation σ; the difference between the means is the effect to detect. Estimate σ from past data or a pilot.
-
Small difference, large sample
- Conversion A: 10%, B: 12% (MDE 2 pp), α = 0.05, 80% power.
3,841 per group. If that volume is out of reach, aim for a larger difference or accept lower power.
-
CSAT of two segments
- Comparing % satisfied (top-2) between two customer segments. Expected proportions 70% vs 80%, α = 0.05, 80% power.
294 per segment. Recruit at least that many in each segment.
-
Strict criteria (α = 0.01, 90% power)
- Conversion 20% vs 25%. A lower α means fewer false positives; higher power means a better chance to detect the effect.
2,074 per group instead of 1,094 at α = 0.05 and 80% power. Use for critical decisions.
-
Average order: two channels
- Channel 1: average order 50, channel 2: 55, σ ≈ 20 (from past data).
"Two means" mode with μ₁ = 50, μ₂ = 55 and σ = 20: 252 orders per channel to detect a difference of 5.
Next step
Read the answers in a report, not a spreadsheet
Charts are built for you from every answer. Share the report by link or export the answers to Excel, CSV or SPSS.
- Ready questions or AI from a description
- A link for your email or chat, a QR code or a widget on your site
- Charts in the report, export to Excel, CSV and SPSS
Frequently asked questions
When do you need per-group sample for comparison?
When planning an A/B test or comparing two segments (for example conversion after campaign A vs B, or CSAT of new vs returning customers). You need to know how many respondents to recruit in each group.
What is power?
The probability that the test detects a real difference of the planned size. With 80% power there is a 20% chance of missing the effect (type II error). Target power is usually 80% or 90%.
What is MDE?
Minimum Detectable Effect: the smallest difference you want to detect. For example, conversion 20% vs 25% means an MDE of 5 pp. In this calculator the MDE is the gap between the two values you enter. A smaller MDE requires a larger sample.
Why two modes, proportions and means?
Proportions are shares (conversion, % satisfied). Means are continuous metrics (average order, time, scale score). The formulas differ.
Are group sizes equal?
The calculator assumes equal groups. With an unequal split such as 2:1, the total sample needed is larger than for equal groups, so use a power tool that supports allocation ratios.
How to estimate standard deviation for means?
From past data or a pilot survey. If you have nothing, a rough rule of thumb is σ ≈ range / 4, about 2.25 for a 1–10 scale; replace it with real data as soon as you have it.
How does this differ from the single-proportion sample size calculator?
That one plans the precision of one proportion (margin of error, confidence interval). This one plans the power to detect a difference between two groups. Different tasks.
After calculation how to check significance?
Once you have data, use the A/B significance calculator (z-test for two proportions) or a t-test for two means. This calculator only plans the sample size before data collection.
Sources
- Fleiss, J. L., Levin, B., Paik, M. C. Statistical Methods for Rates and Proportions, 3rd ed. Wiley, 2003
Learn the method
Read how the method works and where its numbers come from.
Turn the numbers into a survey
Start from the “Market research survey” template: the questions are ready.
Cross-Sectional Study vs Longitudinal Study: Differences, Types and Survey Examples