Quick Answer
Decimal 42 converts to 2A in hexadecimal, 101010 in binary, and 52 in octal.
Digits 0-9 and letters A-F
Digits 0 and 1 only
Digits 0-7 only
Common Examples
| Input | Result |
|---|---|
| Decimal 255 | Hex FF, Binary 11111111, Octal 377 |
| Hex 1A | Decimal 26, Binary 11010, Octal 32 |
| Binary 1100100 | Decimal 100, Hex 64, Octal 144 |
| Decimal 0 | Hex 0, Binary 0, Octal 0 |
| Octal 777 | Decimal 511, Hex 1FF, Binary 111111111 |
How It Works
The Formula
Every number system uses positional notation. A number in base B with digits d(n), d(n-1), …, d(1), d(0) has the decimal value:
value = d(n) x B^n + d(n-1) x B^(n-1) + … + d(1) x B^1 + d(0) x B^0
To convert from any base to decimal, multiply each digit by its positional power and sum the results. To convert from decimal to another base, repeatedly divide by the target base and collect the remainders.
Decimal (Base 10): The standard number system using digits 0 through 9. Each position represents a power of 10.
Hexadecimal (Base 16): Commonly used in computing for memory addresses and color codes. Uses digits 0-9 and letters A-F (where A = 10, B = 11, C = 12, D = 13, E = 14, F = 15).
Binary (Base 2): The fundamental number system of computers. Each digit (called a bit) is either 0 or 1. Eight binary digits form one byte.
Octal (Base 8): Uses digits 0 through 7. Historically popular in computing because each octal digit maps to exactly three binary digits, making it a compact way to represent binary data.
Worked Example
To convert decimal 200 to hexadecimal: divide 200 by 16 to get 12 remainder 8. Then divide 12 by 16 to get 0 remainder 12 (which is C in hex). Reading the remainders from bottom to top gives C8. Verification: C (12) x 16 + 8 x 1 = 192 + 8 = 200.
To convert decimal 200 to binary: 200 / 2 = 100 r 0, 100 / 2 = 50 r 0, 50 / 2 = 25 r 0, 25 / 2 = 12 r 1, 12 / 2 = 6 r 0, 6 / 2 = 3 r 0, 3 / 2 = 1 r 1, 1 / 2 = 0 r 1. Reading remainders from bottom to top: 11001000.
To convert hex C8 to octal: first convert to decimal (200), then to octal. 200 / 8 = 25 r 0, 25 / 8 = 3 r 1, 3 / 8 = 0 r 3. Result: 310.
CalculateY