How to use the shapiro-wilk normality test calculator
- Paste 3 to 5,000 numbers separated by commas, spaces or new lines.
- Read the W statistic and the p value. W near 1 means the sorted values line up with what a bell-shaped sample would give.
- Check the table of sorted values and normal scores (shown for up to 40 values) and the normal score correlation.
- Treat a small p value as a sign the shape departs from normal, and a large one as no clear sign of departure.
Formula
W = (sum of a_i x (i-th smallest value))^2 / sum of (x - mean)^2
a = weights built from normal order statistics m_i = Phi^-1((i - 0.375) / (n + 0.25))
Royston (1992): y = ln(1 - W), then z = (y - mu(n)) / sigma(n)
p = upper tail of the standard normal beyond z (exact formula for n = 3)
mu and sigma are polynomial approximations in n (or in ln n for n of 12 or more). The weights are antisymmetric and scaled so that their squares add up to 1.
Ten measurements
The values 2.1, 3.4, 1.9, 5.6, 4.4, 3.8, 2.7, 6.1, 4.0, 3.3 have mean 3.73 and standard deviation 1.3744. The Shapiro-Wilk statistic is W = 0.9540, and Royston's transformation gives p = 0.7165.
A second sample, 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79, grows steadily faster and is skewed to the right. It gives W = 0.9066 and p = 0.1648, lower but, with only 13 values, not below the usual 0.05 level.
How to read the result
The Shapiro-Wilk test compares your sorted values with the values a bell-shaped sample of the same size would have. W equals 1 for a perfect match and drops as the shape departs. The p value tells you how surprising that W would be if the data really came from a normal distribution.
Failing to reject normality is not proof of normality, especially with a handful of values. With a few thousand values, tiny harmless departures give very small p values. The normal score correlation shown here is a plain measure of how straight a normal probability plot would be, and it can help you judge the size of a departure.
Where it fits among related checks
Skewness and kurtosis describe the kind of departure: see the skewness and kurtosis calculator. If normality fails, rank-based methods such as the Mann-Whitney test or the Kruskal-Wallis test avoid the assumption, and the outlier calculator can show whether a few extreme values cause the problem.
Many methods need normal residuals or normal averages, not normal raw data, so check the quantity that the method actually assumes.
Assumptions and limits
- The values are independent measurements from one population, with no repeated entries of the same observation.
- The sample has between 3 and 5,000 values and they are not all equal.
- The p value uses Royston's approximation, which is accurate for the whole supported range.
- Ties are allowed, but many repeated values (for example rounded data) lower W.
Frequently asked questions
What p value counts as non-normal?
There is no universal cut point. Many analysts compare p with 0.05, but with small samples the test has little power and with large samples it flags trivial differences. Look at W, the sample size and a plot together.
Why does the test need at least 3 values?
With 1 or 2 values any shape is possible, so no test is meaningful. At exactly 3 values the p value has a closed formula, and the test has almost no power.
Should I test the raw data or the residuals?
Test whatever the method assumes. For regression or ANOVA that is the residuals, and for a t test on one group it is the values in that group. Testing pooled raw data from different groups can show non-normality that the model does not care about.
How does it differ from the Jarque-Bera test?
Jarque-Bera looks only at skewness and kurtosis and needs large samples. Shapiro-Wilk uses the full ordered sample and has better power in small and medium samples.