The formula
How to calculate t test
A t-test asks whether the difference between two group means is larger than sampling variation would explain. Welch's version, used here, does not assume the groups have equal variance — which is the safer default.
The degrees of freedom formula looks forbidding but simply discounts for unequal variances and unequal group sizes. With similar groups it lands close to n₁ + n₂ − 2.
Here is what each field means:
- Group 1 mean
- Group 1 standard deviation
- Group 1 size
- Group 2 mean
- Group 2 standard deviation
- Group 2 size
Results appear immediately — there is nothing to submit. Changing a field rewrites the link, so you can share the exact scenario you are looking at.
Where more decimal places matter than the fields above display, the underlying calculation is not rounded until the final figure is shown — the precision used internally is higher than what is printed, which matters for anyone chaining this result into a further calculation of their own.
Why t test matters
The formula behind t test is standard and appears in the same form across textbooks and reference material; what a calculator adds is speed and the ability to see instantly how the result responds to a change in any one of the inputs, which is far slower to do by hand.
It is useful for checking a manual calculation before submitting or acting on it, and equally useful for building intuition about a formula by adjusting one input at a time and watching how the result moves in response — a much faster way to understand a relationship than working through several versions of the algebra by hand.
This calculation sits in a long tradition of being done first by hand with tables and slide rules, then with a scientific calculator, and now with a page like this one — the underlying mathematics has not changed at any point in that history, only the speed and convenience of getting from the inputs to the answer. Understanding the formula itself, shown above, is still worth doing even when a tool computes it instantly, since it is what makes the result trustworthy rather than just fast.
Where a calculation like this one is part of a larger piece of work, it is generally worth running it with a round, easy-to-check set of numbers first — inputs of exactly 1, 10 or 100 — purely to confirm the formula is being applied correctly, before switching to the real measured values the actual result depends on.
Worked example
Here is the calculation with the starting values:
- Group 1 mean: 74.2
- Group 1 standard deviation: 11.5
- Group 1 size: 40
- Group 2 mean: 69.8
- Group 2 standard deviation: 12.9
- Group 2 size: 38
That gives:
- t statistic: 1.5871
- Welch degrees of freedom: 73.9623
- Approximate two-tailed p-value: 0.1125
The figures above are the calculator's own default values, shown purely so the working is visible rather than hidden — the same steps apply exactly to your own numbers, entered in the fields at the top of this page.
Reading the result
A t statistic beyond roughly ±2 is significant at the 5% level for moderate sample sizes. The p-value shown uses a normal approximation, which is close for degrees of freedom above about 30 and too small below that.
Where this goes wrong. A significant difference is not necessarily a meaningful one. Report the effect size — the raw difference, or a standardised measure such as Cohen's d — alongside the test.
A result that is wrong by an exact factor of ten, a hundred or a similar round number is almost always a units error rather than a mistake in the formula itself — checking each input against the unit stated beside it is the fastest way to track it down.
Welch, almost always. It performs as well as Student's when variances are equal and much better when they are not, so there is little reason to test for equal variances first.
Use a paired t-test instead, which works on the differences within each pair. That removes between-subject variation and is considerably more powerful for before-and-after designs.
It returns t statistic. With 74.2 group 1 mean, 11.5 group 1 standard deviation and 40 group 1 size, that comes to 1.5871. Change any field and the figure moves with it.
Generally, no more than the least precise input justifies — a result reported to six decimal places from inputs measured to two significant figures is implying a precision the calculation does not actually have. The calculator shows full precision so you can round appropriately for your own use.
Yes — the equation shown in the formula section above is the standard form used in textbooks and reference material for this calculation, not a simplified or approximate version.
Yes, in the sense that it applies the correct standard formula and returns an accurate result for the inputs given — but check your own course or publication's requirements for how results should be rounded, presented and referenced, since those conventions vary and are not something a calculator can know on your behalf.