Convert numbers to and from base 60
The Sexagesimal Converter translates decimal integers into base-60 notation and back. Base 60 is the system the Babylonians used for astronomy and accounting, and it is the reason an hour has 60 minutes and a circle has 360 degrees. Each base-60 digit is written as an ordinary number from 0 to 59, with positions separated by commas.
How it works
Converting a decimal integer to sexagesimal is repeated division by 60:
while v > 0:
digit = v mod 60 (a value 0..59)
v = floor(v / 60)
The digits are collected from least significant to most significant, then reversed. To convert back, evaluate the digits left to right with total = total × 60 + digit, after checking that every digit is a valid 0–59 value. A group of 60 or more is rejected, because it would not be a single legal position.
Why base 60 survived into modern life
Most ancient numeral systems fell out of use millennia ago, but sexagesimal lived on through a specific pathway: Babylonian astronomy. The Babylonians divided the sky into 360 degrees (6 × 60), each degree into 60 arcminutes, and each arcminute into 60 arcseconds. When Greek astronomers adopted Babylonian astronomical methods, they kept the base-60 degree subdivisions. From Greek astronomy those divisions passed into Arabic scholarship, then into European science, and eventually into modern global standards.
The same logic applied to time: 24 hours of 60 minutes of 60 seconds, with the minute and second inherited directly from the Babylonian astronomical tradition. So every time you read 3:47:22 on a clock, you are reading a number in mixed-radix sexagesimal notation — three positional values where the first is base-24 and the last two are base-60.
The clever properties of 60 as a base
Sixty was not an arbitrary choice. Sixty is the smallest number divisible by 1, 2, 3, 4, 5, and 6, and also by 10, 12, 15, 20, and 30. This means that in base 60, many common fractions come out as exact values with no fractional remainder:
- One third of 60 = 20 (exact)
- One quarter = 15 (exact)
- One fifth = 12 (exact)
- One sixth = 10 (exact)
In base 10, one third is the repeating decimal 0.333… In sexagesimal it is 0;20 (20 sixty-seconds), a terminating fraction. For a pre-calculator civilisation doing astronomical and commercial arithmetic, fewer repeating fractions meant simpler computation.
Worked examples
| Decimal | Sexagesimal | Meaning |
|---|---|---|
| 60 | 1,0 | One unit of 60 |
| 3600 | 1,0,0 | One unit of 3600 (one degree in arcseconds) |
| 3661 | 1,1,1 | 1 hour 1 minute 1 second in whole seconds |
| 7322 | 2,2,2 | 2 hours 2 minutes 2 seconds |
| 86400 | 24,0,0 | Seconds in a day |
Notes
This converter works with whole numbers; the fractional sexagesimal used for arcseconds and clock fractions extends the same idea with a radix point. Negative inputs are supported and simply carry a leading minus sign.