Early access: free for now
Tools
All tools

Core and experimental design

ManualHow to Cite

Free tool aStat · Agriculture Statistics

Normality Test Calculator (Shapiro-Wilk)

Paste your numbers or open a spreadsheet and find out in seconds whether your data follow a normal distribution: the Shapiro-Wilk W and p value, a Q-Q plot, a histogram with the normal curve, and plain advice on what to do next.

  • Free, no sign-up
  • Your data stay on your computer
  • Realtime R in your browser
  • R script included

One column per measurement you want to test; names in the first row are optional. Blank cells are skipped.

Or start from a file

Or try an example

Files are read in your browser; nothing is uploaded.

Quick answers

What does the Shapiro-Wilk test tell you?
Whether your values could plausibly come from a normal distribution. It gives a W statistic (1 is a perfect fit) and a p value.
What does p < 0.05 mean in a Shapiro-Wilk test?
The data are probably not normal: you reject the null hypothesis of normality. A p value of 0.05 or more means there is no evidence against normality.
What is the difference between W and p?
W measures how closely your sorted values match a normal distribution (0 to 1). The p value says how surprising that W would be if the data really were normal.
Do you want the Shapiro-Wilk test to be significant?
Usually not. If you plan an ANOVA, t test or regression, you hope for p ≥ 0.05, which means no evidence that the residuals depart from normality.
Shapiro-Wilk or Kolmogorov-Smirnov?
Shapiro-Wilk for most experiments: it detects non-normality more often at the same sample size. Kolmogorov-Smirnov compares data with any fully specified distribution.
How do you check if data are normally distributed?
Look at a Q-Q plot and a histogram, check the skewness, and run a Shapiro-Wilk test. For ANOVA and regression, check the residuals rather than the raw column.
On this page
  1. Quick answers
  2. What is the Shapiro-Wilk test?
  3. W, p and the Shapiro-Wilk formula
  4. How to interpret the Shapiro-Wilk test
  5. How to check if data are normally distributed
  6. How to read a Q-Q plot
  7. Shapiro-Wilk vs Kolmogorov-Smirnov
  8. Normality for ANOVA, t tests and regression: test the residuals
  9. What to do when data are not normal
  10. How to report the Shapiro-Wilk test (APA style)
  11. Shapiro-Wilk test in R, SPSS and Excel
  12. Questions people ask
  13. Sources

What is the Shapiro-Wilk test?

The Shapiro-Wilk test is a test of normality: it checks whether a set of numbers could have come from a normal (bell-shaped) distribution. Samuel Shapiro and Martin Wilk published it in 1965, and it is the normality test most statistics programs run by default, including R, SPSS and SAS.

  • Null hypothesis (H₀): the data come from a normal distribution.
  • Alternative hypothesis (H₁): the data do not come from a normal distribution.
  • When to use it: before an analysis that assumes normality (t tests, ANOVA, linear regression, mixed models), to check the residuals; or to describe the shape of one measurement.
  • Is it parametric? It is neither: it is a goodness-of-fit test, used to decide whether parametric methods suit your data.

W, p and the Shapiro-Wilk formula

The test sorts your n values from smallest to largest, x₍₁₎ to x₍ₙ₎, and computes

W = ( Σ ai x(i) )² / Σ ( xi − x̄ )²

The weights ai come from the expected values of ordered samples from a normal distribution. The top of the fraction is a squared estimate of the spread based on the sorted values; the bottom is the ordinary sum of squares. When the data are normal the two agree and W is close to 1. Skew, heavy tails or outliers pull W down.

W alone is hard to judge, because its typical value depends on the sample size, so the test converts it to a p value. R uses Royston's 1995 algorithm, which works for 3 to 5,000 values. You never need to do this by hand: the calculator above reports W and p for every column or group.

How to interpret the Shapiro-Wilk test

ResultMeaningWhat to do
p ≥ 0.05No evidence against normality (H₀ is not rejected).Methods that assume normality are reasonable. Glance at the Q-Q plot, especially with small samples.
p < 0.05The data are probably not normal (H₀ is rejected).Look at the skewness and the Q-Q plot to see how, then pick a remedy below.
W close to 1The sorted values match normal quantiles closely.Read W together with p and the sample size.

Worked example. Weed counts in 20 untreated quadrats gave W = 0.842, p = 0.004, with skewness 1.53. The p value is below 0.05, so the counts are not normal, and the positive skewness says why: a few quadrats had many more weeds than the rest. The Q-Q plot shows the same thing as points curving above the line at the right. Try it with the weed counts example in the calculator.

A significant result is not the end of the analysis

Shapiro-Wilk is a yes-or-no answer to a question about shape. With large samples it flags departures too small to matter; with small samples it misses real ones. Use it together with the plot and the skewness, as the calculator does.

How to check if data are normally distributed

There are four ways, and they work best together:

  1. Q-Q plot. The most useful single picture: points on the line mean normal (see the next section).
  2. Histogram with the normal curve. Shows skew and outliers at a glance, but its look depends on the bar width and it is unreliable with fewer than about 20 values.
  3. Skewness and kurtosis. Both are 0 for a normal distribution. As a rough guide for moderate to large samples, an absolute skewness above 2 or an excess kurtosis above 7 signals a substantial departure (Kim, 2013).
  4. A formal test. Shapiro-Wilk is the usual choice. Others include Kolmogorov-Smirnov (with the Lilliefors correction), Anderson-Darling and D'Agostino-Pearson.

The calculator gives you all four at once for each column, each group or the residuals, so you do not have to switch between programs.

How to read a Q-Q plot

A normal Q-Q (quantile-quantile) plot puts each sorted value against the value a normal distribution would predict at the same rank. If the data are normal, the points fall along the straight line. These are the patterns to look for:

On the line: close to normal
Bends up at the right: right skew
Bends down at the left: left skew
S shape: heavy tails
  • Right skew is common for counts, concentrations and yields with a few very high plots.
  • Left skew appears when values pile up near an upper limit, such as scores near the maximum.
  • Heavy tails mean more extreme values than a normal curve predicts; check them for data-entry errors.
  • Flat steps come from rounded data or few distinct values, and are usually not a problem by themselves.

Shapiro-Wilk vs Kolmogorov-Smirnov

Shapiro-WilkKolmogorov-Smirnov
What it testsNormality onlyFit to any fully specified distribution; for normality with estimated mean and SD it needs the Lilliefors correction
PowerHigher: detects non-normality more often at the same sample size (Razali and Wah, 2011)Lower, especially in small samples
Sample size3 to 5,000 in RAny size
Use it whenChecking normality before a t test, ANOVA or regression: almost alwaysComparing data with a specific non-normal distribution, or very large samples

SPSS reports both in its Tests of Normality table. When they disagree, go with Shapiro-Wilk and the Q-Q plot.

Normality for ANOVA, t tests and regression: test the residuals

ANOVA, t tests, linear regression and mixed models assume that the residuals are normal: the differences between each value and its group mean (or fitted value). They do not assume the raw column is normal. A column holding several treatments can fail a normality test simply because the treatment means differ, even when every group is perfectly normal.

  • Can you use ANOVA if the data are not normally distributed? Often yes. ANOVA is fairly robust to mild non-normality, especially with equal group sizes and moderate samples. Check the residuals; if they are clearly skewed, use a remedy below.
  • Do data need to be normal for a t test? The differences (paired t test) or the values within each group (two-sample t test) should be roughly normal; with 30 or more per group the t test copes well with moderate skew.
  • Does linear regression need normal data? No. Neither the predictor nor the response has to be normal; the residuals should be.

In the calculator, choose your treatment column and "Residuals after removing group means". For blocks, split plots or repeated measures, run the analysis in aStat: it tests the residuals of the full model with the other assumption checks.

What to do when data are not normal

1. Transform the values

Right-skewed positive values (weights, concentrations, yields with a long upper tail) are often close to normal on the log scale. With zeros, use log(y + 1) or the square root. Test again after transforming, and report means back-transformed to the original units.

2. Use a model made for your kind of data

  • Counts (weeds, eggs, lesions, insects): Poisson or negative binomial models (aStat's Count model).
  • Yes/no outcomes (pregnant, germinated, survived): logistic models.
  • Proportions of a known total (8 of 50 seeds): binomial models on the counts and totals, not ANOVA on percentages.

With blocks, pens or animals as random effects, these are generalized linear mixed models (GLMMs), the kind SAS fits with PROC GLIMMIX. They analyze the data on their own scale instead of forcing them toward normality (Stroup, 2013).

3. Use a rank-based test

Compare groups with the Kruskal-Wallis test (three or more groups) or the Wilcoxon rank-sum, also called Mann-Whitney, test (two groups). aStat's one-way ANOVA reports Kruskal-Wallis alongside so you can compare.

4. Carry on, if the departure is small

A significant Shapiro-Wilk result with a nearly straight Q-Q plot and small skewness, in a large data set, is rarely a reason to change the analysis.

How to report the Shapiro-Wilk test (APA style)

Give W, the p value and the sample size, and say what you tested. APA style drops the zero before p:

  • "The residuals were approximately normal, Shapiro-Wilk W = 0.97, p = .41 (n = 40)."
  • "Weed counts were right-skewed, W = 0.84, p = .004, and were analyzed with a negative binomial GLMM."
  • "Normality was checked with the Shapiro-Wilk test and Q-Q plots of the residuals; no departures were found (all p > .05)."

The calculator writes a ready-to-paste line under "To report" for every result.

Shapiro-Wilk test in R, SPSS and Excel

R

shapiro.test(dat$yield)          # W and p
qqnorm(dat$yield); qqline(dat$yield)  # Q-Q plot
# residuals of a one-way ANOVA
shapiro.test(residuals(lm(yield ~ variety, data = dat)))

The "R script" button in the calculator downloads the full script for your own data, plots included.

SPSS

  1. Analyze › Descriptive Statistics › Explore.
  2. Put the measurement in Dependent List (and the group in Factor List to test each group).
  3. Plots › tick "Normality plots with tests" › Continue › OK.
  4. Read the Shapiro-Wilk columns of the Tests of Normality table: Statistic is W, Sig. is the p value.

Excel

Excel has no built-in Shapiro-Wilk test, and the Analysis ToolPak does not include one. Open your spreadsheet in the calculator above instead: it reads .xlsx and .xls files directly, or you can paste the columns.

Questions people ask

Does p > 0.05 prove my data are normal?

No. It means the test found no evidence against normality. With small samples the test has little power, so check the Q-Q plot as well.

How many values does the Shapiro-Wilk test need?

At least 3, and up to 5,000 in R. Below about 15 values, treat the result as a rough guide and rely more on the plot and on what you know about the measurement.

What if the Shapiro-Wilk test is significant?

Your data are probably not normal. Check the residuals rather than the raw column, look at the skewness, then transform the values, use a model for counts or proportions, or switch to a rank-based test.

Can data be skewed and still pass the test?

Yes, mild skew often passes, especially in small samples. That is why the calculator also reports skewness and draws the Q-Q plot.

Can discrete or ordinal data be normally distributed?

Counts and scores can be close to normal when they take many values, but scores with only a few levels (1 to 5) cannot be truly normal; analyze them with an ordinal model.

Should I test each treatment group separately?

You can, but with few values per group each test has little power. Testing the residuals pools all groups into one test, which matches what ANOVA assumes.

Sources

  • Shapiro, S. S., and Wilk, M. B. (1965). An analysis of variance test for normality (complete samples). Biometrika, 52(3–4), 591–611.
  • Royston, P. (1995). Remark AS R94: A remark on algorithm AS 181: The W-test for normality. Journal of the Royal Statistical Society, Series C, 44(4), 547–551.
  • Ghasemi, A., and Zahediasl, S. (2012). Normality tests for statistical analysis: a guide for non-statisticians. International Journal of Endocrinology and Metabolism, 10(2), 486–489. Free full text.
  • Razali, N. M., and Wah, Y. B. (2011). Power comparisons of Shapiro-Wilk, Kolmogorov-Smirnov, Lilliefors and Anderson-Darling tests. Journal of Statistical Modeling and Analytics, 2(1), 21–33.
  • Kim, H.-Y. (2013). Statistical notes for clinical researchers: assessing normal distribution (2) using skewness and kurtosis. Restorative Dentistry and Endodontics, 38(1), 52–54.
  • Stroup, W. W. (2013). Generalized Linear Mixed Models: Modern Concepts, Methods and Applications. CRC Press.
  • R documentation: shapiro.test · NIST/SEMATECH e-Handbook: normal probability plot