Distance Formula Calculator
By Sagar Kumar · Updated 25 October 2026
Enter two points to get the distance between them, the midpoint, the slope and the equation of the line — with every step shown.
| Midpoint | — |
| Slope (m) | — |
| Line equation | — |
Formulas
Midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Slope m = (y₂ − y₁) ÷ (x₂ − x₁)
Line: y − y₁ = m(x − x₁)
Example: (1, 2) and (4, 6) → distance 5, midpoint (2.5, 4), slope 4/3 ≈ 1.333, line y = 1.333x + 0.667.
हिंदी में समझें
दो बिंदुओं के बीच दूरी = √[(x₂ − x₁)² + (y₂ − y₁)²]। जैसे (1, 2) और (4, 6) के बीच दूरी = √(9 + 16) = 5। ढलान (slope) = (y₂ − y₁) ÷ (x₂ − x₁)।
Frequently asked questions
What is the distance formula?
d = √[(x₂ − x₁)² + (y₂ − y₁)²]. It comes from the Pythagoras theorem applied to the horizontal and vertical gaps between two points.
What is the distance between (1, 2) and (4, 6)?
d = √[(4 − 1)² + (6 − 2)²] = √(9 + 16) = √25 = 5.
How do I find the midpoint of two points?
Average the x-values and the y-values: ((x₁ + x₂)/2, (y₁ + y₂)/2). For (1, 2) and (4, 6) the midpoint is (2.5, 4).
How do I find the slope of a line?
Slope m = (y₂ − y₁) ÷ (x₂ − x₁) — rise over run. For (1, 2) and (4, 6), m = 4 ÷ 3 ≈ 1.333. A vertical line has an undefined slope.
What is the equation of the line through two points?
Use y − y₁ = m(x − x₁). For (1, 2) with slope 4/3: y = 1.333x + 0.667.