Skip to content
Statculator
Hypothesis Tests

Shapiro–Wilk Test Calculator

Free Shapiro–Wilk test calculator: paste 3 to 5,000 values to get W and the p-value (Royston’s method, matches R and SciPy), a normal Q–Q plot and a verdict.

Free, no sign-up Runs in your browserBy Hira Noor, BS MathematicsUpdated

Try
20 values

Paste 3 to 5,000 raw measurements separated by commas, spaces or new lines.

Usually 0.05 or 0.01.

H₀: the data come from a normal distribution. A small p-value is evidence against normality; a large one is not proof of it.

Results

W statistic
0.9583
Closer to 1 = closer to normal
p-value
0.5113
Royston’s approximation, n = 20

Fail to reject H₀ at α = 0.05

p = 0.5113 > 0.05. No evidence against normality. That is not proof the data are normal: the test may simply lack the power to detect a departure.

Sample size, n
20
Mean, x̄
50.065
Standard deviation, s
4.2398
Skewness (sample)
0.4908
Excess kurtosis (sample)
0.6963
Minimum / maximum
43.3 / 60.7
Distinct values
20 of 20
Normal deviate of W, z
-0.0284

Interpretation: W = 0.9583 is within the range that normal samples of size 20 routinely produce: about 51.13% of them would give a W this low or lower. Use the Q–Q plot to check that the points stay close to the line.

Normal Q–Q plotNormal Q–Q plot404550556065Ordered data-2.0-1.5-1.0-0.50.00.51.01.52.0Theoretical normal quantile, z(-1.8682, 43.3)(-1.4034, 43.6)(-1.1281, 45.6)(-0.9191, 45.9)(-0.7441, 46.5)(-0.5895, 47)(-0.4478, 47.1)(-0.3146, 48.8)(-0.1868, 49.8)(-0.0619, 50.2)(0.0619, 50.8)(0.1868, 51.3)(0.3146, 51.9)(0.4478, 52)(0.5895, 52.3)(0.7441, 52.5)(0.9191, 52.9)(1.1281, 53.4)(1.4034, 55.7)(1.8682, 60.7)x̄ + s·z
Each point pairs an ordered value with the normal quantile at plotting position (i − 0.375)/(n + 0.25). Points close to the line x̄ + s·z support normality; a curve or a stray point at either end is what pulls W below 1.

Ordered data, normal scores and weights

iOrdered value, x₍ᵢ₎Plotting position, pᵢNormal score, mᵢWeight, aᵢLine value, x̄ + s·mᵢ
143.30.0309-1.8682-0.473442.144
243.60.0802-1.4034-0.321744.1148
345.60.1296-1.1281-0.255745.2819
445.90.179-0.9191-0.208346.168
546.50.2284-0.7441-0.168646.91
6470.2778-0.5895-0.133647.5658
747.10.3272-0.4478-0.101548.1665
848.80.3765-0.3146-0.071348.7313
949.80.4259-0.1868-0.042349.2732
1050.20.4753-0.0619-0.01449.8024
1150.80.52470.06190.01450.3276
1251.30.57410.18680.042350.8568
1351.90.62350.31460.071351.3987
14520.67280.44780.101551.9635
1552.30.72220.58950.133652.5642
1652.50.77160.74410.168653.22
1752.90.8210.91910.208353.962
1853.40.87041.12810.255754.8481
1955.70.91981.40340.321756.0152
2060.70.96911.86820.473457.986

pᵢ = (i − 0.375)/(n + 0.25) and mᵢ = Φ⁻¹(pᵢ). W = (Σaᵢx₍ᵢ₎)² / Σ(xᵢ − x̄)². The last column is the height of the Q–Q line at each point.

Step-by-step solution

  1. 1

    State the hypotheses

    The test is one-sided in W: only values of W well below 1 count against H₀.

    H₀: the data come from a normally distributed population
    H₁: the population is not normally distributed
  2. 2

    Choose the significance level

    α = 0.05
  3. 3

    Sort the data

    Order the 20 values from smallest to largest. W compares this ordered list with the pattern a normal sample would show.

    x₍₁₎ ≤ x₍₂₎ ≤ … ≤ x₍ₙ₎: 43.3, 43.6, 45.6, 45.9, 46.5, 47, 47.1, 48.8, 49.8, 50.2, …, 60.7
  4. 4

    Find the normal scores the ordered values should resemble

    In a normal sample the i-th smallest value sits, on average, near x̄ + s·mᵢ, where mᵢ is the standard normal quantile at plotting position (i − 0.375)/(n + 0.25). These are the x-coordinates of the Q–Q plot.

    m₁ = Φ⁻¹((1 − 0.375) / (20 + 0.25)) = Φ⁻¹(0.0309) = -1.8682
    m₂₀ = Φ⁻¹((20 − 0.375) / (20 + 0.25)) = Φ⁻¹(0.9691) = 1.8682
  5. 5

    Turn the scores into weights

    Royston’s algorithm rescales the mᵢ so that Σaᵢ² = 1 and adjusts the two largest weights at each end with a small polynomial correction in 1/√n. The weights mirror each other (a₁ = −aₙ), so Σaᵢ = 0. The full list is in the table.

    a₂₀ = 0.4734, a₁₉ = 0.3217, …, a₂ = -0.3217, a₁ = -0.4734
  6. 6

    Calculate the numerator

    Multiply each ordered value by its weight and add. The result b is an estimate of the spread that is only accurate when the ordered data rise in step with the normal scores, that is, when the Q–Q plot is straight.

    b = Σ aᵢ x₍ᵢ₎ = 18.0919
    b² = 327.318
  7. 7

    Calculate the denominator

    The ordinary sum of squared deviations measures the spread without assuming any shape.

    s² = 17.9761
    SS = Σ (xᵢ − x̄)² = (n − 1)s² = 19 × 17.9761 = 341.5455
  8. 8

    Calculate W

    W is the ratio of the two spread estimates. It cannot exceed 1, and it falls as the Q–Q plot bends away from a straight line.

    W = b² / SS = 327.318 / 341.5455 = 0.9583
  9. 9

    Find the p-value

    W itself is not normally distributed, but for n ≥ 12 the quantity ln(1 − W) is very nearly normal. Royston’s polynomials in ln n give its mean μ and standard deviation σ when the data really are normal. Small W means large z, so the p-value is the upper tail.

    g = ln(1 − W) = ln(0.0417) = -3.1783
    μ = -3.1642, σ = 0.4962 (for n = 20)
    z = (g − μ) / σ = (-3.1783 − (-3.1642)) / 0.4962 = -0.0284
    p = P(Z > -0.0284) = 0.5113
  10. 10

    Decision: fail to reject H₀

    At the 5% level there is no evidence against normality. This is not proof that the population is normal, only that this sample is compatible with it.

    p = 0.5113 > α = 0.05

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

  1. 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.
  2. Set the Significance level (α). Use 0.05 unless your field has another convention.
  3. Click Calculate and read W and the p-value. If p ≤ α the test rejects normality; if p > α it found no evidence against it.
  4. 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.
  5. 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:

Test statistic
W = (Σ aᵢ x₍ᵢ₎)² / Σ (xᵢ − x̄)²
Expected normal scores
mᵢ = Φ⁻¹( (i − 0.375) / (n + 0.25) )
p-value for n ≥ 12 (Royston)
z = (ln(1 − W) − μ) / σ, p = P(Z > z)
p-value for n = 3 (exact)
p = (6/π) · [asin(√W) − asin(√0.75)]
Formula symbols
SymbolMeaning
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̄, nsample 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?

  1. 01Hypotheses: H₀: the strengths come from a normal distribution; H₁: they do not.
  2. 02Sort the data from 43.3 up to 60.7. The summary statistics are x̄ = 50.065 and s = 4.2398 (s² = 17.9761).
  3. 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.
  4. 04Numerator: b = Σ aᵢ x₍ᵢ₎ = 18.0919, so b² = 327.3180.
  5. 05Denominator: SS = Σ (xᵢ − x̄)² = (n − 1)s² = 341.5455.
  6. 06W = 327.3180 / 341.5455 = 0.9583.
  7. 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.

ResultWhat it meansWhat 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.

nCritical W at α = 0.05Critical W at α = 0.01
50.7750.702
100.8450.787
150.8820.833
200.9040.866
300.9300.903
500.9540.937
1000.9750.965
2000.9860.982
5000.9940.992
1,0000.9970.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.

MethodHow it worksBest forWatch out for
Shapiro–WilkCompares 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–SmirnovLargest 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–DarlingWeighted 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.
LillieforsThe 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 plotYou 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.

SoftwareHow to run itNotes
ExcelNo 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.
Rshapiro.test(x)Accepts 3 to 5,000 values; prints W and the p-value.
Pythonscipy.stats.shapiro(x)Returns the statistic and p-value; warns above 5,000 values.
SPSSAnalyze → Descriptive Statistics → Explore → Plots → tick “Normality plots with tests”.The Shapiro–Wilk column of the “Tests of Normality” table.
Stataswilk xReports 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?

W measures how closely the ordered data follow the pattern expected from a normal sample, on a scale from 0 to 1. A value near 1 means the normal Q–Q plot is almost a straight line; skewness, heavy tails and outliers lower it. Because the usual range of W depends strongly on sample size, judge it through the p-value rather than against a fixed cut-off.

What is the null hypothesis of the Shapiro–Wilk test?

The null hypothesis is that the data are a random sample from a normal distribution, with any mean and any standard deviation. The alternative is that the population is not normal. A p-value at or below your significance level leads you to reject normality; a larger p-value means the test found no evidence against it.

Does a p-value above 0.05 prove that my data are normal?

No. A p-value above 0.05 only means the test did not find evidence against normality. With small samples the test has little power, so data from clearly skewed populations frequently pass. Describe the result as “no evidence against normality” and back it up with a Q–Q plot.

What sample size do I need for the Shapiro–Wilk test?

The test can be computed for 3 to 5,000 values. In practice it is most useful between roughly 10 and a few hundred observations. Below 10 it rarely detects non-normality, and with thousands of values it rejects for departures too small to affect most analyses.

Should I use Shapiro–Wilk or Kolmogorov–Smirnov to test normality?

Use Shapiro–Wilk. It is more powerful than the Kolmogorov–Smirnov test for detecting non-normality, and it is valid when the mean and standard deviation are estimated from the data, which is almost always the case. The standard Kolmogorov–Smirnov p-value is only correct when the reference distribution is fully specified in advance.

Do I have to test normality before a t-test or ANOVA?

Not always. The t-test and ANOVA are fairly robust to non-normality when groups have about 30 or more observations and no extreme outliers, because sample means are approximately normal by the central limit theorem. A normality check matters most for small samples, and for regression and ANOVA it should be run on the residuals rather than the raw data.

Can you do a Shapiro–Wilk test in Excel?

Not with a built-in function. Excel has no Shapiro–Wilk formula or Analysis ToolPak option. The simplest route is to copy the column of values and paste it into this calculator, which gives W, the p-value and a Q–Q plot. Add-ins such as Real Statistics and XLSTAT add the test to Excel if you need it inside the workbook.

How do I report a Shapiro–Wilk test result?

Give the statistic, the sample size and the p-value, then the conclusion. For the worked example above: “A Shapiro–Wilk test found no evidence against normality, W(20) = 0.958, p = .511.” If the test rejects, say so and describe the departure, for example “the data were right-skewed, W(45) = 0.912, p = .002”, and state what you did about it.

Why does the test reject normality for my large dataset when the histogram looks normal?

With a large sample the test has enough power to detect very small departures from a perfect normal curve, and no real data are exactly normal. A tiny p-value then tells you the departure is real, not that it is big. Look at the Q–Q plot, skewness and kurtosis to decide whether it matters for your analysis.

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/