Quantitative Sample Size Calculator UX
Calculate sample size for surveys, A/B tests, usability testing and card sorting with academically validated formulas
Is your study qualitative? Use the qualitative sample size tool.
Calculate your sample size
1. Select methodology
Choose the research methodology you will use
Cochran's Formula: Finite Population
Cochran's formula (Cochran, 1977) is the statistical standard for calculating sample size when you know the exact size of your population. It includes a finite population correction factor (FPC) that reduces the required sample, optimizing resources without losing precision.
n = (N * Z^2 * p * q) / ((N-1) * E^2 + Z^2 * p * q)When to use Cochran's formula?
- You know the exact size of your population (employees, registered users, clients)
- The population is less than 100,000 individuals
- Your sample represents more than 5% of the total population (5% rule)
- You need statistical rigor for publications or critical decisions
Cochran's formula parameters
- N
- Total population size
- Z
- Z-value for confidence level (1.96 for 95%)
- p
- Expected proportion (0.5 if unknown)
- q
- 1 - p (complement of the proportion)
- E
- Acceptable margin of error (e.g., 0.05 for +/-5%)
Practical example: finite population
You have 2,000 registered users and want to survey them with 95% confidence and +/-5% margin of error.
With Cochran's formula: n = (2,000 * 3.84 * 0.25) / (1,999 * 0.0025 + 3.84 * 0.25) = 323 participants. Without the finite correction you'd need 385.
Simplified Formula: Infinite Population
When the population is unknown or exceeds 100,000 individuals, the finite correction factor has less than 1% impact. In these cases, the simplified formula is used, which does not require knowing the population size.
n = (Z^2 * p * q) / E^2When to use the infinite population formula?
- You don't know the exact size of your population
- The population exceeds 100,000 individuals
- Your sample represents less than 5% of the total population
- Market research with broad or public audiences
Infinite population formula parameters
- Z
- Z-value for confidence level (1.96 for 95%)
- p
- Expected proportion (0.5 if unknown)
- q
- 1 - p (complement of the proportion)
- E
- Acceptable margin of error (e.g., 0.05 for +/-5%)
Practical example: infinite population
You want to survey users of an app with millions of downloads, with 95% confidence and +/-5% margin.
With the simplified formula: n = (3.84 * 0.25) / 0.0025 = 385 participants. This result is independent of the population size.
Power Formula: A/B Testing
An A/B test does not estimate a value in a population: it contrasts two variants to decide whether the observed difference is real or noise. That is why it uses neither Cochran's formula nor the simplified one — it uses power analysis (Kohavi et al., 2009; Cohen, 1988). Population size does not enter the calculation, and the number it returns is per variant: the full experiment needs twice as much.
n = 2 * (Za + Zb)^2 * p * (1-p) / D^2When to use the A/B testing power formula?
- You are comparing two or more variants and need to know whether the difference between them is real
- You know the baseline conversion rate of your control variant
- You can define the minimum effect that would justify making the change (MDE)
- Traffic accumulates over time: there is no closed population capping the sample
A/B testing formula parameters
- n
- Sample per variant (the full experiment requires 2n)
- Za
- Z-value for the confidence level (1.96 for 95%)
- Zb
- Z-value for statistical power (0.8416 for 80%; 1.2816 for 90%)
- p
- Baseline conversion rate, as a proportion (e.g., 0.05 for 5%)
- D
- Minimum detectable effect (MDE) as a proportion (e.g., 0.005 for +0.5 points)
Practical example: conversion A/B test
Your checkout converts at 5% and you want to detect a 10% relative improvement (that is, reaching 5.5%), with 95% confidence and 80% power.
The absolute MDE is 0.5 points = 0.005. With the power formula: n = 2 * (1.96 + 0.8416)^2 * 0.05 * 0.95 / 0.005^2 = 29,827 per variant, 59,654 in total. At 2,000 daily visits, the test takes about 30 days.
When to use each formula?
First decide which question you are answering: estimating a value in a population (surveys) or detecting a difference between variants (A/B testing). Only within the survey path does the choice between finite and infinite depend on whether you know your population size and what proportion of it your sample will represent.
- Are you comparing two variants to know whether the difference between them is real? If yes -> use the A/B testing power formula; population size does not enter the calculation and the result is per variant.
- Do you know the exact size of your population? If not -> use the infinite formula.
- Does the population exceed 100,000? If yes -> use the infinite formula (the result is practically identical).
- Will your sample be more than 5% of the population? If yes -> use the finite formula (Cochran) to optimize resources.
- When in doubt -> use the infinite formula. It always gives an equal or larger sample, which is more conservative.
Quick comparison
| Criterion | Finite Population | Infinite Population | A/B Testing |
|---|---|---|---|
| Question it answers | What is the value of X in my population? | What is the value of X in my population? | Is the difference between A and B real? |
| What sets the size | Margin of error and confidence | Margin of error and confidence | MDE, confidence and power |
| Known population | Yes, required | Not necessary | Not applicable |
| Population size | < 100,000 | > 100,000 or unknown | Irrelevant: traffic accumulates |
| Sample vs population | > 5% of population | < 5% of population | Not applicable |
| Correction factor | Yes (reduces sample) | Not applicable | Not applicable |
| Typical result | Smaller sample (optimized) | Conservative sample | Sample per variant (total is 2n) |
| Use case | Companies, closed communities | General market, mass apps | Conversion experiments on web or product |
References
- Cochran, W. G. (1977). Sampling Techniques (3rd ed.). New York: John Wiley & Sons. wiley.com
- Kohavi, R., Longbotham, R., Sommerfield, D., & Henne, R. M. (2009). Controlled Experiments on the Web: Survey and Practical Guide. Data Mining and Knowledge Discovery, 18(1), 140–181. link.springer.com
- Cohen, J. (1988). Statistical Power Analysis for the Behavioral Sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum Associates. routledge.com
Detailed Guides by Methodology
Learn more about each methodology with examples, benchmarks, and best practices
Finite Population Survey
For known populations < 100,000 users
Infinite Population Survey
For large populations > 100,000 users
Problem Discovery
How many sessions to see a problem at least once
Quantitative Usability
Quantify usability problems (TSR, SUS)
Conversion A/B Testing
Sample per variant to detect a real difference
Quantitative Card Sorting
Statistical analysis of groupings and mental models
Need to design the complete study?
The calculator gives you the number; defining the methodology, recruiting well and holding the statistical rigor is the rest of the work. That part we do with you.