Number Base Converter
Convert numbers between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Used in programming, electronics and computer science.
How to use this converter
Type a number, pick the base it is in, then pick the base you want. The result updates as you type.
Formula
Decimal 255 = binary 11111111 = octal 377 = hexadecimal FF. Each hex digit is worth 4 bits: F = 1111.
Computers store everything in binary (0s and 1s). Hexadecimal is a compact way to write binary — one hex digit equals four binary digits.
Common number base conversions
| From | Equals |
|---|---|
| 10 (decimal) | 1010 (binary) |
| 255 (decimal) | FF (hex) |
| 255 (decimal) | 11111111 (binary) |
| 1010 (binary) | 10 (decimal) |
| FF (hex) | 255 (decimal) |
| 64 (decimal) | 100 (octal) |
| 16 (decimal) | 10 (hex) |
| 8 (decimal) | 1000 (binary) |
| A (hex) | 10 (decimal) |
| 1111 (binary) | F (hex) |
Frequently asked questions
How do I convert decimal to binary?
Divide by 2 repeatedly and read the remainders backwards. For example, 10 ÷ 2 = 5 r0, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1 → 1010.
What is hexadecimal?
Hexadecimal is base 16, using digits 0–9 and letters A–F (A=10, B=11, C=12, D=13, E=14, F=15). It is used for colors (#FF0000 is red) and memory addresses.
How do I convert binary to decimal?
Add the place values of the 1s: 1010 = 8 + 0 + 2 + 0 = 10.
What is the biggest number in one byte?
255 in decimal, FF in hex, 11111111 in binary.