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)

Equal sample sizes (n₁ = n₂ = n)
Two-sided α →
n ↓
0.10.050.020.010.001
31.000————
41.0001.000———
50.8001.0001.0001.000—
60.8340.8341.0001.000—
70.7150.8580.8580.8581.000
80.6250.7500.7500.8751.000
90.6670.6670.7780.7780.889
100.6000.7000.7000.8000.900
110.5460.6370.7280.7280.819
120.5000.5840.6670.6670.834
130.5390.5390.6160.6930.770
140.5000.5720.5720.6430.786
150.4670.5340.6000.6000.734
160.4380.5000.5630.6250.688
170.4710.4710.5300.5890.706
180.4450.5000.5560.5560.667
190.4220.4740.5270.5270.632
200.4000.4500.5000.5500.650
210.3810.4290.4770.5240.620
220.4100.4100.5000.5000.591
230.3920.4350.4790.4790.566
240.3750.4170.4590.5000.584
250.3600.4000.4400.4800.560
260.3470.3850.4240.4620.539
270.3340.3710.4450.4450.556
280.3580.3930.4290.4650.536
290.3450.3800.4140.4490.518
300.3340.3670.4000.4340.500
310.3230.3550.3880.4200.517
320.3130.3440.4070.4070.500
330.3040.3640.3940.4250.485
340.3240.3530.3830.4120.471
350.3150.3430.3720.4000.486
360.3060.3340.3620.3890.473
370.2980.3250.3790.3790.460
380.2900.3160.3690.3950.448
390.2830.3080.3590.3850.462
400.2750.3250.3500.3750.450

Unequal sample sizes, two-sided α = 0.05

Unequal sample sizes, two-sided α = 0.05
Size of the second sample (n₂) →
n₁ \ n₂ ↓
234567891011121314151617181920
2——————1.0001.0001.0001.0001.0001.0001.0000.9340.9380.9420.9450.9480.950
3———1.0001.0001.0000.8750.8890.9000.9100.8340.8470.8580.8000.8130.8240.8340.7900.800
4——1.0001.0000.8340.8580.8750.7780.7500.7500.7500.7500.7500.7340.7500.7060.6950.6980.750
5—1.0001.0001.0000.8000.8000.7500.7780.8000.7100.7170.6930.6580.7340.6750.6480.6670.6430.650
6—1.0000.8340.8000.8340.7150.7090.7230.6670.6520.6670.6670.6430.6340.6250.6080.6670.6150.600
7—1.0000.8580.8000.7150.8580.7150.6670.6580.6240.6310.6160.6430.5910.5720.5720.5720.5720.565
81.0000.8750.8750.7500.7090.7150.7500.6390.6000.6030.6250.5970.5720.5590.6250.5670.5560.5400.550
91.0000.8890.7780.7780.7230.6670.6390.6670.5890.5960.5840.5560.5560.5560.5420.5360.5560.5210.517
101.0000.9000.7500.8000.6670.6580.6000.5890.7000.5460.5500.5390.5290.5340.5250.5240.5120.4950.550
111.0000.9100.7500.7100.6520.6240.6030.5960.5460.6370.5460.5250.5330.5100.5060.4980.4900.4890.487
121.0000.8340.7500.7170.6670.6310.6250.5840.5500.5460.5840.5200.5120.5170.5000.4910.5000.4740.484
131.0000.8470.7500.6930.6670.6160.5970.5560.5390.5250.5200.5390.4900.4930.4860.4760.4710.4620.462
141.0000.8580.7500.6580.6430.6430.5720.5560.5290.5330.5120.4900.5720.4670.4740.4670.4610.4550.450
150.9340.8000.7340.7340.6340.5910.5590.5560.5340.5100.5170.4930.4670.5340.4750.4550.4560.4460.450
160.9380.8130.7500.6750.6250.5720.6250.5420.5250.5060.5000.4860.4740.4750.5000.4560.4450.4380.438
170.9420.8240.7060.6480.6080.5720.5670.5360.5240.4980.4910.4760.4670.4550.4560.4710.4350.4370.430
180.9450.8340.6950.6670.6670.5720.5560.5560.5120.4900.5000.4710.4610.4560.4450.4350.5000.4160.423
190.9480.7900.6980.6430.6150.5720.5400.5210.4950.4890.4740.4620.4550.4460.4380.4370.4160.4740.422
200.9500.8000.7500.6500.6000.5650.5500.5170.5500.4870.4840.4620.4500.4500.4380.4300.4230.4220.450

Unequal sample sizes, two-sided α = 0.01

Unequal sample sizes, two-sided α = 0.01
Size of the second sample (n₂) →
n₁ \ n₂ ↓
234567891011121314151617181920
2—————————————————1.0001.000
3———————1.0001.0001.0001.0001.0001.0000.9340.9380.9420.9450.9480.950
4————1.0001.0001.0001.0000.9000.9100.9170.9240.8580.8670.8750.8830.8340.8430.850
5———1.0001.0001.0000.8750.8890.9000.8190.8340.8000.8000.8000.8000.8000.7780.7480.800
6——1.0001.0001.0000.8580.8340.8340.8000.8190.8340.7700.7620.7670.7500.7160.7780.7290.734
7——1.0001.0000.8580.8580.8580.7780.7580.7670.7150.7150.7860.7150.6880.7060.6910.6850.665
8——1.0000.8750.8340.8580.8750.7640.7500.7280.7090.6930.6790.6750.6880.6480.6530.6450.650
9—1.0001.0000.8890.8340.7780.7640.7780.7000.7080.6950.6670.6670.6670.6530.6480.6670.6260.617
10—1.0000.9000.9000.8000.7580.7500.7000.8000.7000.6670.6470.6430.6670.6250.6240.6000.5950.650
11—1.0000.9100.8190.8190.7670.7280.7080.7000.7280.6520.6370.6240.6190.6030.5890.5960.5840.578
12—1.0000.9170.8340.8340.7150.7090.6950.6670.6520.6670.6090.6200.6000.6050.5840.5840.5710.584
13—1.0000.9240.8000.7700.7150.6930.6670.6470.6370.6090.6930.5720.5900.5820.5750.5600.5590.550
14—1.0000.8580.8000.7620.7860.6790.6670.6430.6240.6200.5720.6430.5860.5630.5640.5560.5570.543
15—0.9340.8670.8000.7670.7150.6750.6670.6670.6190.6000.5900.5860.6000.5550.5570.5450.5340.534
16—0.9380.8750.8000.7500.6880.6880.6530.6250.6030.6050.5820.5630.5550.6250.5260.5350.5270.525
17—0.9420.8830.8000.7160.7060.6480.6480.6240.5890.5840.5750.5640.5570.5260.5890.5360.5140.515
18—0.9450.8340.7780.7780.6910.6530.6670.6000.5960.5840.5600.5560.5450.5350.5360.5560.5150.506
191.0000.9480.8430.7480.7290.6850.6450.6260.5950.5840.5710.5590.5570.5340.5270.5140.5150.5270.493
201.0000.9500.8500.8000.7340.6650.6500.6170.6500.5780.5840.5500.5430.5340.5250.5150.5060.4930.550

Tip: click any value to highlight its row and column.

How to read this table

  1. Compute the empirical distribution function of each sample and D, the largest vertical distance between them.
  2. For equal sample sizes use the first table; otherwise use the table for your α with n₁ as the row and n₂ as the column.
  3. 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

D = maxx |F₁(x) − F₂(x)|  ·  large samples: Dcrit ≈ c(α) √((n₁ + n₂)/(n₁n₂)), c(0.05) = 1.358

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.

Related calculators and tutorials