Two systems, one exact bridge
Metric length units scale by powers of ten from the meter (a millimeter is a thousandth, a kilometer is a thousand of them), so converting within the metric system is just moving a decimal point. Imperial units evolved separately, from body parts and land-measurement customs (a foot, a pace, the distance a team of oxen could plow before resting), which is why 12 inches make a foot but 3 feet make a yard and 1,760 yards make a mile. There was no consistent base, because none was designed in.
Until 1959, the exact size of an inch even differed slightly between the US and UK, since each country had calibrated its own physical standard bar over time and the two had drifted apart by a few parts per million. The 1959 International Yard and Pound Agreement, signed by the US, UK, Canada, Australia, New Zealand, and South Africa, ended that by redefining the yard as exactly 0.9144 meters. That legal fix, not a new measurement, is where every imperial-to-metric length conversion used today ultimately comes from.
The exact factors this converter uses
Millimeters, centimeters, meters, and kilometers convert to each other by exact powers of ten (1 m = 1,000 mm = 100 cm = 0.001 km), since that is how the SI system is built. The imperial-to-metric bridge is exact by legal definition rather than by measurement: 1 in = 2.54 cm, 1 ft = 0.3048 m, 1 yd = 0.9144 m, and 1 mi = 1,609.344 m (NIST Handbook 44, Appendix C, marks each of these "exact"). Within the imperial system itself, 1 ft = 12 in, 1 yd = 3 ft, and 1 mi = 5,280 ft are also exact, unchanged since well before 1959.
Because none of those factors is a round number in the other system, converted results almost never land on a clean decimal (1 cm is 0.393701 in, not 0.4). This tool shows results to 6 significant figures so the display is precise without turning into a wall of digits; the underlying arithmetic carries full floating-point precision regardless of what is shown.
Worked example: a height measurement
A form asks for height in centimeters, and the only figure on hand is 5 feet 9 inches. Converting: 5 ft 9 in is 69 inches total (5 × 12 + 9), and 69 × 2.54 = 175.26 cm. Going the other way, a doctor's chart reading of 175 cm converts to 175 ÷ 2.54 = 68.9 inches, or 5 feet 8.9 inches, which most height charts round to 5'9" since a tenth of an inch is smaller than typical measurement error anyway.
Worked example: a race distance
A 10K race is defined as exactly 10 kilometers. In miles: 10 × 1,000 ÷ 1,609.344 = 6.2137 miles, which is why 10K races are sometimes advertised as "6.2 miles" in the US. A full marathon, defined as 42.195 km, works out to 26.2188 miles. The "26.2" bumper-sticker number is that value rounded to one decimal place, not a separately defined distance. Runners turning a finish time into total seconds for pace math can do that step with the time converter.