Quantitative Sample Size Calculator UX

Calculate sample size for surveys, A/B tests, usability testing and card sorting with academically validated formulas

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.

Cochran's formula with finite correctionn = (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.

Simplified formula for infinite populationn = (Z^2 * p * q) / E^2

When 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.

Power formula for A/B testing (sample per variant)n = 2 * (Za + Zb)^2 * p * (1-p) / D^2

When 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.84 for 80%; 1.28 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.84)^2 * 0.05 * 0.95 / 0.005^2 = 29,792 per variant, 59,584 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.

  1. 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.
  2. Do you know the exact size of your population? If not -> use the infinite formula.
  3. Does the population exceed 100,000? If yes -> use the infinite formula (the result is practically identical).
  4. Will your sample be more than 5% of the population? If yes -> use the finite formula (Cochran) to optimize resources.
  5. When in doubt -> use the infinite formula. It always gives an equal or larger sample, which is more conservative.

Quick comparison

CriterionFinite PopulationInfinite PopulationA/B Testing
Question it answersWhat 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 sizeMargin of error and confidenceMargin of error and confidenceMDE, confidence and power
Known populationYes, requiredNot necessaryNot applicable
Population size< 100,000> 100,000 or unknownIrrelevant: traffic accumulates
Sample vs population> 5% of population< 5% of populationNot applicable
Correction factorYes (reduces sample)Not applicableNot applicable
Typical resultSmaller sample (optimized)Conservative sampleSample per variant (total is 2n)
Use caseCompanies, closed communitiesGeneral market, mass appsConversion 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

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.

Last updated: