Advanced Kolmogorov-Smirnov Test Calculator

Compare samples against distributions using clear statistical outputs. See decision thresholds, confidence cues, and charts. Download polished summaries for audits, reports, classes, or reviews.

Calculator form

Unchecked mode uses your manual distribution parameters.
Example: 12, 14, 15, 15, 16, 17, 18, 18, 19, 20
Used only in two-sample mode.

Example data table

Example Sample A Sample B or reference Suggested mode
Normality check 12, 14, 15, 15, 16, 17, 18, 18, 19, 20 Normal distribution with μ = 16.4 and σ = 2.46 One-sample
Process comparison 10, 11, 13, 13, 14, 15, 15, 16, 18, 19 9, 10, 10, 12, 13, 14, 16, 17, 18, 20 Two-sample
Uniformity check 2, 4, 5, 5, 6, 7, 8, 9, 9, 10 Uniform distribution with a = 2 and b = 10 One-sample

Formula used

One-sample Kolmogorov-Smirnov test

The statistic compares the empirical cumulative distribution function of the sample with a theoretical cumulative distribution function.

D+ = max[i/n - F(xᵢ)]

D- = max[F(xᵢ) - (i-1)/n]

D = max(D+, D-)

Two-sample Kolmogorov-Smirnov test

The statistic measures the largest vertical gap between two empirical cumulative distribution functions.

D = supₓ |Fₙ(x) - Gₘ(x)|

Approximate p-value and critical value

λ = (√n + 0.12 + 0.11/√n) × D for one-sample mode.

nₑ = nm / (n + m) and λ = (√nₑ + 0.12 + 0.11/√nₑ) × D for two-sample mode.

Critical values use c(α) / √n or c(α) / √nₑ, where c(0.05) = 1.36.

When theoretical parameters are estimated from the same sample, the p-value becomes an approximation and should be interpreted with care.

How to use this calculator

  1. Choose one-sample mode to compare a sample with a theoretical distribution.
  2. Choose two-sample mode to compare whether two datasets follow similar distributions.
  3. Paste numbers into Sample A, and Sample B if needed.
  4. Select the significance level that matches your decision rule.
  5. In one-sample mode, pick a distribution and either estimate parameters or enter them manually.
  6. Submit the form to view D, p-value, critical value, diagnostics, and the chart.
  7. Use the export buttons to save results as CSV or PDF.

FAQs

1. What does the KS test check?

It checks whether a sample follows a chosen distribution, or whether two samples come from similar distributions. It focuses on the largest gap between cumulative distribution curves.

2. What is the difference between one-sample and two-sample mode?

One-sample mode compares data with a theoretical model. Two-sample mode compares two real datasets directly, without assuming a specific distributional family.

3. How should I interpret the D statistic?

A larger D means a larger separation between cumulative curves. Small D values suggest closer agreement, while large values suggest stronger distributional differences.

4. What does the p-value mean here?

The p-value estimates how likely a difference this large would appear if the null hypothesis were true. Smaller p-values indicate stronger evidence against the null.

5. Can I estimate distribution parameters from the same sample?

Yes. This calculator allows that option for convenience. Still, when parameters are estimated from the same data, the reported p-value is approximate rather than exact.

6. Does the calculator handle tied values?

Yes. Repeated values are accepted and grouped during cumulative calculations. Heavy ties can affect the strict assumptions of continuous-distribution KS tests, so interpret carefully.

7. Which alpha level should I choose?

Use the alpha level required by your project, class, or quality rule. Common choices are 0.05 and 0.01, with smaller values giving stricter rejection thresholds.

8. What do the CSV and PDF exports include?

They include the test mode, summary statistics, decision output, sample summaries, and the full diagnostic table used to build the displayed cumulative comparison.

Related Calculators

brunner munzel testspearman rank correlation calculatoriqr calculatorkernel density estimatorfisher exact test calculatorgoodman kruskal gammacramer v calculatortheil sen estimatorkruskal wallis test calculatoranderson darling test calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.