One-Sample Tests and p-Value Calculator

Enter the sample mean, hypothesised mean, SD and n, the alternative and α, plus proportion and variance data, to get test statistics, p-values and a confidence interval.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Enter sample summary

    Mean, SD and n.

  2. 2
    Enter μ₀

    The hypothesised mean.

  3. 3
    Choose the alternative

    Two-sided or one-sided.

  4. 4
    Enter proportion data

    Successes, n and p₀.

  5. 5
    Enter variances

    For the F test.

About this tool

Many questions compare one sample with a fixed value: is the average fill weight 500 g, is the defect rate below 5 %, is a new method's variance different from the old one? One-sample tests answer them from summary statistics. This calculator runs the one-sample t test (and z test when the population SD is known), the one-proportion z test and the F test for two variances, with exact p-values for one- and two-sided alternatives and a confidence interval for the mean.

Who this is for

Students in statistics courses, quality engineers, researchers checking summary results and anyone reading a paper.

One-sample t test

t = (x̄ − μ₀) / (s / √n), compared with Student's t distribution with n − 1 degrees of freedom. Use it when the population SD is unknown, which is almost always.

z test

If the population SD σ is known, z = (x̄ − μ₀) / (σ / √n) uses the normal distribution.

Alternatives

- Two-sided: is the mean different from μ₀? - Less: is it smaller? - Greater: is it larger? Choose the alternative before looking at the data.

p-value and decision

The p-value is the probability, if the null hypothesis is true, of a result at least as extreme as observed. If p < α (often 0.05), reject the null hypothesis. A non-significant result is not proof that the null is true.

Confidence interval

x̄ ± t* × s/√n gives the (1 − α) confidence interval. If μ₀ lies outside the two-sided interval, the two-sided test rejects at level α.

One proportion

z = (p̂ − p₀) / √(p₀(1 − p₀)/n), adequate when n p₀ and n(1 − p₀) are at least 10. The standard error of the sample proportion is √(p̂(1 − p̂)/n).

F test for variances

F = s₁² / s₂² with (df₁, df₂) degrees of freedom. It is sensitive to non-normal data; Levene's test is more robust.

Good practice

Report the effect size and confidence interval, not only the p-value. Check normality for small samples.

Statistical and practical significance

With large samples, tiny differences become significant; with small samples, important ones may not. Always ask whether the difference matters in practice.

Report exact p-values rather than only stars.

Worked example

A sample of 25 with mean 52 and SD 5, against μ₀ = 50: t = 2.00 with 24 df and a two-sided p = 0.057, so not significant at 0.05; the 95 % CI is 49.94 to 54.06. 58 successes out of 100 against p₀ = 0.5 give z = 1.60, p = 0.11. Variances 25 (df 15) and 10 (df 20) give F = 2.5, p = 0.057.

Limits

Assumes random samples and approximate normality; not a substitute for professional statistical advice.

Worked example

Mean 52, SD 5, n 25 against 50 gives t = 2.00 and p = 0.057.

Quick facts

Frequently asked questions

When do I use a t test instead of a z test?

When the population standard deviation is unknown.

What does a p-value mean?

The probability of data this extreme if the null hypothesis were true.

Should I use a one-sided test?

Only if the direction was specified before seeing the data.

How are the p-values computed?

Exactly, from the t, normal and F distributions.

What does the confidence interval add?

The range of plausible values for the true mean.

Is my data stored?

No. Everything is calculated in your browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages