📏 Distance Between Two Points Calculator

Distance Formula: d = √[(x₂−x₁)² + (y₂−y₁)²] — Enter coordinates of both points below.
📍 Point 1
📍 Point 2
Distance Between Points

Understanding Distance Between Two Points Calculator

The distance between two points in a coordinate plane is the length of the straight line segment connecting them. The distance formula is derived directly from the Pythagorean theorem by treating the horizontal and vertical differences as the two legs of a right triangle.

d = √[(x₂ − x₁)² + (y₂ − y₁)²] Midpoint = ((x₁+x₂)/2, (y₁+y₂)/2) Example: (1,2) to (4,6): d = √[(4-1)² + (6-2)²] = √[9+16] = √25 = 5

Distance Formula Derivation

Consider two points A(x₁, y₁) and B(x₂, y₂). Drop a horizontal line from A and a vertical line from B — they meet at point C(x₂, y₁), forming a right triangle with:

  • Horizontal leg AC = |x₂ − x₁|
  • Vertical leg CB = |y₂ − y₁|
  • Hypotenuse AB = distance we want

Applying the Pythagorean theorem: AB² = AC² + CB² = (x₂−x₁)² + (y₂−y₁)²

Therefore: d = √[(x₂−x₁)² + (y₂−y₁)²]

Worked Examples

Example 1: Simple case

Distance from (0, 0) to (3, 4):

d = √[(3−0)² + (4−0)²] = √[9+16] = √25 = 5

Example 2: Negative coordinates

Distance from (−2, 3) to (4, −1):

d = √[(4−(−2))² + (−1−3)²] = √[36+16] = √52 ≈ 7.211

Example 3: Diagonal of a room

Room is 5m × 12m. Diagonal = distance from (0,0) to (5,12):

d = √[5² + 12²] = √[25+144] = √169 = 13 m

Applications of the Distance Formula

  • GPS & Navigation: Approximate straight-line distance between geographic coordinates
  • Computer graphics: Collision detection, pathfinding algorithms, rendering
  • Data science: k-nearest neighbors algorithm uses Euclidean distance
  • Physics: Displacement magnitude in 2D mechanics
  • Architecture: Floor plan measurements, diagonal room dimensions
  • Sports analytics: Player movement distances on a field

Frequently Asked Questions — Distance Between Two Points Calculator

What is the distance from (0,0) to (5,12)?
d = √(5²+12²) = √(25+144) = √169 = 13 units. This is a classic 5-12-13 Pythagorean triple.
Can the distance between two points be negative?
No. Distance is always non-negative. The formula uses squared terms before taking the square root, which always yields a positive (or zero) result.
What is the distance formula in 3D?
For points (x₁,y₁,z₁) and (x₂,y₂,z₂): d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²]. It extends the 2D formula to three dimensions.

Related Calculators

All Tools →