K-S Critical Value Calculator
What Is the Kolmogorov-Smirnov (K-S) Table?
The Kolmogorov-Smirnov table is a reference for the critical values of the K-S test statistic D. This nonparametric test, developed independently by Soviet mathematicians Andrey Kolmogorov (1933) and Nikolai Smirnov (1948), measures how far a set of observations deviates from a specified theoretical distribution — or how far two samples deviate from each other.
The test statistic D is the maximum absolute vertical distance between the empirical distribution function and the reference distribution. A small D means the data match the theoretical distribution closely. A large D signals departure. The critical value from the table is the threshold: if D reaches or exceeds it, you reject the null hypothesis of good fit at your chosen significance level.
One-paragraph definition: The Kolmogorov-Smirnov test is a distribution-free goodness-of-fit test that quantifies the largest discrepancy between an observed empirical distribution function and a theoretical cumulative distribution function (one-sample), or between two empirical distribution functions (two-sample). The K-S critical value table gives the minimum D required to reject H₀ at each α level. Reject H₀ if D ≥ Dcritical.
Kolmogorov-Smirnov Critical Value Table
All values below are Dcritical — the minimum K-S statistic for significance at each α level. Select the tab for your test type. Click any cell to highlight and load it into the calculator above. For n > 35, use the large-sample approximation formula at the bottom of this section.
Reject H₀ if D ≥ Dcritical. Exact values for n = 1–35. For n > 35, use the large-sample approximation: Dcritical = Kα / √n, where Kα = 1.224 (α=0.10), 1.358 (α=0.05), 1.517 (α=0.02), 1.628 (α=0.01). Values derived from Massey (1951), Miller (1956), and the Kolmogorov distribution.
Large-Sample Approximation (n > 35)
| α | Kα | n = 50 | n = 100 | n = 200 |
|---|---|---|---|---|
| 0.10 | 1.224 | 0.1731 | 0.1224 | 0.0866 |
| 0.05 | 1.358 | 0.1921 | 0.1358 | 0.0960 |
| 0.02 | 1.517 | 0.2145 | 0.1517 | 0.1072 |
| 0.01 | 1.628 | 0.2302 | 0.1628 | 0.1151 |
How the Kolmogorov-Smirnov Test Works
The K-S test operates by comparing how a dataset's cumulative pattern relates to what a theoretical distribution predicts. Every step below maps directly to a specific calculation or table lookup.
Step 1 — State Hypotheses
The null hypothesis is H₀: the data follow distribution F₀(x). The alternative is H₁: the data do not follow F₀(x). For the two-sample test: H₀: both samples come from the same population distribution; H₁: they do not. Set α before looking at the data — typically α = 0.05 in most research contexts.
Step 2 — Sort Data and Compute the EDF
Sort the n observations in ascending order: x₁ ≤ x₂ ≤ ... ≤ xn. The empirical distribution function at each point is:
This is the step function that rises by 1/n at each observation. It estimates the true CDF of the population from which your data were drawn.
Step 3 — Compute the K-S Statistic D
For each observation, take the absolute difference between the EDF and the theoretical CDF. D is the largest of these differences:
Both terms are checked to capture the maximum gap on either side of each step in the EDF. D lies between 0 (perfect fit) and 1 (complete mismatch).
Step 4 — Look Up Dcritical
Find the row for your sample size n in the K-S table. Read Dcritical from the column for your chosen α. If your n falls between two listed values, use the smaller n (the conservative choice), or apply the large-sample formula for n > 35.
Step 5 — Apply the Decision Rule
If D < Dcritical → Fail to reject H₀ → No significant departure from the reference distribution
Step 6 — Report the Result
State D, n, α, Dcritical, and your conclusion. Example: D(20) = 0.183, Dcritical(α=0.05) = 0.294, fail to reject H₀ — no significant departure from normality detected. In software output, compare the reported p-value directly: reject H₀ if p ≤ α.
Worked Example: K-S Test on Exam Scores
Scenario: A statistics instructor wants to know whether the exam scores of 10 students follow a uniform distribution on [50, 100]. The sorted scores are: 53, 58, 64, 67, 71, 76, 82, 85, 90, 96. Test at α = 0.05.
Computation Table
| i | xi | Fn(xi) = i/n | F₀(xi) = (x − 50)/50 | |Fn − F₀| |
|---|---|---|---|---|
| 1 | 53 | 0.100 | 0.060 | 0.040 |
| 2 | 58 | 0.200 | 0.160 | 0.040 |
| 3 | 64 | 0.300 | 0.280 | 0.020 |
| 4 | 67 | 0.400 | 0.340 | 0.060 |
| 5 | 71 | 0.500 | 0.420 | 0.080 |
| 6 | 76 | 0.600 | 0.520 | 0.080 |
| 7 | 82 | 0.700 | 0.640 | 0.060 |
| 8 | 85 | 0.800 | 0.700 | 0.100 |
| 9 | 90 | 0.900 | 0.800 | 0.100 |
| 10 | 96 | 1.000 | 0.920 | 0.080 |
Summary of Steps
| Step | Action | Result |
|---|---|---|
| 1 | State hypotheses | H₀: Uniform[50,100]; α = 0.05 |
| 2 | Record n | n = 10 |
| 3 | Compute D statistic | D = max|Fn − F₀| = 0.100 |
| 4 | Look up Dcritical | n=10, α=0.05 → Dcritical = 0.409 |
| 5 | Apply decision rule | 0.100 < 0.409 → Fail to Reject H₀ |
Interpretation
D = 0.100 is well below Dcritical = 0.409 at α = 0.05 with n = 10. There is no statistically significant evidence that the exam scores depart from a uniform distribution on [50, 100]. Note that with only 10 observations, the K-S test has limited power — a genuine departure from uniformity might go undetected. A larger sample would provide a more sensitive test.
One-Sample vs Two-Sample K-S Test
The two versions of the K-S test address different research questions. Choosing the right one determines which critical value table to use.
One-Sample K-S Test
Compares one sample's empirical CDF against a fully specified theoretical distribution. The reference distribution — including all parameters — must be specified before seeing the data. Common uses: testing whether data follow a normal, uniform, exponential, or Poisson distribution with known parameters.
Two-Sample K-S Test
Compares the empirical CDFs of two independent samples to test whether they were drawn from the same underlying distribution. No theoretical distribution is specified — the test is sensitive to differences in shape, spread, and location between the two groups.
Important: Parameters Must Not Be Estimated from the Same Data
The standard K-S critical values assume the theoretical distribution is fully specified before data collection. If you estimate the mean and variance from your sample data and then test whether those same data fit a normal distribution with those estimated parameters, the standard K-S table is no longer valid — it gives p-values that are too large, making rejection too rare. Use the Lilliefors test instead, which has its own separate critical value table specifically for this situation.
K-S Test vs Other Goodness-of-Fit Tests
Choosing among goodness-of-fit tests depends on sample size, the distribution being tested, and whether parameters are estimated. The table below shows the main considerations for each method.
| Test | Best For | Normality? | Two-Sample? | Parametric? | Power (small n) |
|---|---|---|---|---|---|
| Kolmogorov-Smirnov | Any continuous dist., two-sample | Known params only | Yes | No | Moderate |
| Shapiro-Wilk | Normality, small–medium n | Yes (optimal) | No | No | High |
| Anderson-Darling | Normality, sensitive to tails | Yes | Limited | No | High |
| Lilliefors | Normality, estimated parameters | Yes (estimated μ, σ) | No | No | Moderate |
| Chi-Square GOF | Discrete distributions, large n | With caution | No | No | Low |
For normality testing with estimated parameters and n < 50, the Shapiro-Wilk test is generally the most reliable choice. See the normality tests guide on Statistics Fundamentals for a full comparison.
Running the K-S Test in R, Python, and SPSS
Statistical software computes D and the associated p-value automatically, so you compare p against α directly rather than using the critical value table. The table remains useful for manual computation and for verifying software output.
R — ks.test()
x <- c(53, 58, 64, 67, 71, 76, 82, 85, 90, 96)
ks.test(x, "pnorm", mean = 70, sd = 15)
# Two-sample K-S test
ks.test(group1, group2)
Python — scipy.stats.kstest()
# One-sample K-S test (normal, known params)
data = [53, 58, 64, 67, 71, 76, 82, 85, 90, 96]
result = stats.kstest(data, 'norm', args=(70, 15))
print(result.statistic, result.pvalue)
# Two-sample K-S test
stats.ks_2samp(group1, group2)
SPSS — Nonparametric Tests
In SPSS: Analyze → Nonparametric Tests → Legacy Dialogs → 1-Sample K-S. Select the variable, choose the test distribution (Normal, Uniform, Poisson, or Exponential), and run. SPSS reports the K-S statistic, degrees of freedom, and asymptotic significance (p-value). Compare p directly against your α level.
Common Mistakes When Using the K-S Table
Estimating parameters from the same sample
The most frequent error: computing the sample mean and variance, then using those estimates in the K-S test against a normal distribution with those parameters. The standard K-S table does not apply in this case. Use the Lilliefors table or the Shapiro-Wilk test instead.
Using the one-sample table for a two-sample test
The critical values for the two-sample test differ from the one-sample table, particularly for unequal sample sizes. For unequal n1 and n2, the effective sample size formula is neff = (n1 × n2) / (n1 + n2). Using the wrong table gives incorrect decisions.
Applying the K-S test to discrete data
The standard K-S test assumes a continuous distribution. Discrete data (counts, ranked categories) create ties in the empirical CDF that violate this assumption. The resulting p-values are conservative — real departures may go undetected. The chi-square goodness-of-fit test is generally more appropriate for discrete distributions.
Confusing failing to reject H₀ with proving good fit
A non-significant K-S result means only that this sample did not provide enough evidence to rule out the reference distribution. It does not confirm the data follow that distribution. With small samples, the test has limited power and may miss real departures.
Symbol and Entity Glossary
The table below defines every symbol and term used in K-S test calculations, along with the most common source of confusion for each.
| Symbol | Name | Definition | Common Error |
|---|---|---|---|
| D | K-S test statistic | Maximum absolute difference between EDF and theoretical CDF; 0 ≤ D ≤ 1 | Not checking both |i/n − F₀| and |(i−1)/n − F₀| at each point |
| Fn(x) | Empirical distribution function | Proportion of sample observations ≤ x; Fn(xi) = i/n | Forgetting to sort data before computing EDF |
| F₀(x) | Theoretical CDF | Cumulative distribution function of the reference distribution, fully specified before data collection | Estimating parameters from sample data |
| Dcritical | Critical value | Threshold from the K-S table; reject H₀ if D ≥ Dcritical | Using one-sample table for two-sample test |
| n | Sample size | Number of observations; determines which row to use in the K-S table | Applying exact table beyond n = 35 without the large-sample formula |
| α | Significance level | Probability of Type I error; chooses which column of the K-S table to use | Setting α after seeing D (data dredging) |
| Kα | Kolmogorov constant | Constant from the Kolmogorov distribution used in the large-sample approximation Dcrit = Kα/√n | Using approximation for n ≤ 35 |
| p-value | Probability value | Probability of observing a D ≥ computed D if H₀ is true; reject H₀ if p ≤ α | Interpreting p as the probability H₀ is true |
Quick Reference: Most Commonly Used K-S Critical Values
These are the most frequently referenced values for the one-sample K-S test at α = 0.05 and α = 0.01 — the standard levels in most applied and academic research.
| n | Dcritical (α = 0.10) | Dcritical (α = 0.05) | Dcritical (α = 0.02) | Dcritical (α = 0.01) |
|---|---|---|---|---|
| 5 | 0.565 | 0.627 | 0.669 | 0.669 |
| 10 | 0.369 | 0.409 | 0.457 | 0.490 |
| 15 | 0.304 | 0.338 | 0.376 | 0.404 |
| 20 | 0.265 | 0.294 | 0.329 | 0.352 |
| 25 | 0.238 | 0.264 | 0.295 | 0.317 |
| 30 | 0.218 | 0.242 | 0.270 | 0.290 |
| 35 | 0.202 | 0.224 | 0.251 | 0.269 |
One-sample K-S test. Values from Massey (1951). For n > 35, use Dcritical = Kα/√n.
Applied Examples Across Research Fields
The following examples show how the K-S test addresses real distribution questions across several fields. Each uses a different sample size to show how n changes the critical value.
Manufacturing: Testing Component Dimensions
A quality engineer measures 20 metal rods and wants to verify that diameters follow N(10mm, 0.1mm²) based on design specifications. The computed D = 0.187. With n = 20 and α = 0.05, Dcritical = 0.294. Since 0.187 < 0.294, the engineer fails to reject H₀ — dimensions are consistent with the specified normal distribution.
Finance: Testing Return Distributions
A portfolio analyst tests whether 30 monthly returns follow a specified normal distribution (based on historical long-run parameters). The computed D = 0.261. With n = 30, α = 0.05, Dcritical = 0.242. Since 0.261 > 0.242, H₀ is rejected — the returns show a statistically significant departure from the specified normal model.
Healthcare: Two-Sample Clinical Comparison
Researchers compare recovery times for two treatment groups (n₁ = 25, n₂ = 25). The two-sample K-S statistic D = 0.320. With effective sample size neff = (25×25)/(25+25) = 12.5 ≈ 12, and α = 0.05, Dcritical ≈ 0.375. Since 0.320 < 0.375, the distributions are not significantly different at this sample size.
Machine Learning: Checking Data Drift
Data scientists use the two-sample K-S test to detect distribution shift between training and production data. A large D between the training feature distribution and the current production distribution signals that model retraining may be necessary. This is implemented in libraries like SciPy, Evidently AI, and WhyLabs.
Frequently Asked Questions
Can I use the K-S test for a normal distribution with estimated mean and variance?
No — not with the standard K-S table. When parameters are estimated from the same data, use the Lilliefors test. Lilliefors critical values are smaller than standard K-S critical values because estimated parameters improve fit artificially, requiring a higher D to achieve significance. If both μ and σ are specified from theory or prior data, the standard K-S table applies. See the normality tests comparison for guidance on choosing between K-S, Lilliefors, and Shapiro-Wilk.
What sample size does the K-S test work best with?
The K-S test has adequate power for moderate samples (n ≈ 25–100) when testing against well-specified distributions. For very small samples (n < 15), the critical values are large and the test may miss real departures. For large samples (n > 200), it becomes very sensitive — even trivial, practically meaningless deviations from the reference distribution will produce significant results. In practice, graphical assessment with a Q-Q plot alongside the K-S test gives a more complete picture.
How is the K-S test different from the chi-square goodness-of-fit test?
The chi-square test groups data into bins and compares counts — it works for both discrete and continuous data, but bin choice affects results. The K-S test uses the full continuous distribution without binning, so it does not lose information. The K-S test is generally more powerful for continuous data with small samples. The chi-square test requires larger samples (expected count ≥ 5 per cell) and is more appropriate for discrete distributions. For a full comparison, see the chi-square test guide.
Does the K-S test work for all distributions?
The K-S test applies to any fully specified continuous distribution — normal, uniform, exponential, logistic, Weibull, and others. It does not work for discrete distributions (the D statistic is not distribution-free in that case). For distributions with unknown parameters, specialized tests exist: Lilliefors for normality with estimated parameters, and Anderson-Darling with its own critical values for several common continuous distributions.
What does a K-S p-value of 0.03 mean?
A p-value of 0.03 means that if the data truly followed the reference distribution, there would be only a 3% chance of observing a K-S statistic as large as the one computed. At α = 0.05, you reject H₀ — the observed difference between the sample distribution and the reference distribution is too large to attribute to sampling variation at this significance level. The p-value does not indicate how different the distributions are, only that the difference is statistically significant.
References and Further Reading
Massey, F. J., Jr. (1951). The Kolmogorov-Smirnov test for goodness of fit. Journal of the American Statistical Association, 46(253), 68–78. — The original published table of K-S critical values.
NIST/SEMATECH e-Handbook of Statistical Methods. Section 1.3.5.16: Kolmogorov-Smirnov Goodness-of-Fit Test. National Institute of Standards and Technology. itl.nist.gov — U.S. government statistical reference covering K-S test methodology, assumptions, and examples.
SciPy documentation: scipy.stats.kstest. docs.scipy.org — Implementation reference for one-sample and two-sample K-S tests in Python, with parameter definitions and examples.
Conover, W. J. (1999). Practical Nonparametric Statistics (3rd ed.). Wiley. — Comprehensive reference for the K-S test, Lilliefors correction, and related nonparametric methods including worked examples and tables.
Penn State STAT 415: Introduction to Mathematical Statistics. Lesson 14: Goodness-of-Fit Tests. online.stat.psu.edu — Open-access course covering the K-S test, chi-square GOF, and Lilliefors test with detailed theoretical grounding.
Related Statistical Tables & Resources
What the K-S Table Tells You — and What It Doesn't
Why Dcritical Decreases as n Increases
With more data, the empirical distribution function converges more tightly to the true population CDF. Small genuine deviations become detectable. This is why a K-S test with n = 100 can reject H₀ at D = 0.15, while the same D with n = 10 would not reach significance. The critical value encodes the precision-to-sample-size tradeoff inherent in any statistical test.
K-S Table vs p-value from Software
Statistical software (R, Python, SPSS) reports exact or approximate p-values. The table approach and the p-value approach give identical decisions: rejecting when D ≥ Dcritical (table) is the same as rejecting when p ≤ α (software). The table is useful when software is unavailable, for manual verification, or for understanding exactly what threshold applies at your sample size and α level. For more on p-values, see the hypothesis testing section.
Distribution-Free Does Not Mean Assumption-Free
"Distribution-free" means the K-S test's sampling distribution under H₀ does not depend on the specific distribution being tested — it applies to any continuous distribution. It does not mean the test has no assumptions. Independence, continuity, and the critical requirement that parameters be specified without using the sample data all still apply. Violating these assumptions invalidates the critical values in the table. Review the parametric vs nonparametric tests guide for context.