T-Test Calculator
One-sample, two-sample and paired t-tests with p-values, intervals and effect sizes.
Try before you buy.
- Free preview: watermarked charts of the test and the names of each table’s first rows (up to 3), with t, the p-value, the verdict, the working and every figure hidden.
- Locked until you unlock it: download and copy.
- Unlock: Pro pass, ₹179 for 30 days, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
Result
This is the last result worked out. Fix the input above to update it.
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the T-Test Calculator
Run a one-sample, two-sample (Welch’s or Student’s pooled) or paired t-test on your raw data or on summary statistics — the mean, standard deviation and size of each group. The calculator gives the t statistic, its degrees of freedom (with the Welch–Satterthwaite formula when the variances are not assumed equal), the one- and two-tailed p-values, the critical value, the confidence interval for the mean or the difference, and the effect size as Cohen’s d with Hedges’ correction.
Every result comes with the working step by step, a chart of the t distribution with your statistic and the rejection region, the group means with their confidence intervals, a plain-language conclusion and a ready APA-style sentence, such as t(9) = −4.06, p = .003. For two samples it also shows Welch’s and Student’s tests side by side, so you can see how much the equal-variance assumption matters for your data.
How to use it
- Choose the test: Two samples for two independent groups, Paired for two measurements of the same subjects (before and after), One sample to compare a mean with a fixed value.
- Paste or type your data — one list per group — or switch to Mean, SD and n if you only have summary statistics. For a paired test the two lists must be in the same order, one value per subject.
- Set the hypothesized value μ₀ (usually 0 for a difference), the alternative hypothesis (two-tailed unless you chose a direction in advance) and α. For two samples keep Welch’s test unless you have a reason to assume equal variances.
- Read t, the p-value and the decision, then the interval, the effect size and the working; the APA-style sentence is ready to adapt for a report.
- Copy the result, or download a Word report, a CSV file or the chart — with a Pro pass or after unlocking this result; without one you see the free preview.
Examples
Extra hours of sleep of 10 patients with drug 1: 0.7, −1.6, −0.2, −1.2, −0.1, 3.4, 3.7, 0.8, 0.0, 2.0 and with drug 2: 1.9, 0.8, 1.1, 0.1, −0.1, 4.4, 5.5, 1.6, 4.6, 3.4
Mean difference −1.58; t(9) = −4.062, p = 0.002833; 95 % CI [−2.460, −0.700]; d_z = −1.28
The Cushny–Peebles sleep data that Student analysed in the paper that introduced the t-test.
Drug 1 and drug 2 as separate groups of 10
t(17.78) = −1.861, p = 0.0794: not significant at α = 0.05
Ignoring the pairing throws away the patient-to-patient differences, so the same data no longer show a significant effect.
US: mean 20.14458, s = 6.41470, n = 249; Japan: mean 30.48101, s = 6.10771, n = 79; Student pooled
t(326) = −12.621, s_p = 6.3426; p < 10⁻²⁸
The two-sample example of the NIST/SEMATECH e-Handbook, which reports T = −12.62059.
x̄ = 105, s = 15, n = 36, μ₀ = 100
t(35) = 2.000, two-tailed p = 0.0533: not significant at α = 0.05; d = 0.33
Common uses
- Testing whether a new teaching method, drug, layout or process changed the average outcome compared with a control group.
- Comparing measurements of the same people, items or machines before and after a change.
- Checking a sample mean against a target, a specification or a published norm.
- Re-checking a t-test from a paper or software output when only the means, standard deviations and sample sizes are known.
- Getting an APA-style sentence and a Word report for coursework, a thesis or a lab write-up.
Which t-test to use
- One sample: one group compared with a fixed value μ₀ — the average fill weight against the 500 g on the label. t = (x̄ − μ₀)/(s/√n) with n − 1 degrees of freedom.
- Paired: two measurements of the same subjects, or matched pairs. The test works on the differences d = first − second: t = (d̄ − μ₀)/(s_d/√n) with n − 1 degrees of freedom. Pairing removes the variation between subjects, so it is far more sensitive when the pairs belong together.
- Two independent samples, Welch: t = (x̄₁ − x̄₂ − μ₀)/√(s₁²/n₁ + s₂²/n₂), with the Welch–Satterthwaite degrees of freedom ν = (s₁²/n₁ + s₂²/n₂)² / [(s₁²/n₁)²/(n₁ − 1) + (s₂²/n₂)²/(n₂ − 1)], which may have decimals. It does not assume equal variances and is the safer default.
- Two independent samples, Student (pooled): assumes both groups have the same variance and pools them, s_p² = [(n₁ − 1)s₁² + (n₂ − 1)s₂²]/(n₁ + n₂ − 2), with n₁ + n₂ − 2 degrees of freedom. With equal group sizes it gives the same t as Welch’s test.
The formulas are those of the NIST/SEMATECH e-Handbook; the test goes back to Student’s paper, whose sleep data are the first example above.
One-tailed or two-tailed
The two-tailed test asks whether the means differ in either direction, and is the default. A one-tailed test (right-tailed for “greater”, left-tailed for “less”) has more power in the chosen direction but is only valid when that direction was fixed before the data were seen; it can never find an effect in the other direction. The calculator shows all three p-values, and its confidence interval matches the test: a two-sided interval for a two-tailed test, a one-sided bound for a one-tailed one.
Effect size: Cohen’s d and Hedges’ g
A p-value says whether a difference is detectable, not whether it is large. Cohen’s d expresses the difference in standard deviations: (x̄₁ − x̄₂)/s_p for two samples, (x̄ − μ₀)/s for one, and d_z = d̄/s_d for paired data. Cohen suggested 0.2 as small, 0.5 as medium and 0.8 as large, as a rough guide when nothing better is known in your field. Because d overestimates the population effect in small samples, the calculator also gives Hedges’ g, d multiplied by Hedges’ correction J = Γ(ν/2)/(√(ν/2)·Γ((ν − 1)/2)) ≈ 1 − 3/(4ν − 1).
Assumptions
- Independent observations within each group (and between the groups for a two-sample test).
- Roughly normal data — or of the differences, for a paired test. With 30 or more values per group the test is robust to moderate skew; with very small samples look at the data first, and use a rank test (Mann–Whitney or Wilcoxon) when they are clearly skewed or have outliers.
- Equal variances only for Student’s pooled test. The calculator compares both tests and reports the variance ratio F with its p-value, but the usual advice is to use Welch’s test throughout rather than to choose after an F test.
Limitations
- Raw data can have up to 100,000 values per group; summary statistics up to 10,000,000 per group.
- The standard deviations you type must be sample standard deviations (n − 1 in the denominator), as statistics software and calculators report them.
- The APA-style sentence is plain text without italics; adjust it to your course’s or journal’s style before you use it.
- The calculator does not test normality or remove outliers: check a plot of your data, especially with small samples.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, T-Test Calculator shows watermarked charts of the test and the names of each table’s first rows (up to 3), with t, the p-value, the verdict, the working and every figure hidden. Until you unlock it, the result can’t be downloaded or copied. A Pro, Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
Should I use Welch’s t-test or Student’s t-test?
Use Welch’s test unless you have a good reason to believe both groups have the same variance. It is almost as powerful as Student’s test when the variances are equal and keeps the right error rate when they are not, especially with unequal group sizes. With equal group sizes both give the same t; only the degrees of freedom differ.
How do I do a t-test from the mean, standard deviation and sample size?
Choose Mean, SD and n and type them for each group. For the NIST example — US cars with mean 20.14458, s = 6.41470, n = 249, and Japanese cars with mean 30.48101, s = 6.10771, n = 79 — the pooled test gives t = −12.62 with 326 degrees of freedom. For a paired test you need the mean and SD of the differences, not of the two columns.
What is the difference between a paired and an unpaired t-test?
A paired test uses the differences within each pair, so the variation between subjects drops out. On Student’s sleep data the paired test gives p = 0.0028 while treating the same numbers as two separate groups gives p = 0.079: the pairing is what makes the effect visible. Use it only when each value in one list belongs to one value in the other.
Why are my degrees of freedom not a whole number?
Welch’s test estimates its degrees of freedom from the two variances (the Welch–Satterthwaite formula), so they usually have decimals — 17.78 for the sleep data. They lie between the smaller n − 1 and n₁ + n₂ − 2. Report them as given, rounded to two decimals.
How do I report a t-test in APA style?
Give the means and standard deviations, then t with its degrees of freedom, the exact p-value and the effect size, for example: t(9) = −4.06, p = .003, d_z = −1.28, 95% CI [−2.46, −0.70]. p has no leading zero because it cannot be larger than 1, and very small values are written p < .001. The calculator writes this sentence for you.
What does a confidence interval for the difference tell me?
The range of differences that are compatible with your data at the chosen confidence level. If a 95 % interval for μ₁ − μ₂ excludes 0, the two-tailed test at α = 0.05 is significant, and the interval also shows how large the difference plausibly is — which the p-value alone does not.