Mathematics
One-sample and paired mean t-test
Test a mean from one sample summary, differences of matched A/B lists or two independent sample summaries (Welch). Inspect t, degrees of freedom and an approximate p-value for the selected alternative.
The example values can be changed. Press Calculate to update the result; you can download it as TXT or CSV and collect scenarios in this tab. JSON, HTML and TXT downloads keep your inputs, the statistical result and the calculation steps shown. Automatic recalculation after editing is off unless you switch it on. Nothing is saved, imported or sent automatically.
Result
Formula / calculation:
Sample n 2–201, positive sample SD. Paired lists: 2–201 entries each, semicolons separate observations; decimal comma or point; preserve pair order. Numbers bounded to ±1,000,000,000; each list at most 400 characters. Independent normal observations or independent normal pair differences required. Zero variability refuses. Alpha 0.001–0.2. Numerical p below 1e−12 is shown as a threshold, not zero. No medical decision, causal claim or inference of practical importance. Welch mode: the existing n/mean/SD fields describe sample A; new B fields describe sample B. Independent normal populations required, positive sample SD1e-9..1e9 and each n2..201. Fractional df is preserved; no pooled test, effect-size/power/clinical claim.
Decimal results are approximate. Inputs stay in this browser tab.
Sources
How it works
Own numerical mean t-tests with explicit sampling and model assumptions. Sample n 2–201, positive sample SD. Paired lists: 2–201 entries each, semicolons separate observations; decimal comma or point; preserve pair order. Numbers bounded to ±1,000,000,000; each list at most 400 characters. Independent normal observations or independent normal pair differences required. Zero variability refuses. Alpha 0.001–0.2. Numerical p below 1e−12 is shown as a threshold, not zero. No medical decision, causal claim or inference of practical importance. Welch mode: the existing n/mean/SD fields describe sample A; new B fields describe sample B. Independent normal populations required, positive sample SD1e-9..1e9 and each n2..201. Fractional df is preserved; no pooled test, effect-size/power/clinical claim. The separate one-sample z-test uses the entered sample mean, sample size and an independently known population standard deviation. It does not estimate that deviation from observations or reuse the sample SD field. Confirm independent random observations from a normal population and independently known sigma. The statistic is (sample mean minus hypothesised mean) divided by (population sigma divided by the square root of sample size). Choose a two-sided, greater or less alternative and alpha. Sample size is 2 to 1,000,000, positive sigma is 1e-9 to 1e9, absolute means are at most 1e9 and absolute z at most 1e8. Alpha is 0.001 to 0.2. Results use binary 64 approximations, an eight-decimal numeric display and the existing normal-tail calculation. P below 1e-12 is reported as a threshold, not zero; the decision uses unrounded p. A p-value is not the probability that the null hypothesis is true. Five complete current exports retain all entered values, confirmations, source calculation and results.
Worked example
With these example values the calculator gives the result below. You can change any value in the form above.
Inputs
- Data model
- One-sample summary
- Sample size n 2–201
- 10
- Sample mean
- 53.7
- Sample SD with denominator n−1
- 6.567
- Hypothesised mean or A−B mean difference
- 50
- Alternative against the hypothesised mean
- Different: two sided
- Significance threshold alpha (0.05 = 5%)
- 0.05
- Rounded numeric display: 0–12 decimal places
- 8
Result
- Sample size
- 10
- Sample mean / mean difference
- 53.7
- Sample standard deviation
- 6.567
- Hypothesised mean / difference
- 50
- Standard error
- 2.07666773943
- t statistic
- 1.78170052423
- Degrees of freedom
- 9
- Alternative
- twoSided
- Approximate p (scientific notation)
- 1.08484471e-1
- Significance threshold
- 0.05
- Reject under model assumptions?
- No; this does not prove the null
- Model and assumptions
- One-sample t; independent random observations; normal population
Frequently asked questions
How do I calculate a one-sample t-test?
The mean t-test uses t = (mean − hypothesised mean) / (sample SD / √n) with df = n − 1. You enter sample size, mean, sample standard deviation, the hypothesised mean, the alternative and alpha, and get t, degrees of freedom and an approximate p-value.
How do I run a paired t-test with two lists?
Enter matched A and B lists with 2 to 201 entries each, separated by semicolons and in pair order. The test is based on the differences A−B, and each list may have at most 400 characters.
Can the mean t-test compare two independent samples?
Yes, in Welch mode. The existing n, mean and SD fields describe sample A and new fields describe sample B. Fractional degrees of freedom are preserved and no pooled test is run.
Which assumptions does the t-test need?
Independent random observations from a normal population, or independent normal pair differences, are required. Zero variability is refused, and the sample size must be between 2 and 201.
When should I use the z-test instead of the t-test?
Use the separate one-sample z-test only when the population standard deviation is known independently. Its statistic is the sample mean minus the hypothesised mean, divided by sigma over the square root of n.
What does a small p-value mean in a t-test?
A small p is not effect size, practical importance, causation or the probability that the null is true. A p below 1e−12 is shown as a threshold, not zero.