How number bases work
In a positional system each digit is worth the digit times a power of the base, counted from 0 on the right. Decimal uses base 10; the binary system uses base 2 with only 0 and 1. Bases above 10 borrow letters: in hexadecimal A = 10 up to F = 15, and in base 36 the letters run to Z = 35.
- dₖ
- The digit in position k, from 0 on the right
- b
- The base, 2 to 36
To write a number in another base, the calculator divides it by the new base again and again; the remainders, read from last to first, are the digits. All arithmetic uses exact integers, so long binary and hexadecimal numbers stay exact.
Worked example
| 1 × 2^3 | 8 |
|---|---|
| 0 × 2^2 | 0 |
| 1 × 2^1 | 2 |
| 1 × 2^0 | 1 |
| Decimal | 11 |
Going the other way, 255 is 11111111 in binary, 377 in octal and FF in hexadecimal. Hexadecimal 2F is 2 × 16 + 15 = 47.
How to read your results
- Grouping: long binary and hexadecimal results are shown in groups of four digits for readability; the spaces are not part of the number.
- Hexadecimal and binary: one hex digit is exactly four binary digits, which is why colors (#FF8800) and memory addresses use hex.
- Place values show how the input adds up to its decimal value.
For Roman numerals, see the Roman numeral converter.
Assumptions
- Whole numbers, positive or negative, with up to 64 digits.
- Letters can be upper or lower case; spaces and underscores are ignored.
- The prefixes 0b, 0o and 0x are accepted for bases 2, 8 and 16.
Limitations
- Fractions such as 0.1 in binary are not converted.
- Negative numbers are shown with a minus sign, not as two's complement, which depends on a fixed number of bits.
- Bases above 36 would need more symbols than digits and letters provide.
Frequently asked questions
How do I convert decimal to binary?
Divide by 2 repeatedly and write the remainders from last to first. 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1, so 11 is 1011.
What is 255 in binary and hex?
255 is 11111111 in binary and FF in hexadecimal: the largest value of one byte.
Why do computers use binary and hexadecimal?
Digital circuits store two states, which map to 0 and 1. Hexadecimal is a compact way to write binary, because each hex digit stands for exactly four bits.
Sources
Definitions and rules referenced on this page. Calcendium is not affiliated with these publishers.
- Binary number system
Encyclopaedia Britannica · International · Checked October 29, 2026
A positional numeral system with base 2 and the digits 0 and 1; each position is worth a power of the base.