Skip to content

Advertisement

Two-sample Kolmogorov-Smirnov test calculator

Paste two independent samples. The calculator compares their empirical CDFs at every observed point.

Approximate p-value: —

Fill in the fields above — the result is computed on this page.

Sample size A
—
Sample size B
—
D statistic
—
Effective sample size
—
Adjusted λ
—

Empirical CDFs

x F_A(x) F_B(x) |F_A − F_B|
Fill in the fields above — the result is computed on this page.
What these numbers mean
  • A large D means a strong difference between the empirical distributions.
  • Report D with both sample sizes and the method used for p.

The classical test assumes independent observations from continuous distributions. Many ties or discrete data change the statistic distribution; a permutation procedure or a method designed for discrete data is then preferable.

How to use this page
  1. Paste two independent samples.
  2. Find the largest CDF difference in the table.
  3. Read D and the approximate p-value.

What this page does not do: The classical test assumes independent observations from continuous distributions. Many ties or discrete data change the statistic distribution; a permutation procedure or a method designed for discrete data is then preferable.

Further reading

The two-sample Kolmogorov-Smirnov test measures the largest vertical distance D between two empirical cumulative distribution functions. It can react to differences in location, spread or shape.

The p-value uses the asymptotic distribution of the statistic with a finite-sample adjustment. The table shows where the empirical CDFs differ most.

Frequently asked questions

Does the test compare only means?

No. It compares the complete empirical distributions and can detect location, spread or shape differences.

Are ties allowed?

The calculator processes them, but the classical asymptotic p-value is not exact when many ties occur.

See also

← All calculators

Advertisement
Offline app and draw notifications

My saved selections

Selections saved only in this browser. Numbers are shown exactly as saved; this is not a lottery ticket.

Open the My saved selections hub
Restore with preview

Restore in the hub: review the file and confirm first. Both old backups and the complete selections + journal backup are supported. Nothing is uploaded.