What is a Shapiro–Wilk Test Calculator?
The Shapiro–Wilk test checks whether a sample could plausibly have come from a normal distribution. Its statistic W compares the ordered data with the values a normal sample of the same size is expected to produce. W near 1 means a close match; a p-value at or below α means the data depart from normality by more than chance alone would explain.
What the Shapiro–Wilk Test Calculator does
This free online Shapiro–Wilk test calculator takes between 3 and 5,000 raw values and returns the W statistic, its p-value (Royston’s method, the one R and SciPy use), a plainly worded verdict and a normal Q–Q plot. It also reports the mean, standard deviation, skewness and excess kurtosis so you can see what kind of departure, if any, is behind the result, and it lists the weights that go into W.
People usually reach for this test before a procedure that assumes normality, such as a t-test on a small sample, a control chart or a capability study, or when checking the residuals of a regression or ANOVA. Among the common normality tests it has the best power across a wide range of alternatives, which is why it is the default recommendation for small and medium samples. For comparing data with a distribution other than the normal, or two samples with each other, use the Kolmogorov–Smirnov Test Calculator.
How to use the Shapiro–Wilk Test Calculator
- Paste your measurements into Data values, separated by commas, spaces or new lines. Enter the raw observations (3 to 5,000 of them), not means or a frequency table.
- Set the Significance level (α). Use 0.05 unless your field has another convention.
- Click Calculate and read W and the p-value. If p ≤ α the test rejects normality; if p > α it found no evidence against it.
- Check the normal Q–Q plot, skewness and kurtosis to see what the departure looks like (skew, heavy tails, a single outlier) and whether it is large enough to matter.
- Open the step-by-step solution to see the ordered data, the normal scores, the numerator b², the sum of squares and the transformation that turns W into a p-value.
Shapiro–Wilk test formula
W is the squared correlation-like ratio between the ordered data and the normal scores they should follow:
| Symbol | Meaning |
|---|---|
| x₍ᵢ₎ | the i-th smallest value in the sample |
| aᵢ | weights built from the normal scores mᵢ, scaled so that Σaᵢ² = 1 and with a₁ = −aₙ |
| x̄, n | sample mean and sample size |
| μ, σ | mean and standard deviation of ln(1 − W) for normal data, from Royston’s polynomials in ln n |
| Φ⁻¹ | inverse of the standard normal cumulative distribution function |
The numerator is the square of the best estimate of the spread you can build from the ordered values if they are normal; the denominator is the usual sum of squares, which makes no such assumption. The two agree (W ≈ 1) only when the Q–Q plot is straight.
The weights and p-value follow Royston’s 1995 algorithm (AS R94), so results match R’s shapiro.test and SciPy’s shapiro. For 4 ≤ n ≤ 11 the transformation is −ln(γ − ln(1 − W)) with γ = −2.273 + 0.459n. The approximation is calibrated for n up to 5,000.
Skewness and excess kurtosis are the bias-adjusted sample versions (G₁ and G₂), the same figures Excel’s SKEW and KURT return.
Sources: Shapiro and Wilk (1965), An analysis of variance test for normality, Biometrika 52, 591–611; Royston (1995), Remark AS R94, Applied Statistics 44, 547–551; the NIST/SEMATECH e-Handbook, section 7.2.1.3.
Worked example
Worked example: tensile strength of 20 specimens
Problem. Twenty test specimens broke at these loads (MPa): 51.3, 55.7, 51.9, 53.4, 46.5, 47.0, 52.3, 43.6, 60.7, 50.2, 43.3, 45.6, 52.5, 52.9, 49.8, 52.0, 48.8, 47.1, 50.8, 45.9. Before computing a t-based confidence interval, is it reasonable to treat the strengths as normal at α = 0.05?
- 01Hypotheses: H₀: the strengths come from a normal distribution; H₁: they do not.
- 02Sort the data from 43.3 up to 60.7. The summary statistics are x̄ = 50.065 and s = 4.2398 (s² = 17.9761).
- 03Normal scores: m₁ = Φ⁻¹(0.625/20.25) = Φ⁻¹(0.0309) = −1.8682, up to m₂₀ = 1.8682. After Royston’s rescaling the largest weights are a₂₀ = 0.4734 and a₁₉ = 0.3217, mirrored by a₁ = −0.4734 and a₂ = −0.3217.
- 04Numerator: b = Σ aᵢ x₍ᵢ₎ = 18.0919, so b² = 327.3180.
- 05Denominator: SS = Σ (xᵢ − x̄)² = (n − 1)s² = 341.5455.
- 06W = 327.3180 / 341.5455 = 0.9583.
- 07p-value: ln(1 − W) = ln(0.0417) = −3.1783. For n = 20, μ = −3.1642 and σ = 0.4962, so z = (−3.1783 + 3.1642) / 0.4962 = −0.0284 and p = P(Z > −0.0284) = 0.5113.
Answer. Because p = 0.5113 > 0.05, do not reject H₀. The sample gives no evidence against normality, and the Q–Q plot is close to straight apart from the single high value of 60.7, so a t-based interval is reasonable. With only 20 values this is “no evidence against”, not proof.
How to interpret the Shapiro–Wilk test: W and the p-value
W is a number between 0 and 1 that measures how straight the normal Q–Q plot is. Think of it as close to the squared correlation between the ordered data and the normal scores: W = 1 means the points fall exactly on a line, and skew, heavy tails or outliers pull it down. There is no universal cut-off for W, because how low it can go by chance depends heavily on n. A W of 0.93 is ordinary for 10 normal values but a clear rejection for 200.
The p-value does that adjustment for you. It is the probability that a truly normal sample of your size would produce a W as low as yours or lower. The test is one-sided: only low values of W count as evidence against normality.
| Result | What it means | What it does not mean |
|---|---|---|
| p ≤ α | The data are unlikely to be a sample from a normal distribution. | That the departure is large or that normal-theory methods will fail. With big samples, trivial departures are significant. |
| p > α | No evidence against normality; the sample is compatible with a normal population. | That the population is normal. Small samples often pass even when the population is clearly skewed. |
Critical values of W by sample size
If you only have W from a table or a printout, compare it with the critical value for your n: reject normality when W is below it. The values below come from the same Royston approximation the calculator uses for its p-value, so they agree with R and SciPy. They differ from Shapiro and Wilk’s original 1965 table in the third decimal, because that table used different weights.
The table also shows why W alone is hard to read: a W of 0.93 is unremarkable at n = 15 but a clear rejection at n = 100.
| n | Critical W at α = 0.05 | Critical W at α = 0.01 |
|---|---|---|
| 5 | 0.775 | 0.702 |
| 10 | 0.845 | 0.787 |
| 15 | 0.882 | 0.833 |
| 20 | 0.904 | 0.866 |
| 30 | 0.930 | 0.903 |
| 50 | 0.954 | 0.937 |
| 100 | 0.975 | 0.965 |
| 200 | 0.986 | 0.982 |
| 500 | 0.994 | 0.992 |
| 1,000 | 0.997 | 0.996 |
Shapiro–Wilk vs other normality tests and visual checks
These tools answer slightly different questions and work best together. A test gives a yes/no answer adjusted for sample size; a plot shows what is wrong and how badly. In simulation studies such as Razali and Wah (2011), Shapiro–Wilk had the highest power of the four tests compared, with Anderson–Darling close behind and Lilliefors and Kolmogorov–Smirnov well back.
| Method | How it works | Best for | Watch out for |
|---|---|---|---|
| Shapiro–Wilk | Compares ordered data with expected normal order statistics (W). | Testing normality with 3 to 5,000 values; the most powerful general-purpose choice. | Tests normality only. Sensitive to ties from rounding. Over-sensitive with very large n. |
| Kolmogorov–Smirnov | Largest vertical gap D between the empirical CDF and a reference CDF. | Comparing data with a fully specified distribution of any shape, or two samples with each other. | Weak in the tails, and invalid for normality when μ and σ are estimated from the same data (the p-value is far too large unless the Lilliefors correction is used). |
| Anderson–Darling | Weighted squared distance between the empirical CDF and the fitted normal CDF, with extra weight in the tails. | Normality checks where tail behaviour matters; power close to Shapiro–Wilk. | Needs critical values adjusted for estimated μ and σ (Stephens). Not offered on this site. |
| Lilliefors | The Kolmogorov–Smirnov D with critical values corrected for estimating μ and σ from the data. | A K–S-style normality test that is valid with estimated parameters. | Less powerful than Shapiro–Wilk and Anderson–Darling, especially in the tails. |
| Q–Q plot, histogram, box plot | You judge the shape by eye. | Seeing the type and size of a departure; every sample size. | Subjective, and small samples look ragged even when they are normal. |
How to read the normal Q–Q plot
The plot puts the normal scores on the horizontal axis and your ordered data on the vertical axis. Normal data follow the line x̄ + s·z. The way the points leave the line tells you the shape:
- Curved like a smile (both ends above the line): right skew, a long tail of high values.
- Curved like a frown (both ends below the line): left skew.
- S-shape, low end below and high end above the line: heavier tails than normal.
- Reverse S, low end above and high end below: lighter tails than normal, as in uniform or bounded data.
- One or two points far off the line at an end: outliers; the rest of the data may be perfectly normal.
- Horizontal steps: ties from rounding or a discrete scale.
Shapiro–Wilk test in Excel, R, Python, SPSS and Stata
Excel has no built-in Shapiro–Wilk function, so the quickest route from a spreadsheet is to copy the column and paste it into the calculator above. The statistical packages below all have the test built in. R, SciPy and this calculator use Royston’s algorithm and agree to rounding; SPSS and Stata may differ slightly in the last decimals of the p-value.
| Software | How to run it | Notes |
|---|---|---|
| Excel | No built-in function. Paste the column into this calculator, or use an add-in such as Real Statistics or XLSTAT. | Excel’s SKEW and KURT give the same skewness and kurtosis this page reports. |
| R | shapiro.test(x) | Accepts 3 to 5,000 values; prints W and the p-value. |
| Python | scipy.stats.shapiro(x) | Returns the statistic and p-value; warns above 5,000 values. |
| SPSS | Analyze → Descriptive Statistics → Explore → Plots → tick “Normality plots with tests”. | The Shapiro–Wilk column of the “Tests of Normality” table. |
| Stata | swilk x | Reports W, V, z and Prob > z. |
What to do if normality is rejected
A rejection is a prompt to look closer, not an automatic ban on normal-theory methods. Work through these options in order:
- Look at the size of the departure. Check the Q–Q plot, a histogram and the skewness and kurtosis. Mild skew matters little for a t-test on 30 or more values, because the sampling distribution of the mean is close to normal anyway.
- Check for outliers and data errors. A single mistyped value can cause the rejection. A box plot shows them quickly. Correct genuine errors; do not delete inconvenient values.
- Transform the data. A log, square-root or reciprocal transformation often straightens right-skewed measurements such as times, concentrations and incomes. Re-run the test on the transformed values.
- Switch to a method that does not assume normality. Rank-based tests (Wilcoxon signed-rank, Mann–Whitney U, Kruskal–Wallis), Spearman’s correlation in place of Pearson’s, or a bootstrap confidence interval.
- Use a more robust version of the same method. For example Welch’s t-test or a trimmed mean when heavy tails are the problem.
- Test the right thing. For regression and ANOVA the normality assumption applies to the residuals, not to the raw response. Run the test on the residuals.
Common use cases
- Checking the normality assumption before a t-test, confidence interval or ANOVA on a small sample.
- Testing whether regression or ANOVA residuals are normally distributed.
- Verifying normality before a process capability (Cp, Cpk) study or an individuals control chart.
- Deciding whether to report mean ± SD or median and interquartile range in a paper.
- Checking whether a log or square-root transformation has made skewed data acceptably normal.
Assumptions and limitations
- It tests normality only. To compare data with a uniform, exponential or other fully specified distribution, use the Kolmogorov–Smirnov Test Calculator or, for counts in categories, the Chi-Square Goodness of Fit Calculator.
- Independent, continuous observations. The values must be independent draws measured on a continuous scale. Ties from rounding, ratings or counts lower W and can produce false rejections.
- Sample size cuts both ways. Below about 10 values the test rarely detects anything; above a thousand or so it flags departures that have no practical effect. Always look at the Q–Q plot as well.
- A non-significant result is not proof. Failing to reject H₀ means the data are compatible with normality, not that the population is normal.
- Range of n. Royston’s p-value approximation is calibrated for 3 ≤ n ≤ 5,000. For larger datasets rely on plots, skewness and kurtosis.
Frequently asked questions
What does the Shapiro–Wilk W statistic tell you?
What is the null hypothesis of the Shapiro–Wilk test?
Does a p-value above 0.05 prove that my data are normal?
What sample size do I need for the Shapiro–Wilk test?
Should I use Shapiro–Wilk or Kolmogorov–Smirnov to test normality?
Do I have to test normality before a t-test or ANOVA?
Can you do a Shapiro–Wilk test in Excel?
How do I report a Shapiro–Wilk test result?
Why does the test reject normality for my large dataset when the histogram looks normal?
Cite this page
Statculator. (2026, November 14). Shapiro–Wilk Test Calculator. Retrieved November 14, 2026, from https://statculator.com/hypothesis-tests/shapiro-wilk-test-calculator/