Use the Geometry Calculator to calculate slope, distance, midpoint, triangle area, circle measurements, polygon area, or solid volume and surface area. Select a mode, enter the values it requests, and click Calculate.
What this calculator covers
- Slope: the slope, angle, and equation of a line through two points.
- Distance: the straight-line distance between two points in 2D or 3D.
- Midpoint: the point exactly halfway between two points.
- Triangle area: from a base and height, three side lengths, or three vertex coordinates.
- Circle: calculate radius, diameter, circumference, and area from one known measurement.
- Polygon area: use a regular polygon's side count and side length, or irregular vertex coordinates.
- Solid volume / surface area: cube, rectangular prism, sphere, cylinder, cone, and square pyramid.
Choose the inputs for your calculation
Use the mode radios at the top of the calculator, then complete the controls that appear for that mode.
- Slope: enter two points in the x1, y1, x2, and y2 fields.
- Distance: enter two 2D points. Select Use 3D coordinates (x, y, z) to show and complete z1 and z2.
- Midpoint: enter two points in the displayed coordinate fields.
- Triangle area: choose Base & height, Three side lengths, or Three vertex coordinates, then enter the displayed values.
- Circle: choose Radius, Diameter, Circumference, or Area, and enter that known measurement.
- Polygon area: choose Regular polygon or Irregular (vertex coordinates). For a regular polygon, enter Number of sides (3-30) and Side length. For an irregular polygon, enter one
x,ypair per line, with at least three vertices, in boundary order. - Solid volume / surface area: choose a value in the Solid selector, then enter the dimensions that appear.
Units and result conversion
- Distance: choose Unit of coordinates. Optionally choose Convert result to (optional).
- Circle: choose Unit. Optionally choose Convert result to (optional).
- Triangle area, Polygon area, and Solid volume / surface area: choose the available Unit for the inputs. These modes do not provide result conversion.
- Slope and Midpoint: these modes have no unit controls.
Distance and circle results are converted only when you select a different target unit. Otherwise, the result uses the input unit.
Validation and limitations
The calculator applies positive-value checks to relevant measurements and dimensions, but validation differs by mode:
- Triangle inequality: for the three-sides mode, the sum of any two sides must exceed the third, or the input is rejected.
- Triangle vertices: three collinear vertices are rejected because they enclose no area.
- Slope: identical points are rejected because the slope is undefined. Distance and Midpoint do not reject identical points.
- Regular polygons: the side count must be from 3 to 30.
- Irregular polygons: enter vertices in boundary order. The tool does not check for self-intersection.
Formulas Used
The result includes the formula in the Formula used area. The substituted values and calculation are shown separately in Steps.
- Slope:
m = (y2 - y1) / (x2 - x1) - Distance:
d = sqrt((x2-x1)² + (y2-y1)² [+ (z2-z1)²]) - Midpoint:
M = ((x1+x2)/2, (y1+y2)/2) - Triangle (base/height):
Area = 1/2 × base × height - Triangle (Heron's):
Area = sqrt(s(s-a)(s-b)(s-c)), wheresis the semi-perimeter - Triangle/polygon (shoelace):
Area = 1/2 |Σ(x_i·y_{i+1} - x_{i+1}·y_i)| - Circle:
C = 2πr,Area = πr² - Regular polygon:
Area = 1/2 × perimeter × apothem - Cube:
V = s³,SA = 6s² - Rectangular prism:
V = lwh,SA = 2(lw + lh + wh) - Sphere:
V = 4/3 πr³,SA = 4πr² - Cylinder:
V = πr²h,SA = 2πr(r+h) - Cone:
V = 1/3 πr²h,SA = πr(r + slant) - Square pyramid:
V = 1/3 s²h,SA = s² + 2·s·slant
Calculate, review, and export the result
- Click Calculate after entering the required values.
- Review the calculated values, the Formula used area, the separate Steps area, and the labeled diagram.
- Use Copy result to copy the text result, or use Download result (.txt) to download
geometry-result.txt. - Click Reset to clear the inputs and hide the result.
Numeric results are formatted to four decimal places, with trailing zeroes removed.
This is a formula-based calculator. It does not perform CAD drafting, survey-grade measurement verification, or structural design/load calculations. Use dedicated professional software or a licensed surveyor or engineer for those tasks.
Frequently Asked Questions
What geometry calculations does this tool cover?
Seven modes: slope between two points, distance between two points (2D or 3D), midpoint between two points, triangle area (base/height, three sides, or three vertices), circle measurements (radius, diameter, circumference, area), polygon area (regular polygons or irregular polygons from vertex coordinates), and volume/surface area for common solids (cube, rectangular prism, sphere, cylinder, cone, square pyramid).
How do units work, and when does the tool convert them?
Distance and Circle provide a Convert result to (optional) control. Triangle, Polygon, and Solid provide an input Unit selector without result conversion. Slope and Midpoint have no unit controls. Where conversion is available, the result changes units only when you select a different target; otherwise it uses the input unit.
Does the calculator check whether my inputs make a valid shape?
Some modes check geometric constraints. For example, three side lengths that violate the triangle inequality are rejected, three collinear triangle vertices are rejected, and a regular polygon needs between 3 and 30 sides. Slope rejects identical points; Distance and Midpoint do not reject identical points. Irregular polygon self-intersection is not checked.
Does this tool replace CAD software, land surveying, or structural engineering calculations?
No. This is a formula-based reference and learning calculator. It does not perform CAD drafting, survey-grade measurement verification, or structural design/load calculations - for those, use dedicated professional software or consult a licensed surveyor or engineer.