Free tool T-test calculator with the t-test formula
Is the difference between two averages real, or could it be noise? Paste the raw numbers or type in each group’s mean, standard deviation and size. You get the t-statistic, p-value, a confidence interval for the difference and an effect size, with every step of the arithmetic shown.
- Welch, Student, paired, one-sample
- CI of the difference + Cohen’s d
- Runs locally
Pick the test, then enter the data
Two separate groups of people: Welch (the safe default) or Student. The same people measured twice: paired. One group against a fixed number: one-sample.
Welch does not assume equal variances and is the safer default for two independent groups.
Raw data if you have the individual values; summary statistics if you only have mean, SD and n.
One number per line, or separated by spaces, commas or tabs. Pasting a spreadsheet column works.
For a paired test, keep the same order as A: the first value of A pairs with the first value of B.
Negative values are fine.
The sample SD (n − 1 in the denominator), not the standard error.
At least 2.
Usually 0: “no difference”. For a one-sample test, the value you compare the mean with.
Sets the confidence interval and α = 1 − level for the verdict.
Result
Significant at α = 0.05: a difference this large would be unusual if there were no real difference.
t-statistic
3.834
Difference ÷ standard error.
p-value (two-tailed)
0.0011
A difference in either direction.
Degrees of freedom
18.95
p-value (one-tailed)
0.0006
Only if the direction was fixed beforehand.
Difference A − B
8.9167
Standard error
2.3256
95% CI
4.0482 ~ 13.785
For the difference (or the mean).
Cohen’s d
1.57
large (≥ 0.8)
t(18.95) = 3.834, p = 0.0011, 95% CI [4.04819, 13.7851]Copy into a report. Format: t(df) = t, p, confidence interval of the difference.
Groups
What the calculator read from your input.
| Group | n | Mean | SD | Standard error |
|---|---|---|---|---|
| A | 12 | 48.75 | 6.74368 | 1.94673 |
| B | 12 | 39.8333 | 4.40729 | 1.27228 |
How it was calculated
The formula for the selected test with your numbers in it.
| Step | Calculation |
|---|---|
| Standard error | SE = √(s₁²/n₁ + s₂²/n₂) = √(6.74368²/12 + 4.40729²/12) = 2.32561 |
| t-statistic | t = (x̄₁ − x̄₂ − Δ₀) ÷ SE = (48.75 − 39.8333 − 0) ÷ 2.32561 = 3.83412 |
| Degrees of freedom (Welch–Satterthwaite) | df = (s₁²/n₁ + s₂²/n₂)² ÷ [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ] = 18.9469 |
| Two-tailed p-value | p = P(|T| ≥ 3.83412), df = 18.9469 → 0.00112386 |
| 95% confidence interval | 8.91667 ± 2.09342 × 2.32561 = [4.04819, 13.7851] |
| Cohen’s d | d = (x̄₁ − x̄₂ − Δ₀) ÷ sₚ = 8.91667 ÷ 5.69656 = 1.56527 |
Share these inputs: the values go after the # in the link, so they never reach a server.
https://tapcub.com/tools/t-test-calculator
Version v1.0Updated Update history
Four numbers that answer one question
The question is “could this difference be chance?”. Each output answers part of it; read them together.
t-statistic
The difference measured in standard errors. In the example, group A’s task times are 3.83 standard errors above group B’s. The bigger |t| is, the harder the gap is to explain as noise. The sign only says which group is higher.
p-value
If the two groups really had the same mean, how often would random sampling produce a gap at least this large? Here 0.0011, about once in 900 tries. Below α (usually 0.05) the result is called significant. It is not the probability that the groups are the same.
Confidence interval
The range of differences the data are compatible with: 4.05 to 13.79 seconds. If it excludes 0, the test is significant at the matching level. Its width tells you how precisely the difference is known, which the p-value alone does not.
Cohen’s d
The difference divided by the standard deviation, so it does not depend on the sample size. Rough guide (Cohen, 1988): 0.2 small, 0.5 medium, 0.8 large. With thousands of users a tiny d can be significant; decide whether it matters in practice.
Significance is not importance. A 0.3-second faster checkout can be highly significant and still not worth shipping; a large effect in a small pilot can miss significance and still deserve a proper test.
Three choices, then read the verdict
The calculator recomputes as you type, so you can try both versions of the test and see whether the conclusion changes.
-
1
Choose the test
Different people in each group (A/B test, two cohorts): Welch. Same people twice (before / after, two conditions per user): paired. One group against a target or a published value: one-sample.
-
2
Enter the data
Paste each group’s values, one per line or separated by spaces. Only have a dashboard summary? Switch to summary statistics and type the mean, SD and n.
-
3
Read p, the interval and d together
p says whether the gap is likely real, the interval says how big it might be, d says whether it is big relative to the spread. Copy the report line for your write-up.
Same idea, different standard error
Every t-test divides an observed difference by its standard error and reads the p-value from a t distribution. What changes between versions is how the standard error and the degrees of freedom are worked out.
- Welch: each group keeps its own variance; df from the Welch–Satterthwaite formula
- Student: one pooled variance; df = n₁ + n₂ − 2
- Paired and one-sample: a single list (differences or values); df = n − 1
- One-tailed p = two-tailed p ÷ 2, valid only for a direction chosen before seeing the data
- Cohen’s d uses the pooled SD for two groups and the SD of the differences (d_z) for paired data
Welch (unequal variances)
t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂)
df = (s₁²/n₁ + s₂²/n₂)² ÷ [ (s₁²/n₁)²/(n₁−1) + (s₂²/n₂)²/(n₂−1) ]
Student (pooled variance)
t = (x̄₁ − x̄₂) ÷ [ sₚ √(1/n₁ + 1/n₂) ]
sₚ² = ((n₁−1)s₁² + (n₂−1)s₂²) ÷ (n₁ + n₂ − 2)
Paired / one-sample
t = (d̄ − Δ₀) ÷ (s_d ÷ √n) or (x̄ − μ₀) ÷ (s ÷ √n)
df = n − 1
Confidence interval and effect size
difference ± t* × SE d = difference ÷ SD
t* is the two-tailed critical value at 1 − confidence level
Two checkout designs, one usability test
Twelve participants completed checkout on the old design (A) and twelve different participants on the new one (B). Times in seconds. Because the groups are different people, the right test is Welch’s.
| Step | Group A (old) | Group B (new) | Combined |
|---|---|---|---|
| n, mean | 12, 48.75 s | 12, 39.83 s | difference 8.92 s |
| Sample SD | 6.74 | 4.41 | — |
| s² ÷ n | 3.790 | 1.619 | sum 5.409 |
| Standard error | — | — | √5.409 = 2.326 |
| t | — | — | 8.92 ÷ 2.326 = 3.834 |
| Welch df | — | — | 18.95 |
| p (two-tailed) | — | — | 0.0011 |
| 95% CI | — | — | 4.05 to 13.79 s |
| Cohen’s d (pooled SD 5.70) | — | — | 1.57, large |
The same data in a Student t-test give df = 22 and p = 0.0009; treated (wrongly) as paired, p = 0.0036. For two independent groups, Welch is the safe default. Example data.
Where t-tests go wrong
The arithmetic is mechanical. The mistakes happen in choosing the test and preparing the numbers.
Running an independent test on paired data
Before / after measurements on the same users are paired. Ignoring the pairing throws away the fact that each person is their own control, and usually hides real effects.
Typing the standard error into the SD box
Dashboards often show “± SE”. The calculator divides by √n itself; entering SE makes the result look far more significant than it is.
Defaulting to Student’s test
The pooled test is only exact when variances are equal. With unequal SDs and unequal group sizes it can be badly wrong; Welch loses almost nothing when variances are equal.
Testing heavily skewed data such as revenue per visitor
Most visitors spend 0 and a few spend a lot. With small samples the t-test is unreliable there; use larger samples, a transformation or a non-parametric test such as Mann–Whitney.
Get the two groups without a spreadsheet
A t-test needs clean groups and a clean metric. TapCub lets you define both once and compare them on any report.
Compare segments
Put any two segments side by side on a funnel or retention curve, with the difference per step.
Learn moreDistributions and percentiles
See how any numeric property or event count is spread, not just its average.
Learn moreBots counted separately
Crawlers inflate counts and distort averages. TapCub keeps them out of your reports by default.
Learn moreT-test questions
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
What is the t-test formula?
Every t-test is t = observed difference ÷ its standard error, with the p-value read from a t distribution. Welch: t = (x̄₁ − x̄₂) ÷ √(s₁²/n₁ + s₂²/n₂). Student: the same difference ÷ sₚ√(1/n₁ + 1/n₂), with pooled variance sₚ² = ((n₁ − 1)s₁² + (n₂ − 1)s₂²) ÷ (n₁ + n₂ − 2). Paired and one-sample: t = (d̄ − μ₀) ÷ (s ÷ √n), df = n − 1. Use it for averages of measured values; for counts or yes/no outcomes use a chi-square test.
How do I calculate a t-value by hand?
Work out each group’s mean, SD and n. For Welch’s test, the standard error is √(s₁²/n₁ + s₂²/n₂); t is the difference in means divided by that. With the example data: SE = √(6.74²/12 + 4.41²/12) = 2.326 and t = 8.92 ÷ 2.326 = 3.834. The “How it was calculated” table in the tool shows the same steps for your numbers.
Should I use Welch’s or Student’s t-test?
Welch’s, unless you have a specific reason to assume equal variances. When the variances really are equal, the two give almost the same answer; when they are not, Student’s test can be badly off, especially if the smaller group has the larger SD. R and many statistics texts now use Welch by default.
When is a t-test paired?
When every value in one group has a natural partner in the other: the same user before and after a change, the same page on two days, the same customer rating two designs. Enter both lists in the same order. If the two groups are different people, use an independent (Welch) test.
What is the difference between one-tailed and two-tailed?
A two-tailed test counts a difference in either direction; a one-tailed test only one direction, and its p-value is half the two-tailed one. Choose one-tailed only if you decided the direction before collecting data and would treat a difference the other way as no effect.
How large a sample do I need?
Enough to detect the smallest difference that matters. Work it out before the test, not after. For conversion rates, the A/B test sample size calculator does this. Stopping early when p dips below 0.05 inflates false positives.
My data are not normally distributed. Can I still use a t-test?
Often, yes. The t-test relies on the mean being roughly normal, and with about 30 or more per group that holds for most data by the central limit theorem. For small samples of very skewed data (revenue, session length with long tails), consider a transformation or a non-parametric test.
What does Cohen’s d tell me that p does not?
How big the difference is relative to the spread of the data. p depends heavily on sample size; d does not. A d of 0.05 can be significant with 10,000 users per group and still be too small to care about.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
From one test to a reliable decision
A t-test answers one question about one metric. Before you act on it, check that the groups were split cleanly and that you collected enough data.