Midpoint Calculator

Free Midpoint Calculator: find the midpoint of any line segment in 2D or 3D, compute distance, slope, section point (internal/external division), and...

Formule utilis�e

M=((x1+x2)/2,(y1+y2)/2)d=((x2x1)2+(y2y1)2)slope=(y2y1)/(x2x1)M = ((x₁+x₂)/2, (y₁+y₂)/2) | d = √((x₂-x₁)²+(y₂-y₁)²) | slope = (y₂-y₁)/(x₂-x₁)
M=M — The midpoint: the point exactly halfway between P₁ and P₂
x₁y₁=P₁(x₁, y₁) — The first endpoint of the line segment
x₂y₂=P₂(x₂, y₂) — The second endpoint of the line segment
d=d — The Euclidean distance between P₁ and P₂: d = √((x₂−x₁)² + (y₂−y₁)²)
Midpoint Calculator
2D · 3D · Section Formula · Centroid of Multiple Points
Enter two 2D points to find their midpoint, the segment length (distance), slope, and perpendicular bisector equation — all with step-by-step workings.
Point P₁
Point P₂
Formula Quick Reference
2D Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2) Average of coordinates
3D Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2)
Distance Formula
d = √((x₂−x₁)² + (y₂−y₁)²) Pythagorean theorem in 2D
3D Distance
d = √(Δx² + Δy² + Δz²)
Section (Internal)
P = ((mx₂+nx₁)/(m+n), (my₂+ny₁)/(m+n))
Section (External)
P = ((mx₂−nx₁)/(m−n), (my₂−ny₁)/(m−n))
Centroid of n Points
G = (Σxᵢ/n, Σyᵢ/n) Midpoint generalised to n pts
Perpendicular Bisector
Passes through M Slope = −1 / slope(P₁P₂)

How to Use the Midpoint Calculator

This calculator provides four tools for working with line segments and coordinate geometry. Select the tab matching your problem:

  • 2D Midpoint: Enter two points (x₁, y₁) and (x₂, y₂) to find the exact midpoint coordinates, the segment's length (distance), its slope, and the perpendicular bisector equation. All results are shown with step-by-step working.
  • 3D Midpoint: Extend the midpoint formula to three-dimensional space with points (x₁, y₁, z₁) and (x₂, y₂, z₂). Computes midpoint coordinates plus the 3D Euclidean distance between the points.
  • Section Formula: Given two endpoints and a ratio m:n, find the point that divides the segment internally or externally. Internal division gives the point between the endpoints; external division gives the point on the extension of the segment.
  • Multiple Points: Enter up to 6 points and compute the centroid (geometric center of all points), the bounding box, and the span (width/height) of the point set — useful for finding the center of a polygon vertex set.

Press Calculate or hit Enter in any field to compute. Every result tile is click-to-copy. The interactive coordinate graph updates in real time to visualize your segment.

The Midpoint Formula Explained

Midpoint Calculator infographic showing a coordinate grid with two labeled points connected by a dashed line, the midpoint formula M = ((x1+x2)/2, (y1+y2)/2), a step-by-step worked example, and three related formulas: distance, slope, and section formula, on a premium dark navy teal-themed background

The midpoint of a line segment is the point that lies exactly halfway between the two endpoints. Given points P₁(x₁, y₁) and P₂(x₂, y₂), the midpoint M is:

  • M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)

The formula works by averaging the x-coordinates and averaging the y-coordinates independently. This is because the midpoint must be equidistant from both endpoints along each axis. Geometrically, this follows from the midpoint theorem: the segment from each endpoint to M has identical horizontal and vertical projections.

Worked example: P₁ = (2, 3) and P₂ = (8, 11).

  • x-coordinate of M: (2 + 8) / 2 = 10 / 2 = 5
  • y-coordinate of M: (3 + 11) / 2 = 14 / 2 = 7
  • Midpoint M = (5, 7)

Verification using distance: distance from P₁ to M = √((5−2)² + (7−3)²) = √(9+16) = √25 = 5. Distance from M to P₂ = √((8−5)² + (11−7)²) = √(9+16) = √25 = 5. ✓ Equal distances confirm M is the midpoint.

Distance Between Two Points

The distance formula is the extension of the Pythagorean theorem to coordinate geometry:

  • d = √((x₂ − x₁)² + (y₂ − y₁)²)

The horizontal separation Δx = x₂ − x₁ and vertical separation Δy = y₂ − y₁ form the legs of a right triangle, and the distance d is the hypotenuse. This is why the formula involves square root of the sum of squares — it is literally applying the Pythagorean theorem: d² = Δx² + Δy².

For the same example above: d = √((8−2)² + (11−3)²) = √(36 + 64) = √100 = 10. So the segment is 10 units long and the midpoint is 5 units from each endpoint.

The slope of the segment is: m = (y₂ − y₁) / (x₂ − x₁) = (11 − 3) / (8 − 2) = 8/6 = 4/3 ≈ 1.333. The perpendicular bisector has slope −3/4 (negative reciprocal) and passes through the midpoint (5, 7): y − 7 = −(3/4)(x − 5), or 3x + 4y = 43.

Use our Slope Calculator for detailed slope, intercept, and line equation computations — it complements this tool perfectly for coordinate geometry problems.

Midpoint in Three Dimensions

Coordinate geometry reference chart showing 2D midpoint formula, 3D midpoint formula, distance formula with Pythagorean triangle visual, and section formula for internal division in ratio m:n, on a dark premium navy background with teal borders and amber monospace formula text

In three-dimensional space, the midpoint formula extends naturally by adding the z-axis:

  • M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2, (z₁ + z₂) / 2)

The 3D distance between P₁(x₁, y₁, z₁) and P₂(x₂, y₂, z₂) is:

  • d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)

Example: P₁ = (1, 2, 3), P₂ = (7, 6, 9). Midpoint M = ((1+7)/2, (2+6)/2, (3+9)/2) = (4, 4, 6). Distance d = √(36 + 16 + 36) = √88 = 2√22 ≈ 9.381 units.

3D midpoints appear in computer graphics (mesh midpoint subdivision), structural engineering (centroid of 3D frame nodes), molecular chemistry (bond midpoints in 3D molecular models), and GPS navigation (midpoint between two positions on Earth's surface, though spherical calculations are more precise for large distances).

Section Formula — Dividing a Segment in a Given Ratio

The section formula generalizes the midpoint: instead of finding the point at ratio 1:1, it finds the point dividing a segment in any given ratio m:n.

  • Internal division: P = ((mx₂ + nx₁) / (m+n), (my₂ + ny₁) / (m+n)). The point lies between P₁ and P₂.
  • External division: P = ((mx₂ − nx₁) / (m−n), (my₂ − ny₁) / (m−n)). The point lies on the extension of the segment beyond P₂ (when m > n) or beyond P₁ (when m < n).

For ratio 1:1, internal division reduces to the midpoint formula: P = ((1·x₂ + 1·x₁)/2, (1·y₂ + 1·y₁)/2). For ratio 2:1, the point is located 2/3 of the way from P₁ to P₂.

Example: Divide P₁(0, 0) and P₂(9, 12) in ratio 2:1 internally. P = ((2×9 + 1×0)/3, (2×12 + 1×0)/3) = (18/3, 24/3) = (6, 8). Distance from P₁ to P = √(36+64) = 10. Distance from P to P₂ = √(9+16) = 5. Ratio = 10:5 = 2:1. ✓

Section formula applications: trisecting a segment (ratios 1:2 and 2:1), finding where a cevian meets the opposite side in a triangle, computer graphics Bézier curve subdivision, and interpolation in physics simulations.

The Midpoint Theorem and Its Applications

The Midpoint Theorem in geometry states: the line segment joining the midpoints of two sides of a triangle is parallel to the third side and exactly half as long. If M and N are midpoints of sides AB and AC respectively in triangle ABC, then MN ∥ BC and MN = BC/2.

This theorem has powerful applications:

  • Quadrilateral centroid: The diagonals of a parallelogram bisect each other — meaning each diagonal's midpoint is the same point. This is provable directly with the midpoint formula.
  • Centroid of a triangle: The three medians (lines from each vertex to the midpoint of the opposite side) meet at the centroid G = ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3).
  • Circumcenter: The circumcenter of a triangle (center of the circumscribed circle) lies at the intersection of the perpendicular bisectors of the three sides. Each perpendicular bisector passes through the midpoint of its side and has slope equal to the negative reciprocal of that side's slope.
  • Nine-point circle: In any triangle, the midpoints of the three sides are three of the nine points that lie on the nine-point circle, which has a radius equal to half the circumradius.

Real-World Applications of the Midpoint Formula

  • Civil Engineering and Surveying: Finding the center of a bridge span, the midpoint between two survey monuments, or the centroid of a land parcel. When designing a cable-stayed bridge, engineers compute midpoints of each cable attachment to ensure symmetric loading.
  • Computer Graphics and Game Development: Midpoint subdivision is used to generate smooth curves from control points (De Casteljau algorithm for Bézier curves), create fractal terrain (midpoint displacement algorithm), and tessellate meshes. Every frame rendered in a 3D game involves thousands of midpoint calculations.
  • Navigation and GPS: Finding the midpoint of a route for meeting location selection, or determining the geographic center between two city coordinates. For short distances, the midpoint formula on latitude/longitude coordinates works well; for intercontinental distances, spherical midpoint formulas are used. See our Right Triangle Calculator for navigation triangle problems.
  • Medicine and Imaging: In medical imaging (CT, MRI), midpoints are computed to slice volumes along central planes. Landmark-based registration of brain images uses midpoints between anatomical landmarks.
  • Data Science and Machine Learning: The k-means clustering algorithm iteratively computes centroids (generalized midpoints of all points in a cluster) until convergence. The midpoint between cluster centroids is used to draw decision boundaries in binary classifiers. Our Average Calculator handles multi-value mean computations that underpin centroid calculations.
  • Architecture: Finding the center of a floor plan for symmetric design, determining where structural supports should be placed along a beam, or computing the geometric center of an irregular room. The midpoint of the longest diagonal of a rectangle gives its center — use our Circumference Calculator for circular room geometry.

Centroid vs. Midpoint — Key Differences

While the midpoint applies to two points (a line segment), the centroid generalizes to multiple points:

  • Centroid of n points: G = ((x₁+x₂+…+xₙ)/n, (y₁+y₂+…+yₙ)/n). It is the average of all x-coordinates and all y-coordinates.
  • Triangle centroid: G = ((x₁+x₂+x₃)/3, (y₁+y₂+y₃)/3). Lies at 2/3 the distance from each vertex along its median.
  • Weighted centroid: If points have weights w₁, w₂, …, the weighted centroid is G = (Σwᵢxᵢ / Σwᵢ, Σwᵢyᵢ / Σwᵢ). Used in physics for center of mass (where weights = masses) and data science (weighted averages).

The midpoint is simply the centroid of two equally-weighted points. Our Multiple Points tab computes the centroid for up to 6 points simultaneously.

  • Slope Calculator — The slope of a line segment is (y₂−y₁)/(x₂−x₁). This calculator finds slope, y-intercept, line equation, and angle of inclination. The perpendicular bisector of a segment passes through the midpoint and has slope = −1/m. Mastering slope and midpoint together covers most coordinate geometry problems.
  • Right Triangle Calculator — The distance formula is the Pythagorean theorem applied to coordinate geometry. Given a segment, the horizontal and vertical differences form a right triangle with the segment as hypotenuse. Use this tool for right-triangle side-angle solving, Pythagorean triples, and trigonometric ratios.
  • Trigonometry Calculator — The angle that a line segment makes with the x-axis = arctan(Δy/Δx). This tool computes all six trig functions, Law of Sines/Cosines for triangle solving, and inverse trig for angle-from-slope problems.
  • Circumference Calculator — The circumcenter of a triangle (equidistant from all three vertices) is found using perpendicular bisectors through midpoints. Once the circumcenter is found, the circumradius equals the distance from circumcenter to any vertex — compute it with the distance formula here, then use this tool for circle properties.
  • Significant Figures Calculator — Midpoint and distance calculations in science and engineering must be reported to the correct number of significant figures. If your coordinates are measured values (e.g., survey readings), use this tool to round the midpoint result appropriately — midpoints and averages should match the precision of the least precise input coordinate.
🧮 Math calculator