Sample Size Calculator for Surveys, t-Tests, Proportions and Correlations
Work out how many people, plants, patients or samples your study needs before you collect a single data point. Pick your design, enter a few numbers and get a sample size you can justify in your proposal.
- PriceFree, no login or sign-up needed
- Your dataProcessed in your browser, never uploaded
- Works onPhone, tablet or computer, any modern browser
- Made byDr. Muhammad Aammar Tufail, Codanics
- Published14 November 2026
- Last updated16 November 2026
📚 How to cite this tool
This tool is free. If it helped your thesis, paper, report or assignment, please cite it. It keeps the tools free and helps other students find them.
Tufail, M. A. (2026). Sample size calculator [Online tool]. Codanics. Retrieved 16 November 2026, from https://codanics.com/tools/sample-size-calculator/
In-text citation: (Tufail, 2026) · Narrative: Tufail (2026)
The access date is today’s date, filled in automatically. Author: Muhammad Aammar Tufail. Published 14 November 2026.
How to use the sample size calculator
- Choose the tab that matches your design: a survey, two groups (independent t-test), a paired / one-sample design, two proportions or a correlation.
- Set the confidence level (usually 95%) and, for tests, the power (usually 80% or 90%).
- Enter the expected effect: a margin of error for surveys, Cohen’s d for means, two percentages for proportions, or r for correlations. Take these from a pilot study or similar published papers.
- Add the dropout or non-response you expect. The tool inflates the sample so you still have enough complete data at the end.
- Click Calculate and copy the ready-made sentence into the methods section of your proposal or thesis.
Why sample size matters
A study that is too small can miss a real effect, and a reviewer will ask why you didn’t calculate power first. A study that is too big wastes money, time and, in medical or animal work, raises ethical questions. A clear sample size calculation shows your supervisor and funders that you planned properly. It is one of the first things examiners look for in a PhD research proposal.
The formulas behind the calculator
Survey sample size (Cochran’s formula)
Here z is 1.96 for 95% confidence, p is the expected proportion and e is the margin of error. With p = 50% and e = 5%, you need 385 people for a large population, the number you see in many theses.
Two independent groups (t-test)
The last term is a small correction that brings the normal-based formula very close to the exact t-test answer from G*Power. For d = 0.5, α = .05 and 80% power, it gives 64 per group, the same as G*Power.
Two proportions, paired designs and correlations
For two proportions we use the classic formula with a pooled variance under the null hypothesis. For paired data we use the effect size of the differences (dz). For correlations we use Fisher’s z transformation. All three are standard textbook formulas, so a reviewer can check them easily.
Frequently asked questions
What sample size do I need for a survey?
For a large population, 95% confidence, a ±5% margin of error and an expected proportion of 50%, you need 385 responses. If your population is small (for example 500 students), the finite population correction lowers this to about 218. Then add extra for people who will not respond.
What is a good power for a study?
80% power is the common minimum, which means a 20% chance of missing a real effect. Many funders and clinical trials now ask for 90%. Higher power needs a larger sample.
Is this the same as G*Power?
For t-tests the results match G*Power to within one participant because we add a small correction to the normal-based formula. For proportions and correlations we use the standard normal approximations, which can differ from exact methods by one or two participants.
Why should I use 50% as the expected proportion?
Because p × (1 − p) is largest at 50%, so it gives the most conservative (largest) sample size. If earlier studies show the true proportion is around 20%, you can use that and you will need fewer people.
How do I adjust for dropout?
Divide the required sample by (1 − dropout rate). If you need 100 participants and expect 20% dropout, recruit 100 / 0.8 = 125. The calculator does this for you when you enter a dropout percentage.
Does my data leave my computer?
No. All calculations run in your web browser with JavaScript. Nothing is sent to Codanics or anyone else.
Do I need to log in or create an account to use the sample size calculator?
No. There is no login, no sign-up and no email required. Open the page and start using it straight away, for free, on any device.
How do I cite this tool in my thesis or paper?
Use the citation box on this page. In APA 7th edition: Tufail, M. A. (2026). Sample size calculator [Online tool]. Codanics. Retrieved [date you used it], from https://codanics.com/tools/sample-size-calculator/. BibTeX, RIS (EndNote, Mendeley, Zotero), MLA, Harvard, Chicago and Vancouver formats are also available.
Free guides and courses from Codanics
More free tools
See all free Codanics tools → · Codanics on YouTube · WhatsApp channel