Home / Science / Maths, statistics and computing / Statistics / Sample size and power calculatorTool #32

Sample size and power calculator with power curves (t test, proportions, surveys)

How many subjects, samples or survey responses do you need? Sample size for comparing two means, paired data, two proportions, or a survey's margin of error, with power curves. Matches R and G*Power.

Keep it one tap away for everyday use.

Bookmark Sample size and power calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Effect
  2. α and power
  3. n and curve
Nothing is uploadedWorks offline once open

Study

Sample size

Download

What it does

Too few subjects and a real effect is missed. Too many wastes money and, in animal or patient studies, is unethical. Ethics boards and grant reviewers ask for a power calculation. This tool works out the sample size for the common designs and draws the power curve, so you can show how the answer changes if the effect is smaller or larger than you hoped.

  • Two group means: an unpaired t test, for example treatment against control.
  • Paired means: the same subjects before and after, or matched pairs.
  • One mean against a fixed value.
  • Two proportions: percentages such as cure rates.
  • Survey: how many responses give a percentage within a chosen margin of error.

How to use it

  1. Choose what you are comparing.
  2. For means, type the smallest difference worth detecting and the standard deviation, from a pilot study or published data. Their ratio is the effect size d. Cohen’s rough guide: 0.2 is small, 0.5 medium and 0.8 large.
  3. For proportions, type the expected percentage in each group.
  4. Choose the significance level α (usually 0.05) and the power, the chance of detecting the effect if it is real (0.8 or 0.9).
  5. Add the expected dropout, so the number recruited still leaves enough at the end.

The power curves show power against sample size for your effect, and for effects 25 % smaller and larger.

The methods

Means use the exact noncentral t distribution for a two-sided test, the same method as R’s power.t.test and G*Power. Proportions use the normal approximation of R’s power.prop.test. Surveys use n = z²p(1 − p)/E², with the finite population correction when you give a population size. Results are rounded up to whole subjects.

Worked example

To detect a difference of 5 units when the SD is 10 (d = 0.5), at α = 0.05 with 80 % power, you need 64 per group (63.77 before rounding), as R’s power.t.test gives. Comparing 50 % with 75 % at 90 % power needs 77 per group (R: 76.7). A survey with a ±5 % margin at 95 % confidence needs 385 responses. If only 1000 people could answer, 278 are enough.

Frequently asked questions

Where do I get the standard deviation? From a pilot study, earlier work, or published papers in your field. If unsure, use a larger value: it is safer.

Is my data stored? No. Nothing is stored or sent anywhere.

Draw your results with the publication plot maker.

Where the numbers come from

  • Methods: as in R's power.t.test and power.prop.test.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-08.

Change log for Sample size and power calculator

  1. Show where each science tool's numbers come from, with a removal-request link Details on GitHub
  2. Add six science tools: solutions, PCR master mix, sample size, stereonet, psychrometrics, plate layout Details on GitHub

Every change to fibub

Related tools

Biodiversity indices #39 Paste species counts for one or more sites and get Shannon, Simpson, evenness, Chao1 richness, rarefaction curves and Bray-Curtis similarity in one table. Runs in your browser. CSV profiler and SQL playground #38 Open CSV, TSV or Excel files and get a profile of every column: type, missing values, distinct values, range and most common values. Then query them with SQL (SQLite), join files, and download the result. Nothing is uploaded. Dose-response and ELISA curve fitter (4PL) #29 Fit a four-parameter logistic curve to dose-response or ELISA data. Get the EC50 or IC50 with its 95 % interval and the Hill slope, and read unknown samples off the curve. Psychrometric and heat stress calculator #34 From the air temperature and humidity (or dew point, or wet bulb), get every moist air property with the ASHRAE equations, a psychrometric chart, the heat index and the humidex. Reliability and agreement #40 Check a questionnaire scale with Cronbach's alpha and item statistics, or rater agreement with Cohen's kappa (weighted too), Fleiss' kappa and all six intraclass correlations with 95 % intervals. Matches R's psych package. Uncertainty propagation calculator #25 Type your formula and your measurements with their uncertainties, or paste repeated readings. Get the result with its uncertainty, which input matters most, and a Monte Carlo check. Publication plot maker #27 Paste columns or open a CSV or Excel file and get a clean scientific figure with error bars, sized for a journal column. Download vector SVG or PDF, or PNG at 300 or 600 dpi. Your data stays in your browser.