Nonparametric Tests
Two-Sample Kolmogorov-Smirnov Table: Exact Critical Values of D
Exact critical values for the two-sample Kolmogorov-Smirnov test of whether two samples come from the same distribution.
- Equal n to 40
- Unequal n₁, n₂ to 20
- Exact calculator
Two-Sample KS Table
Three tables: equal sample sizes, then unequal sizes at α = 0.05 and 0.01. Cells: critical D. Reject H₀ if D ≥ the cell.
Equal sample sizes (n₁ = n₂ = n)
| Two-sided α → n ↓ | 0.1 | 0.05 | 0.02 | 0.01 | 0.001 |
|---|---|---|---|---|---|
| 3 | 1.000 | — | — | — | — |
| 4 | 1.000 | 1.000 | — | — | — |
| 5 | 0.800 | 1.000 | 1.000 | 1.000 | — |
| 6 | 0.834 | 0.834 | 1.000 | 1.000 | — |
| 7 | 0.715 | 0.858 | 0.858 | 0.858 | 1.000 |
| 8 | 0.625 | 0.750 | 0.750 | 0.875 | 1.000 |
| 9 | 0.667 | 0.667 | 0.778 | 0.778 | 0.889 |
| 10 | 0.600 | 0.700 | 0.700 | 0.800 | 0.900 |
| 11 | 0.546 | 0.637 | 0.728 | 0.728 | 0.819 |
| 12 | 0.500 | 0.584 | 0.667 | 0.667 | 0.834 |
| 13 | 0.539 | 0.539 | 0.616 | 0.693 | 0.770 |
| 14 | 0.500 | 0.572 | 0.572 | 0.643 | 0.786 |
| 15 | 0.467 | 0.534 | 0.600 | 0.600 | 0.734 |
| 16 | 0.438 | 0.500 | 0.563 | 0.625 | 0.688 |
| 17 | 0.471 | 0.471 | 0.530 | 0.589 | 0.706 |
| 18 | 0.445 | 0.500 | 0.556 | 0.556 | 0.667 |
| 19 | 0.422 | 0.474 | 0.527 | 0.527 | 0.632 |
| 20 | 0.400 | 0.450 | 0.500 | 0.550 | 0.650 |
| 21 | 0.381 | 0.429 | 0.477 | 0.524 | 0.620 |
| 22 | 0.410 | 0.410 | 0.500 | 0.500 | 0.591 |
| 23 | 0.392 | 0.435 | 0.479 | 0.479 | 0.566 |
| 24 | 0.375 | 0.417 | 0.459 | 0.500 | 0.584 |
| 25 | 0.360 | 0.400 | 0.440 | 0.480 | 0.560 |
| 26 | 0.347 | 0.385 | 0.424 | 0.462 | 0.539 |
| 27 | 0.334 | 0.371 | 0.445 | 0.445 | 0.556 |
| 28 | 0.358 | 0.393 | 0.429 | 0.465 | 0.536 |
| 29 | 0.345 | 0.380 | 0.414 | 0.449 | 0.518 |
| 30 | 0.334 | 0.367 | 0.400 | 0.434 | 0.500 |
| 31 | 0.323 | 0.355 | 0.388 | 0.420 | 0.517 |
| 32 | 0.313 | 0.344 | 0.407 | 0.407 | 0.500 |
| 33 | 0.304 | 0.364 | 0.394 | 0.425 | 0.485 |
| 34 | 0.324 | 0.353 | 0.383 | 0.412 | 0.471 |
| 35 | 0.315 | 0.343 | 0.372 | 0.400 | 0.486 |
| 36 | 0.306 | 0.334 | 0.362 | 0.389 | 0.473 |
| 37 | 0.298 | 0.325 | 0.379 | 0.379 | 0.460 |
| 38 | 0.290 | 0.316 | 0.369 | 0.395 | 0.448 |
| 39 | 0.283 | 0.308 | 0.359 | 0.385 | 0.462 |
| 40 | 0.275 | 0.325 | 0.350 | 0.375 | 0.450 |
Unequal sample sizes, two-sided α = 0.05
| Size of the second sample (n₂) → n₁ \ n₂ ↓ | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | — | — | — | — | — | — | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 0.934 | 0.938 | 0.942 | 0.945 | 0.948 | 0.950 |
| 3 | — | — | — | 1.000 | 1.000 | 1.000 | 0.875 | 0.889 | 0.900 | 0.910 | 0.834 | 0.847 | 0.858 | 0.800 | 0.813 | 0.824 | 0.834 | 0.790 | 0.800 |
| 4 | — | — | 1.000 | 1.000 | 0.834 | 0.858 | 0.875 | 0.778 | 0.750 | 0.750 | 0.750 | 0.750 | 0.750 | 0.734 | 0.750 | 0.706 | 0.695 | 0.698 | 0.750 |
| 5 | — | 1.000 | 1.000 | 1.000 | 0.800 | 0.800 | 0.750 | 0.778 | 0.800 | 0.710 | 0.717 | 0.693 | 0.658 | 0.734 | 0.675 | 0.648 | 0.667 | 0.643 | 0.650 |
| 6 | — | 1.000 | 0.834 | 0.800 | 0.834 | 0.715 | 0.709 | 0.723 | 0.667 | 0.652 | 0.667 | 0.667 | 0.643 | 0.634 | 0.625 | 0.608 | 0.667 | 0.615 | 0.600 |
| 7 | — | 1.000 | 0.858 | 0.800 | 0.715 | 0.858 | 0.715 | 0.667 | 0.658 | 0.624 | 0.631 | 0.616 | 0.643 | 0.591 | 0.572 | 0.572 | 0.572 | 0.572 | 0.565 |
| 8 | 1.000 | 0.875 | 0.875 | 0.750 | 0.709 | 0.715 | 0.750 | 0.639 | 0.600 | 0.603 | 0.625 | 0.597 | 0.572 | 0.559 | 0.625 | 0.567 | 0.556 | 0.540 | 0.550 |
| 9 | 1.000 | 0.889 | 0.778 | 0.778 | 0.723 | 0.667 | 0.639 | 0.667 | 0.589 | 0.596 | 0.584 | 0.556 | 0.556 | 0.556 | 0.542 | 0.536 | 0.556 | 0.521 | 0.517 |
| 10 | 1.000 | 0.900 | 0.750 | 0.800 | 0.667 | 0.658 | 0.600 | 0.589 | 0.700 | 0.546 | 0.550 | 0.539 | 0.529 | 0.534 | 0.525 | 0.524 | 0.512 | 0.495 | 0.550 |
| 11 | 1.000 | 0.910 | 0.750 | 0.710 | 0.652 | 0.624 | 0.603 | 0.596 | 0.546 | 0.637 | 0.546 | 0.525 | 0.533 | 0.510 | 0.506 | 0.498 | 0.490 | 0.489 | 0.487 |
| 12 | 1.000 | 0.834 | 0.750 | 0.717 | 0.667 | 0.631 | 0.625 | 0.584 | 0.550 | 0.546 | 0.584 | 0.520 | 0.512 | 0.517 | 0.500 | 0.491 | 0.500 | 0.474 | 0.484 |
| 13 | 1.000 | 0.847 | 0.750 | 0.693 | 0.667 | 0.616 | 0.597 | 0.556 | 0.539 | 0.525 | 0.520 | 0.539 | 0.490 | 0.493 | 0.486 | 0.476 | 0.471 | 0.462 | 0.462 |
| 14 | 1.000 | 0.858 | 0.750 | 0.658 | 0.643 | 0.643 | 0.572 | 0.556 | 0.529 | 0.533 | 0.512 | 0.490 | 0.572 | 0.467 | 0.474 | 0.467 | 0.461 | 0.455 | 0.450 |
| 15 | 0.934 | 0.800 | 0.734 | 0.734 | 0.634 | 0.591 | 0.559 | 0.556 | 0.534 | 0.510 | 0.517 | 0.493 | 0.467 | 0.534 | 0.475 | 0.455 | 0.456 | 0.446 | 0.450 |
| 16 | 0.938 | 0.813 | 0.750 | 0.675 | 0.625 | 0.572 | 0.625 | 0.542 | 0.525 | 0.506 | 0.500 | 0.486 | 0.474 | 0.475 | 0.500 | 0.456 | 0.445 | 0.438 | 0.438 |
| 17 | 0.942 | 0.824 | 0.706 | 0.648 | 0.608 | 0.572 | 0.567 | 0.536 | 0.524 | 0.498 | 0.491 | 0.476 | 0.467 | 0.455 | 0.456 | 0.471 | 0.435 | 0.437 | 0.430 |
| 18 | 0.945 | 0.834 | 0.695 | 0.667 | 0.667 | 0.572 | 0.556 | 0.556 | 0.512 | 0.490 | 0.500 | 0.471 | 0.461 | 0.456 | 0.445 | 0.435 | 0.500 | 0.416 | 0.423 |
| 19 | 0.948 | 0.790 | 0.698 | 0.643 | 0.615 | 0.572 | 0.540 | 0.521 | 0.495 | 0.489 | 0.474 | 0.462 | 0.455 | 0.446 | 0.438 | 0.437 | 0.416 | 0.474 | 0.422 |
| 20 | 0.950 | 0.800 | 0.750 | 0.650 | 0.600 | 0.565 | 0.550 | 0.517 | 0.550 | 0.487 | 0.484 | 0.462 | 0.450 | 0.450 | 0.438 | 0.430 | 0.423 | 0.422 | 0.450 |
Unequal sample sizes, two-sided α = 0.01
| Size of the second sample (n₂) → n₁ \ n₂ ↓ | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2 | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | — | 1.000 | 1.000 |
| 3 | — | — | — | — | — | — | — | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 | 0.934 | 0.938 | 0.942 | 0.945 | 0.948 | 0.950 |
| 4 | — | — | — | — | 1.000 | 1.000 | 1.000 | 1.000 | 0.900 | 0.910 | 0.917 | 0.924 | 0.858 | 0.867 | 0.875 | 0.883 | 0.834 | 0.843 | 0.850 |
| 5 | — | — | — | 1.000 | 1.000 | 1.000 | 0.875 | 0.889 | 0.900 | 0.819 | 0.834 | 0.800 | 0.800 | 0.800 | 0.800 | 0.800 | 0.778 | 0.748 | 0.800 |
| 6 | — | — | 1.000 | 1.000 | 1.000 | 0.858 | 0.834 | 0.834 | 0.800 | 0.819 | 0.834 | 0.770 | 0.762 | 0.767 | 0.750 | 0.716 | 0.778 | 0.729 | 0.734 |
| 7 | — | — | 1.000 | 1.000 | 0.858 | 0.858 | 0.858 | 0.778 | 0.758 | 0.767 | 0.715 | 0.715 | 0.786 | 0.715 | 0.688 | 0.706 | 0.691 | 0.685 | 0.665 |
| 8 | — | — | 1.000 | 0.875 | 0.834 | 0.858 | 0.875 | 0.764 | 0.750 | 0.728 | 0.709 | 0.693 | 0.679 | 0.675 | 0.688 | 0.648 | 0.653 | 0.645 | 0.650 |
| 9 | — | 1.000 | 1.000 | 0.889 | 0.834 | 0.778 | 0.764 | 0.778 | 0.700 | 0.708 | 0.695 | 0.667 | 0.667 | 0.667 | 0.653 | 0.648 | 0.667 | 0.626 | 0.617 |
| 10 | — | 1.000 | 0.900 | 0.900 | 0.800 | 0.758 | 0.750 | 0.700 | 0.800 | 0.700 | 0.667 | 0.647 | 0.643 | 0.667 | 0.625 | 0.624 | 0.600 | 0.595 | 0.650 |
| 11 | — | 1.000 | 0.910 | 0.819 | 0.819 | 0.767 | 0.728 | 0.708 | 0.700 | 0.728 | 0.652 | 0.637 | 0.624 | 0.619 | 0.603 | 0.589 | 0.596 | 0.584 | 0.578 |
| 12 | — | 1.000 | 0.917 | 0.834 | 0.834 | 0.715 | 0.709 | 0.695 | 0.667 | 0.652 | 0.667 | 0.609 | 0.620 | 0.600 | 0.605 | 0.584 | 0.584 | 0.571 | 0.584 |
| 13 | — | 1.000 | 0.924 | 0.800 | 0.770 | 0.715 | 0.693 | 0.667 | 0.647 | 0.637 | 0.609 | 0.693 | 0.572 | 0.590 | 0.582 | 0.575 | 0.560 | 0.559 | 0.550 |
| 14 | — | 1.000 | 0.858 | 0.800 | 0.762 | 0.786 | 0.679 | 0.667 | 0.643 | 0.624 | 0.620 | 0.572 | 0.643 | 0.586 | 0.563 | 0.564 | 0.556 | 0.557 | 0.543 |
| 15 | — | 0.934 | 0.867 | 0.800 | 0.767 | 0.715 | 0.675 | 0.667 | 0.667 | 0.619 | 0.600 | 0.590 | 0.586 | 0.600 | 0.555 | 0.557 | 0.545 | 0.534 | 0.534 |
| 16 | — | 0.938 | 0.875 | 0.800 | 0.750 | 0.688 | 0.688 | 0.653 | 0.625 | 0.603 | 0.605 | 0.582 | 0.563 | 0.555 | 0.625 | 0.526 | 0.535 | 0.527 | 0.525 |
| 17 | — | 0.942 | 0.883 | 0.800 | 0.716 | 0.706 | 0.648 | 0.648 | 0.624 | 0.589 | 0.584 | 0.575 | 0.564 | 0.557 | 0.526 | 0.589 | 0.536 | 0.514 | 0.515 |
| 18 | — | 0.945 | 0.834 | 0.778 | 0.778 | 0.691 | 0.653 | 0.667 | 0.600 | 0.596 | 0.584 | 0.560 | 0.556 | 0.545 | 0.535 | 0.536 | 0.556 | 0.515 | 0.506 |
| 19 | 1.000 | 0.948 | 0.843 | 0.748 | 0.729 | 0.685 | 0.645 | 0.626 | 0.595 | 0.584 | 0.571 | 0.559 | 0.557 | 0.534 | 0.527 | 0.514 | 0.515 | 0.527 | 0.493 |
| 20 | 1.000 | 0.950 | 0.850 | 0.800 | 0.734 | 0.665 | 0.650 | 0.617 | 0.650 | 0.578 | 0.584 | 0.550 | 0.543 | 0.534 | 0.525 | 0.515 | 0.506 | 0.493 | 0.550 |
Tip: click any value to highlight its row and column.
How to read this table
- Compute the empirical distribution function of each sample and D, the largest vertical distance between them.
- For equal sample sizes use the first table; otherwise use the table for your α with n₁ as the row and n₂ as the column.
- Reject H₀ if D is greater than or equal to the table value.
Worked example
Time-to-onset data from two sites with 10 patients each give D = 0.70. Row n = 10, α = 0.05 of the equal-size table gives 0.700, so the two distributions differ at the 5% level. With equal samples D can only take values in steps of 1/n, which is why the critical values jump.
Click the underlined links to highlight the value in the table.
Calculator
For values between the rows and columns of the table. Results update as you type.
Formula and how the values were computed
Values come from the exact null distribution of D, computed by counting the lattice paths that stay inside the band |i/n₁ − j/n₂| < d. Each entry is the smallest attainable D with P(D ≥ d) ≤ α, rounded up to three decimals.
Frequently asked questions
What does the two-sample KS test detect?
Any difference between the two distributions: location, spread or shape. For a shift in location alone, the Mann-Whitney U test is usually more powerful.
What about ties?
The exact values assume continuous data. With many ties the test is conservative.