Calculators

Hellinger Distance Calculator

Calculate bounded Hellinger distance between two distributions with automatic normalization of counts or probabilities in your browser.

Enter matching non-negative counts, weights or probabilities. Each vector is normalized independently to sum to 1. Separate values with spaces, commas or semicolons. Each vector allows 1–10000 values and 200000 characters; nonzero values must be between 1e-100 and 1e100. At least one value per vector must be positive. Coordinates must represent the same categories in the same order. Calculation runs locally in your browser.

Your Hellinger distance will appear here.

How Hellinger distance works

Hellinger distance is √(Σ(√pᵢ − √qᵢ)² / 2), using the convention that ranges from 0 to 1. Each input vector is independently divided by its total before comparison. Identical distributions have distance 0; distributions with disjoint support have distance 1. For A = (1, 0) and B = (0, 1), the result is 1. For A = (1, 3) and B = (2, 6), the result is 0 because their proportions match. Coordinates must describe the same categories in the same order. This compares distributions rather than absolute totals: multiplying either vector by a positive constant preserves the result. Paired zeros are allowed, but an all-zero vector cannot define a distribution. Inputs accept 1 to 10000 non-negative decimal numbers separated by spaces, commas or semicolons and up to 200000 characters per vector. Scientific notation is supported; nonzero values must be between 1e-100 and 1e100. Scaled normalization and hypotenuse arithmetic reduce overflow. Floating-point rounding can hide extremely small differences; results show up to 12 significant digits. Squared Hellinger distance is also reported. All processing stays in your browser.

Frequently Asked Questions

Everything you need to know about this tool, how it works, and privacy.

What formula does this calculator use?

H = √(Σ(√pᵢ − √qᵢ)² / 2). This convention ranges from 0 to 1; omitting the factor 1/√2 would instead give a maximum of √2.

Do my values need to sum to one?

No. Each vector is independently normalized, so non-negative counts, weights and probabilities are accepted. Each vector must have a positive total.

What do zero and one mean?

Zero indicates matching probability distributions. One indicates disjoint support: no coordinate is positive in both distributions.

How does this differ from Euclidean distance?

Hellinger distance applies Euclidean distance to square roots of normalized probabilities and divides by √2. It ignores differences in total counts.

What are the input limits?

Use equal-length vectors of 1 to 10000 non-negative numbers, up to 200000 characters each. Nonzero values must be between 1e-100 and 1e100. Tiny differences may round away in browser floating-point arithmetic.