Distance Calculator
Use this Distance Calculator to calculate distance between two points in 2D, distance between two points in 3D, distance from speed and time, time from distance and speed, speed from distance and time, route distance units, and coordinate-based measurement conversions. It supports common metric, imperial, and scientific distance units.
Calculate Distance
Select a mode, enter the known values, and calculate distance, speed, time, coordinate length, midpoint, slope, and unit conversions.
What Is a Distance Calculator?
A Distance Calculator is a math and measurement tool that helps find the distance between two points, the distance traveled from speed and time, the speed needed to cover a distance, the time required to travel a distance, or the equivalent value of a distance in another unit. Distance is one of the most common quantities in mathematics, physics, geometry, travel planning, navigation, sports, engineering, construction, mapping, and everyday life.
In geometry, distance often means the length of the straight line between two coordinate points. If you know two points such as \((x_1,y_1)\) and \((x_2,y_2)\), the calculator uses the Pythagorean theorem to find the length of the line segment connecting them. In three-dimensional geometry, the same idea extends to points such as \((x_1,y_1,z_1)\) and \((x_2,y_2,z_2)\).
In motion problems, distance is usually connected to speed and time. If a car travels at 60 miles per hour for 2.5 hours, the distance is 150 miles. If a train covers 300 kilometers in 4 hours, the average speed is 75 kilometers per hour. If a runner covers 10 kilometers at 12 km/h, the time is \(10/12\) hours. These relationships appear in school math, physics, driving estimates, fitness planning, aviation, shipping, and logistics.
This calculator combines several common distance tools into one WordPress-ready section. It includes a 2D distance calculator, 3D distance calculator, speed-time-distance calculator, speed or time solver, and unit converter. It also explains the formulas so the page works as both a practical calculator and an educational guide.
How to Use the Distance Calculator
Choose the tab that matches the type of problem you want to solve. Use the 2D Points tab when you have two points on a plane, such as coordinates on a graph, map grid, drawing, or geometry diagram. Enter \(x_1\), \(y_1\), \(x_2\), and \(y_2\). The calculator returns distance, midpoint, slope, horizontal change, and vertical change.
Use the 3D Points tab when the points include depth or height. Enter \(x_1\), \(y_1\), \(z_1\), \(x_2\), \(y_2\), and \(z_2\). This is useful for vectors, 3D geometry, coordinate modeling, engineering drawings, graphics, and physical space problems.
Use the Speed × Time tab when you know speed and travel time and want the distance. Choose a speed unit such as miles per hour, kilometers per hour, meters per second, feet per second, or knots. Then enter time in seconds, minutes, hours, or days. The calculator converts values internally and returns the distance in your selected output unit.
Use the Solve Speed / Time tab when you know distance and either speed or time. If you solve for speed, enter distance and time. If you solve for time, enter distance and speed. Use the Unit Converter tab when you simply want to convert kilometers to miles, miles to kilometers, meters to feet, inches to centimeters, or another distance conversion.
Distance Calculator Formulas
The 2D coordinate distance formula comes from the Pythagorean theorem:
The 3D distance formula adds a third squared difference:
The speed, time, and distance relationship is:
Here, \(d\) is distance, \(r\) is speed or rate, and \(t\) is time. The same relationship can be rearranged to solve for speed or time:
For a line segment in 2D, the midpoint is:
The slope of the line through two points is:
For unit conversion, the calculator converts each value into meters first, then converts meters into the target unit:
2D and 3D Coordinate Distance Explained
Coordinate distance measures the straight-line length between points. In 2D, the two points lie on a flat coordinate plane. The horizontal difference is \(x_2-x_1\), and the vertical difference is \(y_2-y_1\). These two differences form the legs of a right triangle. The distance between the points is the hypotenuse, so the Pythagorean theorem gives the distance formula.
For example, the distance between \((1,2)\) and \((7,10)\) uses a horizontal change of \(6\) and a vertical change of \(8\). The distance is \(\sqrt{6^2+8^2}=\sqrt{100}=10\). This is a classic 6-8-10 right triangle.
In 3D, the same idea applies, but there is also a depth or height difference. A 3D point has \(x\), \(y\), and \(z\) coordinates. The distance formula squares the difference in each coordinate, adds the squared values, and takes the square root. This is useful in vector geometry, physical modeling, game development, robotics, architecture, and engineering.
Coordinate distance is not always the same as travel distance. If two cities are 100 miles apart in a straight line, the road distance may be longer because roads curve, avoid obstacles, follow terrain, and connect through networks. Coordinate distance is best for geometry and direct-line measurement, while route distance needs map or road-network data.
Speed, Time, and Distance
The formula \(d=rt\) is one of the most important measurement relationships. If speed is constant, distance equals speed multiplied by time. This relationship is common in travel, transportation, running, cycling, shipping, aviation, physics, and school word problems.
The formula only works directly when units match. If speed is in miles per hour, time should be in hours to produce miles. If speed is in meters per second, time should be in seconds to produce meters. This calculator handles the conversions automatically by converting speed into meters per second and time into seconds internally.
Average speed is different from instantaneous speed. If you drive 150 miles in 3 hours, your average speed is 50 mph. That does not mean the car traveled at exactly 50 mph every moment. It may have slowed down, stopped, or sped up. The calculator uses average speed for travel-style calculations.
Distance Unit Conversion
Distance can be measured in millimeters, centimeters, meters, kilometers, inches, feet, yards, miles, and nautical miles. Metric units are based on powers of ten, making them easy to scale. Imperial and US customary units use fixed conversion factors, such as 12 inches per foot and 5280 feet per mile. Nautical miles are commonly used in marine and aviation contexts.
| Unit | Symbol | Meters | Common Use |
|---|---|---|---|
| Millimeter | mm | 0.001 | Small objects, engineering, technical drawings |
| Centimeter | cm | 0.01 | Body measurements, classroom geometry, small distances |
| Meter | m | 1 | Standard SI distance unit |
| Kilometer | km | 1000 | Travel, maps, road distances in metric countries |
| Inch | in | 0.0254 | Small imperial measurements |
| Foot | ft | 0.3048 | Height, construction, aviation altitude |
| Yard | yd | 0.9144 | Sports fields, fabric, land measurement |
| Mile | mi | 1609.344 | Road distance in the United States and UK contexts |
| Nautical mile | nmi | 1852 | Marine navigation and aviation |
When converting distance units, it is safest to use a base unit. This calculator uses meters as the internal base. For example, 10 kilometers becomes 10,000 meters. To convert meters to miles, the calculator divides by 1609.344.
Straight-Line Distance vs Route Distance
A straight-line distance is the shortest direct path between two points in a flat coordinate system. In geometry, this is the line segment connecting the points. In real-world travel, a straight-line distance may be called “as-the-crow-flies” distance. It is useful for quick comparison, map scale, geometry, and spatial analysis.
A route distance is the actual distance traveled along roads, paths, railways, walking routes, flight paths, or shipping lanes. Route distance is often longer than straight-line distance because movement must follow available paths and avoid obstacles. A driving route can be much longer than a straight-line distance if roads curve around mountains, rivers, buildings, or restricted areas.
This calculator does not fetch live map routes. It calculates mathematical distance from coordinates and motion formulas. For real driving, walking, transit, or flight routes, use a map service to get route-specific distance and travel time.
Distance Calculation Examples
Example 1: Find the distance between \((1,2)\) and \((7,10)\).
Example 2: Find the distance between \((1,2,3)\) and \((6,8,12)\).
Example 3: A car travels at 60 miles per hour for 2.5 hours. The distance is:
Example 4: A train travels 300 kilometers in 4 hours. The average speed is:
Example 5: Convert 10 kilometers to miles.
Common Distance Calculation Mistakes
The first common mistake is mixing units. If speed is in kilometers per hour and time is in minutes, you cannot multiply the values directly without converting minutes to hours. The second mistake is confusing straight-line distance with route distance. A coordinate formula gives the direct line, not the actual road path.
Another mistake is forgetting the square root in the coordinate distance formula. Squaring the coordinate differences and adding them gives the squared distance. You must take the square root to get the actual distance. In 2D, some users also confuse distance with slope. Slope describes steepness; distance describes length.
For travel questions, remember that the speed-time-distance formula usually uses average speed. Real travel speed changes during stops, traffic, turns, acceleration, and delays. For planning, add buffer time if the real situation involves uncertainty.
Distance Calculator FAQs
What does a distance calculator do?
It calculates distance between coordinate points, distance from speed and time, speed from distance and time, time from distance and speed, and distance unit conversions.
What is the distance formula between two points?
The 2D distance formula is \(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\).
What is the 3D distance formula?
The 3D distance formula is \(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2+(z_2-z_1)^2}\).
How do I calculate distance from speed and time?
Use \(d=rt\), where \(d\) is distance, \(r\) is speed, and \(t\) is time.
How do I calculate speed from distance and time?
Use \(r=d/t\). Divide total distance by total time.
How do I calculate time from distance and speed?
Use \(t=d/r\). Divide distance by speed.
Is coordinate distance the same as driving distance?
No. Coordinate distance is usually straight-line distance. Driving distance follows roads and is often longer.
Important Note
This Distance Calculator is for educational, planning, geometry, physics, and general measurement use. It does not provide live map routing, GPS navigation, official surveying data, aviation route clearance, marine navigation certification, or legal land measurement. For high-stakes navigation, construction, surveying, or engineering work, verify results with approved professional tools.

