Calculators

Minkowski Distance Calculator

Calculate the Lp distance between two signed numeric vectors with an adjustable order, privately in your browser.

Enter equal-length numeric vectors, separated by spaces, commas or semicolons. Signed values and scientific notation are supported. Each vector allows 10000 numbers and 200000 characters. Choose an order p from 1 to 1000. Order 1 gives Manhattan distance; order 2 gives Euclidean distance. Coordinates must use comparable units and matching order. Calculation runs locally in your browser.

Your Minkowski distance will appear here.

How Minkowski distance works

Minkowski distance is (Σ|aᵢ − bᵢ|ᵖ)^(1/p), where p is at least 1. For A = (1, 2) and B = (4, 6), order 1 gives 7, order 2 gives 5, and order 3 gives approximately 4.49794144528. As p increases, the distance approaches the largest coordinate difference (Chebyshev distance). Fractional orders are supported from 1 to 1000. Values below 1 are excluded because they do not define a metric. Identical vectors have distance zero. Match coordinate order and use comparable units and scales; inputs are not normalized. Enter 1 to 10000 signed finite decimal numbers per vector separated by spaces, commas or semicolons, up to 200000 characters per vector. Scientific notation is supported; commas separate values rather than thousands. Scaled powers and compensated summation reduce overflow and rounding error. Very small relative terms can round away; values that underflow to zero and unrepresentable differences or results are rejected. Results display up to 12 significant digits. All calculation stays in your browser.

Frequently Asked Questions

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

What is the Minkowski distance formula?

The formula is (Σ|aᵢ − bᵢ|ᵖ)^(1/p). With coordinate differences 3 and 4, p = 3 gives approximately 4.49794144528.

Which order should I use?

Order 1 gives Manhattan distance and order 2 gives Euclidean distance. Larger orders emphasize the largest coordinate differences and approach Chebyshev distance.

Can p be fractional or less than one?

Fractional orders from 1 to 1000 are supported. Orders below 1 are excluded because the resulting function does not satisfy the triangle inequality required of a metric.

Can I enter negative values or zero vectors?

Yes. Signed finite numbers and scientific notation are supported. Identical vectors, including two zero vectors, have distance zero. Both vectors must have equal lengths and matching coordinate units.

What are the input limits?

Each vector accepts 1 to 10000 numbers and up to 200000 characters. Unrepresentable values, coordinate differences and results are rejected. Results use floating-point arithmetic with up to 12 significant digits; tiny relative contributions can round away.