statcompute

Hypothesis tests

Shapiro-Wilk Normality Test Calculator

Test whether a sample could plausibly have come from a normal distribution — and see, in the Q-Q plot, exactly how it departs if it did not.

Also called shapiro wilk test calculator, normality test calculator, W test calculator.

Updated August 2026Runs in your browser — nothing is uploadedVerified against R
One value per line, or separated by commas, tabs or spaces. A header row is ignored.
Conventionally 0.05. Decide before you look at the data.

The calculation runs in your browser, so this box needs JavaScript. The formula, the worked example and the interpretation below do not.

01

How to read this result

W is a correlation. It measures how closely the ordered data track the values a normal sample of the same size would be expected to produce. W = 1 is a perfect match; the further below 1, the worse the fit.

A small p-value rejects normality. This is the reverse of the usual reading: here you are generally hoping not to reject, because normality is the assumption you want to be able to make.

Sample size dominates this test. With n = 2,000, a departure far too small to affect a t-test will be flagged as highly significant. With n = 15, real skew will often pass unnoticed. That makes W a poor gate and a decent description.

The Q-Q plot is the part to look at. It shows how the data depart: a bend at both ends means heavy or light tails, a curve in one direction means skew, one point off the line means an outlier. Those three problems have completely different remedies, and the p-value cannot tell them apart.

02

The formula

W=(i=1naix(i))2i=1n(xix¯)2
x(i)
the i-th smallest value in the sample
ai
coefficients derived from the expected normal order statistics
x¯
the sample mean

The coefficients come from Royston's AS R94 approximation, and the p-value from his normalising transformation of W. This is the same algorithm R's shapiro.test uses.

03

Worked example

Eleven measurements with one very large value

Eleven measurements, sorted. Ten of them sit between 148 and 195; the eleventh is 236. Is that consistent with a normal distribution?

148, 154, 158, 160, 161, 162, 166, 170, 182, 195, 236

  1. Sort the data and compute the expected normal order statistics for n = 11.
    m_i = Φ⁻¹((i − 0.375)/(11 + 0.25))
  2. Normalise them and apply Royston's polynomial corrections to the two extreme coefficients.
    a = (−0.560, −0.331, −0.226, −0.143, −0.070, 0, 0.070, …)
  3. W is the squared correlation between the sorted data and those coefficients.
    W = 0.7888
  4. Transform W to a z-score using Royston's small-sample formula (n between 4 and 11) and read the upper tail.
    p = 0.0067
W 0.789p 0.0067skewness 1.96Conclusion normality is rejected

The Q-Q plot shows why: the top two points sit far above the line while the rest track it closely. That is right skew driven by one extreme value, and the remedy — a log transform, a rank-based test, or investigating that observation — depends on what the 236 actually is.

Checked against R's shapiro.test.

The calculator above is loaded with these numbers by the Load the worked example button.

04

Assumptions, and when to use something else

The test assumes independent observations and is defined for 3 to 5,000 of them. It has no other requirements — it is a test of an assumption rather than a test that makes one.

The important caveat is about how it is used. Choosing which test to run based on a preliminary normality test is a data-dependent decision that distorts the error rate of whatever you run next. The better policy is to decide from the design and the sample size: with small samples prefer robust methods regardless, and with large ones the t-test and ANOVA are robust enough that mild non-normality does not matter.

  • Normality is rejected and you were comparing two groupsMann-Whitney U testAssumes nothing about the distribution's shape.
  • Normality is rejected and you were comparing three or more groupsKruskal-Wallis testThe rank-based version of one-way ANOVA.
  • You also need to check equal variancesLevene's testThe other assumption behind the pooled t-test and classic ANOVA.
  • You want to see the shape rather than test itHistogram makerOften more informative than any normality test, especially with a moderate sample.
05

Questions people ask

What p-value means my data are normal?

None of them. A large p-value means the test failed to detect non-normality, which with a small sample is close to no information at all. Normality is never established by a test — it is judged from the Q-Q plot, the sample size, and how sensitive your chosen method is to departures.

My sample is large and the test rejects. Does that matter?

Usually much less than it appears. At n = 1,000 the test detects departures far too small to affect a t-test, and the central limit theorem has already made the sample mean nearly normal. Judge by the Q-Q plot and by the size of the departure, not by p.

Shapiro-Wilk or Kolmogorov-Smirnov?

Shapiro-Wilk, for normality. It is substantially more powerful, and the Kolmogorov-Smirnov test is invalid when the mean and variance are estimated from the same data (the Lilliefors correction fixes that, but is still weaker).

What is the maximum sample size?

Royston's algorithm is defined up to 5,000 observations, and the calculator refuses beyond that rather than extrapolating. At that size a normality test is not the right tool anyway — read the Q-Q plot.