Skip to main content
Free Tool — Statistical Analysis
← Statistics Suite

T-Test Calculator
with Cohen's d, Steps & T-Distribution Visual

Perform one-sample, independent, and paired t-tests from summary statistics. Get the t-statistic, degrees of freedom, p-value, and Cohen's d effect size with step-by-step work and an interactive distribution visual. All calculations run in your browser — no data sent to any server.

Compare a sample mean to a known or hypothesised value.

Welch's correction is recommended when variances may differ or sample sizes are unequal.

Two-tailed tests for a difference in either direction.

Choose None to show only the t-statistic and p-value (no significant/not-significant verdict or critical line).

🔬

Enter your summary statistics and click Calculate

The t-statistic, degrees of freedom, p-value, Cohen's d, and step-by-step work will appear here.

How to Calculate a T-Test

The formulas and worked examples for each test type.

One-Sample T-Test

t = (x̄ − μ₀) / (s / √n)

df = n − 1

Where x̄ is the sample mean, μ₀ is the hypothesised mean, s is the sample standard deviation, and n is the sample size.

Worked Example

x̄ = 102.5, μ₀ = 100, s = 15.3, n = 25

1. SE = 15.3 / √25 = 3.060

2. t = (102.5 − 100) / 3.060 = 0.8170

3. df = 25 − 1 = 24

4. Two-tailed p = 0.4220 (not significant)

Independent T-Test (Student's)

t = (x̄₁ − x̄₂) / √[s_p²(1/n₁ + 1/n₂)]

df = n₁ + n₂ − 2

Where s_p² is the pooled variance: [(n₁−1)s₁² + (n₂−1)s₂²] / (n₁+n₂−2). Use Welch's correction when variances are unequal.

Worked Example

x̄₁=105, x̄₂=98, s₁=12, s₂=14, n₁=30, n₂=28

1. s_p² = [(29×144)+(27×196)]/56 = 169.07

2. SE = √(169.07 × 0.0690) = 3.414

3. t = (105 − 98) / 3.414 = 2.050

4. df = 56, p = 0.0452 (significant)

Paired T-Test

t = d̄ / (s_d / √n)

df = n − 1

Where d̄ is the mean of the paired differences, s_d is the standard deviation of those differences, and n is the number of pairs.

Worked Example

d̄ = 4.5, s_d = 6.2, n = 20

1. SE = 6.2 / √20 = 1.386

2. t = 4.5 / 1.386 = 3.247

3. df = 20 − 1 = 19

4. Two-tailed p = 0.0043 (significant)

How it works

1

Choose your test type

Select one-sample, independent (two-sample), or paired t-test. Toggle between Student's pooled method and Welch's correction for independent samples.

2

Enter your summary statistics

Input means, standard deviations, and sample sizes. The Best Answer Hub T-Test Calculator works from summary data — no need to paste raw observations.

3

Get instant results

See the t-statistic, degrees of freedom, p-value, Cohen's d effect size, step-by-step work, plain-English interpretation, and an interactive t-distribution visual. Export to PDF with one click.

Frequently asked questions

What is the Best Answer Hub T-Test Calculator?

The Best Answer Hub T-Test Calculator is a free browser-based tool that performs one-sample, independent (two-sample), and paired t-tests from summary statistics. It calculates the t-statistic, degrees of freedom, one-tailed and two-tailed p-values, and Cohen's d effect size. Every result includes step-by-step work, a plain-English interpretation, and an interactive t-distribution visual. All calculations run locally — no data is sent to any server.

What is the difference between a one-sample, independent, and paired t-test?

A one-sample t-test compares the mean of a single sample to a known or hypothesised population mean. An independent t-test compares the means of two separate, unrelated groups. A paired t-test compares measurements from the same subjects at two different times or under two different conditions. The Best Answer Hub T-Test Calculator offers separate input panels for each design with labelled fields so users select the correct test for their data structure.

When should I use a t-test instead of a z-test?

Use a t-test when the population standard deviation is unknown and must be estimated from sample data, or when the sample size is small, typically below 30 observations. Use a z-test when the population standard deviation is known and the sample size is large. The Best Answer Hub T-Test Calculator is designed for the far more common real-world scenario where sigma is unknown and only sample statistics are available.

How do I know if I need a paired or independent t-test?

Use a paired t-test when each observation in one group is directly linked to exactly one observation in the other group, such as before-and-after measurements on the same patients or matched pairs in an experiment. Use an independent t-test when the two groups contain entirely different subjects with no natural pairing. The Best Answer Hub T-Test Calculator shows a decision hint next to each mode selector to help users choose correctly.

Should I use a one-tailed or two-tailed t-test?

Use a two-tailed test when you want to detect any difference between groups, regardless of direction. This is the standard in most scientific research and is required when the direction of the effect is not predicted in advance. Use a one-tailed test only when you have a strong, pre-registered directional hypothesis and would not care about an effect in the opposite direction. The Best Answer Hub T-Test Calculator defaults to two-tailed and clearly labels the tail type in every output.

What does the p-value mean in a t-test?

The p-value in a t-test is the probability of observing a t-statistic at least as extreme as the one calculated from your data, assuming the null hypothesis of no difference is true. A p-value of 0.04 means there is a 4% chance of seeing this result if there were truly no effect. The Best Answer Hub T-Test Calculator converts every t-statistic into a precise p-value and explains the conclusion in plain language without statistical jargon.

My t-test gives p = 0.052 — is that significant or not?

At the conventional 0.05 significance level, a p-value of 0.052 is technically not statistically significant because it exceeds the threshold. However, this is a borderline result that deserves attention. The Best Answer Hub T-Test Calculator flags values between 0.05 and 0.10 as marginal and recommends reporting the exact p-value rather than rounding to "not significant." Many statisticians suggest treating such results as suggestive evidence worthy of replication.

What are degrees of freedom and why do they matter in a t-test?

Degrees of freedom represent the number of independent values in your sample that are free to vary after estimating parameters like the mean. For a one-sample or paired t-test, df equals n minus 1. For an independent t-test using pooled variance, df equals n1 plus n2 minus 2. They determine the exact shape of the t-distribution and therefore the critical value needed for significance. The Best Answer Hub T-Test Calculator computes degrees of freedom automatically and displays the exact formula used.

What is Cohen's d and how do I calculate it from a t-test?

Cohen's d is a standardised effect size that measures the magnitude of the difference between groups in units of standard deviation. Values near 0.2 indicate a small effect, 0.5 a medium effect, and 0.8 or above a large effect. The Best Answer Hub T-Test Calculator automatically computes Cohen's d for every test type using the appropriate formula, so users never need a separate effect-size calculator. This satisfies APA 7th edition reporting requirements.

Can I run a t-test if my data is not normally distributed?

The t-test assumes approximately normal data, but this assumption matters most with small sample sizes below 30. For larger samples, the Central Limit Theorem protects the validity of the t-test even with moderate skewness. If normality is severely violated and the sample is small, consider a non-parametric alternative such as the Mann-Whitney U test for independent groups or the Wilcoxon signed-rank test for paired data. The Best Answer Hub T-Test Calculator includes a validation note when sample sizes are very small.

Should I use Welch's t-test or the regular Student's t-test?

Use Welch's t-test when the two groups have unequal variances or unequal sample sizes. It does not assume equal variances and adjusts the degrees of freedom downward to compensate. Use the standard Student's t-test only when you have good reason to believe the populations have equal variances. The Best Answer Hub T-Test Calculator offers both methods for independent samples and defaults to Welch's correction, which statisticians recommend as the safer choice in most real-world scenarios.

How do I calculate a t-test by hand with mean and standard deviation?

For a one-sample t-test, subtract the hypothesised mean from the sample mean, then divide by the standard error, which is the sample standard deviation divided by the square root of n. For an independent t-test, subtract the two group means and divide by the pooled standard error. The Best Answer Hub T-Test Calculator shows every substitution in its step-by-step work panel, making it an ideal reference for students learning to compute t-statistics manually.

Why does my t-test give a different p-value than Excel or SPSS?

Small differences usually arise from whether the software uses Welch's correction, how it handles ties, or floating-point precision in the cumulative distribution function. Excel's T.TEST function defaults to Welch's for unequal variances, while older versions of SPSS default to Student's pooled method. The Best Answer Hub T-Test Calculator uses precise numerical integration for the t-distribution cumulative density function, accurate to at least four decimal places, and clearly states which formula was applied.

What is statistical power, and does my sample size matter for a t-test?

Statistical power is the probability that a t-test will correctly detect a real effect when one exists. Larger samples increase power and produce narrower confidence intervals. A common rule of thumb is that 20 to 30 participants per group provides adequate power for medium effect sizes at the 0.05 level. The Best Answer Hub T-Test Calculator displays the sample size alongside every result as a reminder that very small samples may lack the sensitivity to detect meaningful differences.

Is the Best Answer Hub T-Test Calculator free and private?

Yes. The Best Answer Hub T-Test Calculator is completely free with no premium tiers, advertisements, or subscription plans. All calculations run entirely in the browser using client-side JavaScript. No raw data, summary statistics, or results are uploaded, stored, or logged on any server. This makes it safe for sensitive research data, clinical measurements, and proprietary business metrics.

What people test with it

Real-world scenarios where researchers, students, and analysts reach for the Best Answer Hub T-Test Calculator.

Students

Verify statistics homework and exam prep

Covers AP Stats, psychology labs, and nursing research

Students enter summary statistics from textbook problems to check manual t-test calculations. The step-by-step work shows every formula substitution, helping learners understand exactly how the t-statistic and p-value are derived.

Researchers

Validate experimental results before publication

One-sample, independent, and paired designs supported

Psychology and biology researchers run quick t-tests on group means to verify statistical significance. The built-in Cohen's d output satisfies APA 7th edition reporting requirements without needing a separate effect-size calculator.

Data Analysts

Compare A/B test variants and survey segments

Independent t-test with Welch's correction for unequal variances

Analysts compare conversion rates, satisfaction scores, or response times between two user groups. Welch's correction handles the common scenario where sample sizes and variances differ between the control and treatment groups.

Quality Assurance

Measure before-and-after process changes

Paired t-test for matched pre-post measurements

QA engineers compare product measurements from the same batch before and after a process improvement. The paired t-test accounts for natural variation between batches, isolating the true effect of the change with proper statistical rigour.

Results are for educational and analytical purposes. The Best Answer Hub T-Test Calculator does not replace formal statistical consultation for peer-reviewed research.

Explore the rest of the Statistics Calculator Suite

Also try Z-Score Calculator, Confidence Interval Calculator, and P-Value Calculator.

Browse Statistics Calculator Suite →

Built & maintained by Shahbaz Ali Malik Last updated: