Two-Sample t-Test Calculator

This calculator performs a two-sample t-test, comparing the means of two independent groups of data to assess whether they are meaningfully different. It is one of the most widely used statistical tests, applied whenever you want to know if two groups differ: a treatment group versus a control, two products, two regions, before and after a change measured on different subjects. The t-test produces a t statistic that measures the difference between the two group means relative to the variability within the groups. A large t, well away from zero, suggests the means genuinely differ; a small t suggests any difference could be chance. This tool uses Welch's t-test, the more robust version that does not assume the two groups have equal variances, which is the recommended default in modern statistics. You paste the values for each group into the two boxes, and the calculator returns the t statistic, the mean of each group, and the Welch degrees of freedom. The results update as you type. Use it to compare two sets of measurements, for research and experiments, or for statistics study. To complete the test, compare the t statistic against the critical value from the t distribution at your significance level and the calculated degrees of freedom, or find the p-value; if the magnitude of t exceeds the critical value, the difference between the means is statistically significant. This calculator provides the t statistic and degrees of freedom, the parts that come from your data. Welch's degrees of freedom are usually not a whole number, which is normal. The test assumes the data within each group is roughly normally distributed and the two samples are independent of each other.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner
-3.9
t statistic (Welch)
Mean group 16.6
Mean group 210
Degrees of freedom7.27

Welch's t-test does not assume equal variances. t = (mean1 - mean2) / sqrt(s1²/n1 + s2²/n2). Compare against a t table at the given df. Assumes independent, roughly normal samples.

How it works

The calculator finds the mean and sample variance of each group. Welch's t statistic is the difference between the two means divided by the square root of the sum of each variance divided by its sample size. The Welch degrees of freedom come from a formula combining the two variances and sample sizes, and are usually not a whole number.

Worked example

For group 1 (5, 7, 6, 8, 7) with mean 6.6 and group 2 (9, 11, 10, 12, 8) with mean 10, the variances are about 1.3 and 2.5. Welch's t is (6.6 minus 10) divided by the square root of 1.3 over 5 plus 2.5 over 5, which is about minus 3.9, with roughly 7.27 degrees of freedom.

Related calculators

If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.

Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.

All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.

Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.

Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.

Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.

All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.

About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use

Reviewed and maintained. Last reviewed 2026-06-07 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.

© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.