Distance Calculator
Find the straight-line distance between two points on a Cartesian plane.
2D distance formula
Enter two points on a Cartesian plane
Point 1 (P₁)
Point 2 (P₂)
What is a 2D distance calculator?
A 2D distance calculator returns the straight-line gap between two points on a flat Cartesian plane. Subtract the x-coordinates to get the horizontal leg Δx, subtract the y-coordinates to get the vertical leg Δy, and the segment connecting the points is the hypotenuse of the right triangle they form. The Pythagorean theorem then gives d = √[(x₂ − x₁)² + (y₂ − y₁)²] in a single closed-form expression — the same formula every coordinate-geometry textbook spells out.
Knowing the distance is only half the story. The same two points also pin down a midpoint that lies exactly halfway between them, a slope m = Δy/Δx that describes how steeply the line rises, an angle of inclination θ = arctan(m) measured against the +x axis, and the equation of the unique line through both points in three canonical forms — slope-intercept y = mx + b, point-slope y − y₁ = m(x − x₁), and standard Ax + By + C = 0. This calculator returns every one of those quantities together so a single Calculate press answers the whole family of questions a coordinate-geometry problem typically asks.
How the 2D distance calculator works
Enter two points
Type the x and y coordinates of point 1 and point 2. Negative values and decimals are accepted; the calculator uses the exact values you enter without any rounding.
Read the headline
The distance is shown as both a decimal and a simplified-radical exact form (e.g. √50 = 5√2). The midpoint, slope as a clean fraction, angle of inclination, and quadrant of the direction vector appear alongside.
Inspect the line equation
The line through the two points is rendered in slope-intercept, point-slope, and standard form. The x-intercept, y-intercept, and compass bearing of the segment are surfaced as separate stat tiles.
Step through the math
An expandable step-by-step panel mirrors the working you would write on paper, from the substitution into the formula through the simplification of the radical and the final answer.
Formulas inside the 2D tool
2D distance
d = √[(x₂ − x₁)² + (y₂ − y₁)²]
Straight-line gap, derived from Pythagoras' theorem.
Slope
m = (y₂ − y₁) / (x₂ − x₁)
Rise over run; undefined when x₁ = x₂ (vertical line).
Angle of inclination
θ = arctan(m)
Counter-clockwise angle from the +x axis.
Midpoint
M = ((x₁ + x₂)/2, (y₁ + y₂)/2)
Average the x's and the y's independently.
Slope-intercept form
y = mx + b
Standard high-school form, b is the y-intercept.
Point-slope form
y − y₁ = m(x − x₁)
Convenient when one point and the slope are known.
Standard form
Ax + By + C = 0
Integer-coefficient version preferred in algebra texts.
Where 2D distance is used
Geometry homework
Coordinate-geometry units across pre-algebra, algebra 1, geometry, and pre-calculus rely on the distance formula plus its companions for slope, midpoint, and line equations — exactly what this tab returns in one click.
Game development
Distance checks between players, enemies, projectiles, and items are the most-called function in any 2D game engine. The same √(Δx² + Δy²) drives collision detection, AI awareness radii, and damage falloff.
CAD sketches and drafting
Every dimension constraint on a 2D drafting plane — the distance between two corners, the offset between two slots, the gap between a hole and an edge — is the value this formula returns.
Data plotting
Scatter-plot distance between observations, click-target hit-testing on a chart, and tooltip nearest-neighbour lookups all use 2D Euclidean distance under the hood.
Why a calculator instead of paper?
The 2D distance formula is short, but the surrounding quantities — slope as a clean fraction, angle of inclination in degrees, midpoint in fully-reduced form, and the line equation in three written-out forms — add up to seven separate small calculations from two coordinates. Doing them all by hand is mechanical and error-prone, especially when the numbers are messy or negative. This calculator runs the entire bundle at once so the answer arrives with full context and full working.
Frequently Asked Questions
Related Calculators
More coordinate-geometry, trig, and unit tools that pair with distance calculations.
- Pythagorean Theorem CalculatorSolve any side of a right triangle, plus area, perimeter, and angles.
- Slope CalculatorSlope, angle, distance, midpoint, intercepts, and the line equation with an interactive coordinate-plane graph.
- Triangle CalculatorSolve any triangle (SSS, SAS, ASA, AAS, SSA) for sides, angles, area, altitudes, medians, inradius, circumradius and centres.
- Circle CalculatorFind area, circumference, diameter, and radius from any one known value.
- Scientific CalculatorAdvanced trig, log, exponent, root, factorial, and memory functions.
- Unit ConverterAll-in-one converter for 40+ measurement categories with natural-language input.