Null Sampling of t: T-Distribution Simulator
Draw samples and watch the histogram of t build up against the t curve (solid) and the normal curve (dashed). Compare n = 3 with n = 30, then use Replay to run the same draws again or Reset to start over.
Simulate t with the null hypothesis true
Sample size:
Population: normal, mean 100, SD 15, so H₀: μ = 100 is true. Histogram bins are 0.25 wide and scaled as a density, so the bars match the curves. The ±t* lines (red) use t* = 2.776 for two-tailed α = 0.05 at df = n − 1, the same value as the t-table on our homepage.
Worked example
Question (illustrative numbers): a sample of n = 5 gives 112, 96, 104, 121 and 99. Test H₀: μ = 100 at two-tailed α = 0.05.
Step 1. x̄ = 106.4 and s = 10.16, so the standard error is s / √5 = 4.545.
Step 2. t = (106.4 − 100) / 4.545 = 1.408.
Step 3. df = 5 − 1 = 4. In the two-tailed t-table, row 4, column α = 0.05: t* = 2.776.
Decision: |1.408| < 2.776, so do not reject H₀ (two-tailed p ≈ 0.232). In the simulator with n = 5, a t this large or larger shows up often even though the null is true.
FAQ
What does the t-distribution simulator show?
Each draw takes a random sample of n values from a normal population with mean 100 and SD 15. That makes the null hypothesis μ = 100 true. The tool computes t = (x̄ − 100) / (s / √n) for each sample and adds it to the histogram. As the draws pile up, the histogram follows Student’s t curve with n − 1 degrees of freedom, not the normal curve.
Why does t have heavier tails than z?
The sample SD s changes from sample to sample. When a small sample happens to have a small s, t gets large. That pushes extra results into the tails, and the effect is strongest when n is small. With n = 30 it is barely visible.
How often does |t| go past 1.96 when the null is true?
More often than 5% for small samples. For df = 2 it happens 18.9% of the time, for df = 4 12.2%, for df = 9 8.2% and for df = 29 6.0%. Past the t-table critical value t* the rate is exactly 5% at every df. That is why tests on small samples use t* from the t-table, not 1.96.
When can I use z instead of t?
As df grows, t* moves toward z* = 1.960. For 95% two-tailed, t* is 2.776 at df = 4, 2.262 at df = 9, 2.045 at df = 29 and 1.960 in the ∞ row. The t vs z critical values chart shows the whole curve.
Are the samples real data?
No. They are pseudo-random draws made in your browser from a normal population, so the null hypothesis is true by design. Replay repeats the same draws (same random seed), and Reset starts a fresh run with a new seed. Changing n also starts fresh.
Where do I get t* for my own test?
Use the t-table calculator or the printable t* pocket card with df = n − 1 for a one-sample test. For a full t-test with a p-value, see the t-test calculator on StatCalculators.
Related t-table pages
- T table (one-tailed and two-tailed): t* for every df
- T-table calculator and Student t-value calculator
- T vs z critical values chart and t-score vs z-score
- Printable t* pocket card · degrees of freedom for the t-table
- Practice: DF Race and Guess the Critical t
- For z: z-table.com and its Pin the Area game · full t-tests at StatCalculators