T-Test Calculator
Is this tool helpful?
How to use the tool
- Select a test
- One-sample – compare one sample mean to a known value.
- Independent two-sample – compare two unrelated groups.
- Paired sample – compare matched observations (e.g., before-after).
- Choose input method
Summary statistics or Raw data. Example inputs:- Summary: 7.4, 1.9, 18
- Raw: 9.1, 8.7, 7.5, 10.2, 9.8
- Fill Sample 1
Two fresh examples:- Raw list: 12.2, 11.7, 10.9, 12.6
- Summary: 11.9, 0.8, 12
- Fill Sample 2 (only for two-sample tests)
- Raw list: 13.5, 12.9, 13.1, 13.8
- Summary: 13.3, 0.6, 12
- Optional parameters
- μ₀ (e.g., 11.0) for one-sample tests.
- α significance (e.g., 0.01).
- Tail: two-, left-, or right-tailed.
- Press “Calculate” and read t-value, degrees of freedom, p-value, 95 % CI, and decision.
Core formulas
One-sample:
$$ t = \frac{\bar{x}-\mu_0}{s/rac{\sqrt{n}}} ,\qquad df = n-1 $$Independent two-sample (equal variances):
$$ s_p = \sqrt{rac{(n_1-1)s_1^2 + (n_2-1)s_2^2}{n_1+n_2-2}},\quad t = \frac{\bar{x}_1-\bar{x}_2}{s_p\sqrt{rac{1}{n_1}+rac{1}{n_2}}},\quad df = n_1+n_2-2 $$Paired sample:
$$ t = \frac{\bar{d}}{s_d/rac{\sqrt{n}}},\qquad df = n-1 $$95 % confidence interval:
$$ (\Delta \pm t_{0.025,df}\times SE) $$Worked examples
Example 1 – One-sample
- Input: mean = 10.2, s = 2.3, n = 15, μ₀ = 9.0
- t = (10.2 – 9.0)/(2.3/√15) ≈ 2.02.
- df = 14; two-tailed p ≈ 0.061.
- Decision: fail to reject H₀ at α = 0.05.
Example 2 – Independent two-sample
- Group A: 5.1, 1.2, 20 Group B: 4.7, 1.4, 22
- s_p ≈ 1.30; SE ≈ 0.40; t ≈ 1.00.
- df = 40; p ≈ 0.32; fail to reject H₀.
Quick-Facts
- Two-tailed critical t for df = 20 at α = 0.05 is 2.086 (NIST Handbook, https://itl.nist.gov/div898/handbook).
- T-tests assume normality or n > 30 for robustness (Central Limit Theorem, Ross 2010).
- Effect size for t-tests is Cohen’s d where 0.2 = small, 0.5 = medium, 0.8 = large (Cohen, 1988).
- “Use pooled variance only when Levene’s test is non-significant” (ISO 13528:2022).
FAQ
What does the t-value tell me?
The t-value shows how many standard-error units separate sample and hypothesised means; larger |t| signals stronger evidence against H₀ (Student, 1908).
How do I interpret the p-value?
P-value is the probability of observing that |t| or greater if H₀ is true; p < α means statistically significant (NIST Handbook, URL).
When should I pick a one-tailed test?
Choose one-tailed only with a directional hypothesis set before data collection; otherwise remain two-tailed to avoid inflated Type I error (Rosenthal, 1994).
Can I use raw data with unequal sample sizes?
Yes. Enter each list; the calculator adjusts degrees of freedom accordingly using pooled or Welch’s method where coded.
What if my data are non-normal?
For n ≥ 30 per group, the t-test stays reliable due to the Central Limit Theorem; else use a non-parametric test like Wilcoxon (Conover, 1999).
How is the 95 % confidence interval built?
The tool multiplies the standard error by critical t0.025 and adds/subtracts around the mean difference for lower and upper limits.
Why do I need degrees of freedom?
Degrees of freedom index sample information; they locate the correct t-distribution curve for critical values and p-values (ISO 3534-1:2006).
Does the calculator handle unequal variances?
The current release applies equal-variance formulas; future update will include Welch’s adjustment for heteroscedastic samples.
Important Disclaimer
The calculations, results, and content provided by our tools are not guaranteed to be accurate, complete, or reliable. Users are responsible for verifying and interpreting the results. Our content and tools may contain errors, biases, or inconsistencies. We reserve the right to save inputs and outputs from our tools for the purposes of error debugging, bias identification, and performance improvement. External companies providing AI models used in our tools may also save and process data in accordance with their own policies. By using our tools, you consent to this data collection and processing. We reserve the right to limit the usage of our tools based on current usability factors. By using our tools, you acknowledge that you have read, understood, and agreed to this disclaimer. You accept the inherent risks and limitations associated with the use of our tools and services.
