/

T-Test Calculator – t Value, p Value & Critical Value Solver

T-Test Calculator - t Value, p Value & Critical Value Solver
Statistics Tool

T-Test Calculator

Run a one-sample, two-sample (independent), or paired t-test. Get the t statistic, degrees of freedom, p-value, critical value, and a clear reject / fail-to-reject decision — with full step-by-step working.

T-Test Calculator
95% confidence
μ₀
s
n

Group 1

Group 2

Enter one pair per line, separated by a comma or space (e.g. before, after). The calculator computes each difference automatically, then d̄, sd, and n.

One-Sample: Comparing one sample's mean to a known or hypothesized value (e.g., "Is the average box weight different from the labeled 500g?").

Two-Sample (Independent): Comparing the means of two separate, unrelated groups (e.g., "Do Group A and Group B test scores differ?"). Use Pooled if variances are similar; use Welch's if sample sizes or variances differ noticeably (Welch's is the safer default).

Paired: Comparing two related measurements on the same subjects (e.g., "before vs after" or "left foot vs right foot").

x̄=105,μ₀=100,s=15,n=25
x̄=98,μ₀=100,s=8,n=16
x̄=512,μ₀=500,s=20,n=36
x̄=4.8,μ₀=5,s=0.4,n=10
x̄₁=88,x̄₂=82 (pooled-like)
x̄₁=75,x̄₂=70 (unequal var)
Large samples, small gap
Small samples, unequal var
d̄=4.5, sd=3.2, n=12
d̄=−2.1, sd=1.8, n=20
Load raw before/after data
Error

Test Results

t statistic
df
p-value
t critical

Bonus: Effect Size & Confidence Interval
Effect size (Cohen's d):
Standard error (SE):
Confidence interval:
→ Explore this interval further with the Margin of Error Calculator
Visual: t-statistic vs Rejection Region
−404
Your t-statistic Rejection region Critical value
Step-by-Step Working
Adjust Display Precision
Decimal places:
T-Test Formulas — Interactive Reference
1One-Sample tt=(x̄−μ₀)/(s/√n)

Tests whether a sample mean differs from a known or hypothesized population mean μ₀. The denominator s/√n is the standard error of the mean — it scales the difference by how much sample means naturally vary.

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

2Two-Sample Pooled tt=(x̄₁−x̄₂)/√(sp²(1/n₁+1/n₂))

Assumes both groups share a common population variance, combined into a single pooled estimate sp².

sp² = ((n₁−1)s₁² + (n₂−1)s₂²) / (n₁+n₂−2)

t = (x̄₁−x̄₂) / √(sp²(1/n₁+1/n₂))  |  df = n₁+n₂−2

3Welch's t-Testt=(x̄₁−x̄₂)/√(s₁²/n₁+s₂²/n₂)

Does not assume equal variances. Degrees of freedom are computed via the Welch-Satterthwaite equation and are often non-integer.

df = (s₁²/n₁ + s₂²/n₂)² / [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]

4Paired t-Testt=d̄/(sd/√n)

Reduces two related measurements to a single set of differences, then runs a one-sample t-test on those differences against a hypothesized mean of 0.

t = d̄ / (sd/√n)  |  df = n − 1

5Degrees of Freedomdf controls the t-distribution shape

Degrees of freedom determine how "fat-tailed" the t-distribution is. Low df → heavier tails → larger critical values needed for significance. As df grows, the t-distribution converges to the standard normal (z) distribution.

6p-Value InterpretationReject H₀ if p < α

The p-value is the probability of observing a t statistic this extreme (or more) if the null hypothesis were actually true. Small p-values are evidence against the null hypothesis.

7Critical Value ComparisonReject H₀ if |t| > t_crit

An equivalent decision rule to the p-value method: reject the null hypothesis if your computed t-statistic falls beyond the critical value(s) for your chosen α and tail type. Compare your t-statistic directly using the Critical Value Calculator.

8One-Tailed vs Two-Tailedα split vs α in one tail

Two-tailed tests split α across both tails (α/2 each) and detect a difference in either direction. One-tailed tests place all of α in a single tail and only detect a difference in the pre-specified direction.

9Cohen's d (Effect Size)d=(x̄₁−x̄₂)/sp

Statistical significance (p-value) tells you whether a difference likely exists; effect size tells you how large that difference is in practical terms. Cohen's d of 0.2/0.5/0.8 are conventionally small/medium/large.

10T-Test AssumptionsNormality, independence, scale

T-tests assume: (1) the sampled data are approximately normally distributed (or n is large enough for the Central Limit Theorem to apply), (2) observations are independent (except paired differences, which must themselves be independent across pairs), and (3) data are measured on an interval/ratio scale.

t-Critical Value Reference Table

Click any row to load that degrees of freedom into the One-Sample calculator (n = df + 1). Search by df.

dfα=0.10
(one-tail)
α=0.05
(one-tail)
α=0.025
(one-tail)
α=0.05
(two-tail)
α=0.01
(two-tail)

What Is a T-Test?

This t-test calculator determines whether an observed difference — between a sample and a known value, between two groups, or between paired measurements — is statistically significant or could plausibly be explained by random chance alone. A t-test is used specifically when the population standard deviation is unknown and must be estimated from the sample itself, which introduces extra uncertainty that the t-distribution accounts for (unlike the normal/z-distribution).

Every t-test compares a calculated t statistic against a reference distribution to produce a p-value — the probability of seeing a result this extreme if there truly were no effect. If that probability is small enough (below your chosen significance level α, commonly 0.05), you have statistically significant evidence of a real difference.

t = (observed difference) / (standard error of that difference) The general shape of every t-test formula, just with a different numerator and denominator per test type

T Statistic Formula Explained

Every version of the t statistic follows the same structural idea: a signal (the difference you're measuring) divided by noise (how much that difference would naturally vary from sample to sample).

Test Typet Formuladf
One-Sample(x̄−μ₀)/(s/√n)n−1
Two-Sample (Pooled)(x̄₁−x̄₂)/√(sp²(1/n₁+1/n₂))n₁+n₂−2
Two-Sample (Welch's)(x̄₁−x̄₂)/√(s₁²/n₁+s₂²/n₂)Welch-Satterthwaite
Pairedd̄/(sd/√n)n−1

The denominator of every t-test formula (s/√n, √(sp²(1/n₁+1/n₂)), etc.) is the standard error of the estimate. If you need to compute or understand a standard error in isolation, use the Standard Error Calculator.

One-Sample vs Two-Sample vs Paired T-Test

  • One-Sample t-test: Compares a single sample mean to a known/hypothesized value. Example: "Is the average delivery time different from the advertised 30 minutes?"
  • Two-Sample (independent samples) t-test: Compares the means of two separate, unrelated groups of subjects. Example: "Do students taught with Method A score differently than those taught with Method B?"
  • Paired t-test: Compares two related measurements taken on the same subjects. Example: "Did blood pressure change after treatment, measured on the same patients before and after?"

Choosing the wrong test type is one of the most common statistics errors. If your two sets of numbers came from the same subjects (matched pairs, before/after, left/right), always use the paired test — it is more powerful because it removes subject-to-subject variability from the comparison.

How to Find t in Statistics — Step-by-Step

  1. Step 1 — State the hypotheses: H₀ (null: no difference) and H₁ (alternative: there is a difference).
  2. Step 2 — Choose α and tail type: Commonly α=0.05, two-tailed unless you have a directional prediction.
  3. Step 3 — Calculate the t statistic: Use the formula matching your test type (see table above).
  4. Step 4 — Find degrees of freedom: n−1, n₁+n₂−2, or the Welch-Satterthwaite value.
  5. Step 5 — Find the p-value or critical value: Either look up/compute the p-value for your t and df, or find the critical t-value for your α and df.
  6. Step 6 — Make a decision: Reject H₀ if p < α (equivalently, if |t| exceeds the critical value).

Reading the p-Value

The p-value answers: "If the null hypothesis were true, how likely is it I'd see a t-statistic this extreme just by random sampling variation?" A small p-value means your observed result would be unusual under the null hypothesis — evidence to reject it.

p-valueInterpretation
p < 0.01Very strong evidence against H₀
0.01 ≤ p < 0.05Strong evidence against H₀ (typical "significant" threshold)
0.05 ≤ p < 0.10Weak/marginal evidence against H₀
p ≥ 0.10Little to no evidence against H₀

Important: A p-value is not the probability that H₀ is true, and failing to reject H₀ does not prove H₀ is true — it simply means you don't have sufficient evidence to reject it.

One-Tailed vs Two-Tailed Tests

A two-tailed test asks "is there any difference (in either direction)?" and splits α across both tails of the distribution (α/2 in each tail). A one-tailed test asks a directional question — "is the sample mean specifically greater than μ₀?" (right-tailed) or "specifically less than μ₀?" (left-tailed) — and places all of α in a single tail.

Only use a one-tailed test when you have a strong, pre-registered directional hypothesis before seeing the data. Choosing the tail direction after looking at your results inflates your false-positive rate and is considered poor statistical practice.

Worked Examples

1. One-Sample: Coffee Shop Wait Times

A café claims average wait time is 5 minutes. A sample of n=20 customers has x̄=5.6 min, s=1.2 min. Test at α=0.05, two-tailed.

  1. t = (5.6−5)/(1.2/√20) = 0.6/0.2683 ≈ 2.236
  2. df = 20−1 = 19
  3. p ≈ 0.0378 (two-tailed)
  4. Decision: p < 0.05 → Reject H₀. Wait time is significantly different from 5 minutes.

2. One-Sample: One-Tailed Quality Control

A factory wants to confirm rods average more than 50cm. Sample: x̄=51.2, s=3, n=30. Right-tailed test, α=0.05.

  1. t = (51.2−50)/(3/√30) = 1.2/0.5477 ≈ 2.191
  2. df = 29, one-tailed p ≈ 0.0184
  3. Decision: p < 0.05 → Reject H₀. Rods are significantly longer than 50cm.

3. Two-Sample Pooled: Teaching Methods

Method A: x̄₁=78, s₁=8, n₁=25. Method B: x̄₂=74, s₂=9, n₂=25. Assume equal variances, α=0.05 two-tailed.

  1. sp² = (24×64 + 24×81)/48 = (1536+1944)/48 = 72.5
  2. t = (78−74)/√(72.5×(1/25+1/25)) = 4/√5.8 ≈ 1.661
  3. df = 48, p ≈ 0.1034
  4. Decision: p ≥ 0.05 → Fail to reject H₀. No significant difference detected between methods.

4. Two-Sample Welch's: Unequal Sample Sizes

Group 1: x̄₁=100, s₁=15, n₁=10. Group 2: x̄₂=90, s₂=25, n₂=40. Variances look unequal — use Welch's.

  1. t = (100−90)/√(225/10+625/40) = 10/√(22.5+15.625) = 10/√38.125 ≈ 1.619
  2. df via Welch-Satterthwaite ≈ 12.9
  3. p ≈ 0.130 (two-tailed) → Fail to reject H₀ at α=0.05

5. Paired T-Test: Before/After Training

10 employees tested before and after a training program. Mean difference d̄=6.2 points, sd=5.1, n=10, α=0.05 two-tailed.

  1. t = 6.2/(5.1/√10) = 6.2/1.6127 ≈ 3.845
  2. df = 9, p ≈ 0.00392
  3. Decision: p < 0.05 → Reject H₀. Training produced a statistically significant improvement.

6. Paired T-Test: No Significant Change

8 patients' cholesterol before/after a mild dietary change. d̄=−2.5, sd=8.9, n=8, α=0.05 two-tailed.

  1. t = −2.5/(8.9/√8) = −2.5/3.147 ≈ −0.794
  2. df = 7, p ≈ 0.4525
  3. Decision: p ≥ 0.05 → Fail to reject H₀. No significant change detected.

Common Mistakes

Mistake 1 — Using an Independent-Samples Test on Paired Data

  • ❌ Wrong: Running a two-sample test on before/after measurements from the same subjects.
  • ✅ Correct: Use the paired t-test — it accounts for the correlation between matched observations and is more statistically powerful.

Mistake 2 — Choosing a One-Tailed Test After Seeing the Data

  • ❌ Wrong: Running a two-tailed test, seeing p=0.08, then switching to a one-tailed test to get p<0.05.
  • ✅ Correct: Decide tail direction (and α) before collecting/analyzing data.

Mistake 3 — Ignoring Unequal Variances

  • ❌ Wrong: Always defaulting to the pooled t-test regardless of how different the two sample variances look.
  • ✅ Correct: When in doubt, use Welch's t-test — it performs nearly as well as the pooled test when variances are equal, and much better when they aren't.

Mistake 4 — Confusing Statistical and Practical Significance

  • ❌ Wrong: Assuming a tiny p-value automatically means the effect is large or important.
  • ✅ Correct: Always check effect size (Cohen's d) alongside the p-value — with large samples, even trivially small differences can be "statistically significant."

Mistake 5 — Forgetting the t-Test Assumes Rough Normality

  • ❌ Wrong: Applying a t-test blindly to heavily skewed data with a tiny sample size.
  • ✅ Correct: For small, non-normal samples, consider a non-parametric alternative (e.g., Wilcoxon signed-rank or Mann-Whitney U test) instead.

Frequently Asked Questions

What is a t-test used for?
A t-test determines whether there is a statistically significant difference between a sample mean and a known value (one-sample), between two independent group means (two-sample), or between paired/matched observations (paired t-test). It is used when the population standard deviation is unknown and the sample size is typically small.
How do you calculate a t statistic?
For a one-sample t-test: t = (x̄ − μ₀) / (s/√n), where x̄ is the sample mean, μ₀ is the hypothesized population mean, s is the sample standard deviation, and n is the sample size. The denominator s/√n is the standard error of the mean.
What is the difference between a one-sample, two-sample, and paired t-test?
A one-sample t-test compares a single sample mean to a known/hypothesized value. A two-sample (independent samples) t-test compares the means of two separate, unrelated groups. A paired t-test compares two related measurements taken on the same subjects (e.g., before/after), analyzing the differences directly.
What is the difference between pooled and Welch's t-test?
The pooled (Student's) two-sample t-test assumes both groups have equal population variances and combines them into one pooled variance estimate. Welch's t-test does not assume equal variances and calculates degrees of freedom using the Welch-Satterthwaite equation, making it more robust when sample sizes or variances differ substantially.
How do you interpret a p-value in a t-test?
The p-value is the probability of observing a t statistic at least as extreme as the one calculated, assuming the null hypothesis is true. If p is less than your significance level (commonly α = 0.05), you reject the null hypothesis and conclude the result is statistically significant. If p ≥ α, you fail to reject the null hypothesis.
What is the difference between a one-tailed and two-tailed t-test?
A two-tailed test checks for a difference in either direction (greater than or less than) and splits the significance level across both tails of the distribution. A one-tailed test checks for a difference in only one specified direction and places the entire significance level in a single tail, making it easier to reach significance but only appropriate when the direction of effect is predicted in advance.
What are degrees of freedom in a t-test?
Degrees of freedom (df) represent the number of independent values that can vary in a calculation. For a one-sample or paired t-test, df = n − 1. For a pooled two-sample t-test, df = n₁ + n₂ − 2. For Welch's t-test, df is computed using the Welch-Satterthwaite equation and is often a non-integer value.
How do you find the critical value for a t-test?
The critical t-value is the boundary value on the t-distribution corresponding to your significance level (α) and degrees of freedom. It can be looked up in a t-table or computed directly (as this calculator does) by finding the t-value where the tail probability equals α (one-tailed) or α/2 (two-tailed).
What is the standard error in a t-test formula?
The standard error (SE) is the denominator of the t statistic — it measures how much sample means would vary across repeated samples. For a one-sample test, SE = s/√n. For a two-sample pooled test, SE = √(sp²(1/n₁+1/n₂)). A smaller standard error produces a larger, more significant t statistic for the same mean difference.
Can a t-test be negative?
Yes. The sign of the t statistic simply indicates direction — a negative t means the sample mean (or first group mean) is lower than the comparison value (or second group mean). For significance testing, what matters is the magnitude of t relative to the critical value, or equivalently the p-value.

Related Calculators

Quick Formulas
t = (x̄−μ₀)/(s/√n)One-Sample
t = (x̄₁−x̄₂)/√(sp²(1/n₁+1/n₂))Two-Sample Pooled
t = (x̄₁−x̄₂)/√(s₁²/n₁+s₂²/n₂)Welch's t-test
t = d̄/(sd/√n)Paired t-test
df = n−1One-sample / Paired
df = n₁+n₂−2Pooled two-sample
Reject H₀ if p < αDecision rule
Most Searched
One-sample: x̄=105 vs μ₀=100
Two-sample pooled example
Welch's t-test example
Paired: d̄=4.5, sd=3.2, n=12
One-tailed QC example

Share This Tool

Share the T-Test Calculator with your class or team!

Free chemistry, physics, biology & math calculators with step-by-step solutions. Trusted by 100,000+ students. Solve any science problem instantly!

Newsletter

Subscribe to our Newsletter to be updated. We promise not to spam.

Copyright © 2026 SciSolveLab. All Rights Reserved

Scroll to Top