One-Sample T Test Calculator
Test whether your sample mean differs significantly from a known or hypothesized population mean.
Check your inputs: sample size must be 2 or more, and standard deviation must be greater than 0.
| t-statistic | – |
| Degrees of freedom | – |
| Critical t-value | – |
| Approx. p-value | – |
A one-sample t test answers a single question: is your sample mean far enough from some expected value that the difference probably isn't random noise? Researchers, quality control teams, and students run this constantly, usually without realizing how little math is actually behind it.
You need four numbers. Your sample mean, the population mean you're comparing against, your sample's standard deviation, and your sample size. That's the whole input list, nothing else required.
Working Through the Formula by Hand
The t-statistic formula is t = (x̄ − μ) / (s / √n). The numerator is just the gap between what you observed and what you expected. The denominator, called the standard error, shrinks as your sample size grows, which is the entire reason bigger samples produce more reliable significance.
Take a concrete case. A factory expects bolts to average 25mm in length. A quality inspector samples 32 bolts, finds a mean of 25.4mm with a standard deviation of 1.2mm. Standard error: 1.2 / √32 = 0.212. t = (25.4 − 25) / 0.212 = 1.887. With 31 degrees of freedom and a two-tailed test at α = 0.05, the critical value sits around 2.04. Since 1.887 doesn't cross that line, the inspector can't claim the bolts are significantly off-spec, even though 25.4 looks different from 25 on paper.
Degrees of Freedom, Explained Simply
Degrees of freedom is just n − 1. Why subtract one? Because once you know the mean and n−1 of your data points, the last value is locked in mathematically, it has no freedom to vary independently. That's it, no deeper mystery.
The calculator above runs a numerical approximation of the t-distribution's cumulative function to give you both the exact t-statistic and an approximate p-value, the same approach textbooks teach but without the lookup table.
One-Tailed vs Two-Tailed, and Why It Matters
Choose a one-tailed test only when you have a directional hypothesis stated before you collected data, like "this new process increases output" rather than just "this changes output." Switching to one-tailed after seeing your results, just to get a smaller p-value, is a well-documented form of p-hacking and it'll undermine any serious analysis.
Most academic and business contexts default to two-tailed unless there's a clear, pre-registered reason not to. When in doubt, use two-tailed, it's the more conservative and defensible choice.
For comparing two independent groups instead of one sample against a fixed value, you'd want our two-sample t test calculator instead, since the formula and assumptions differ meaningfully.
What the P-Value Actually Tells You
A p-value of 0.03 does not mean there's a 3% chance the null hypothesis is true. It means: if the null hypothesis were true, you'd see a result this extreme or more extreme only 3% of the time by chance alone. That distinction trips up even people who've taken a stats course.
- p < 0.05 is the conventional threshold, but it's a convention, not a law of nature
- Smaller samples need a bigger gap between x̄ and μ to reach significance
- A "significant" result with a tiny effect size can still be practically meaningless
FAQs
What is a one-sample t test used for?
It's used to determine whether the mean of a single sample differs significantly from a known or hypothesized population mean. Common uses include quality control, comparing a sample to a historical benchmark, and basic hypothesis testing in research.
How do I find the t critical value without a calculator?
You'd normally look it up in a t-distribution table using your degrees of freedom and significance level. This calculator computes it directly using a numerical approximation, skipping the table entirely.
What's the difference between t statistic and p value?
The t-statistic measures how many standard errors your sample mean is from the expected value. The p-value converts that t-statistic into a probability, telling you how likely such a result is under the null hypothesis.
Can I use this t test calculator with sample size under 30?
Yes, the t-distribution is specifically designed for smaller samples where the population standard deviation is unknown. It becomes nearly identical to the normal distribution once n exceeds about 30.
What does one sample t test degrees of freedom mean in practice?
Degrees of freedom equals your sample size minus one. It determines the exact shape of the t-distribution used to find your critical value and p-value.
How does a one tailed t test calculator differ from a two tailed one?
A one-tailed test checks for a difference in only one direction, while two-tailed checks both directions. One-tailed tests have a lower critical value, making them easier to reach significance with, but they require a directional hypothesis set in advance.
Is a t test calculator with mean and standard deviation accurate for small samples?
Yes, that's exactly the scenario the t-distribution was designed for, as opposed to the z-test which assumes a known population standard deviation and works best with larger samples.
Run the numbers on a few of your own datasets and the formula stops feeling abstract fast, it just becomes the thing you check before trusting any claim about a difference being "real."