How place value works in any base
In a base number system, each digit is worth times the digit to its right. A number with digits has the value:
Each digit is between 0 and . Bases above 10 use letters for the extra digits: A = 10, B = 11, and so on up to Z = 35, which is why 36 is the highest base this converter offers.
Converting out of decimal
To write a number in base , divide it by and keep the remainder. Divide the quotient again and repeat until the quotient is 0. The remainders, read from last to first, are the digits.
Worked example: 255 to hexadecimal and back
Divide 255 by 16:
| Division | Quotient | Remainder | Hex digit |
|---|---|---|---|
| 255 ÷ 16 | 15 | 15 | F |
| 15 ÷ 16 | 0 | 15 | F |
Reading the remainders from bottom to top gives FF. To check, expand FF by place value:
In binary, each hex digit becomes four bits: F = 1111, so FF = 1111 1111, which is 8 bits or one byte.
Common number bases
| Base | Name | Digits | Where you see it |
|---|---|---|---|
| 2 | Binary | 0, 1 | Hardware, bit flags, network masks |
| 8 | Octal | 0 to 7 | Unix file permissions such as 755 and 644 |
| 10 | Decimal | 0 to 9 | Everyday counting and money |
| 16 | Hexadecimal | 0 to 9, A to F | Memory addresses, colour codes such as #4F46E5, byte dumps |
| 32, 36 | Base 32, base 36 | 0 to 9, A to Z | Short IDs and URL shorteners |