Binary, Decimal and Hexadecimal Guide
Quick Answer
| Decimal | Binary | Hexadecimal |
|---|---|---|
| 255 | 11111111 | FF |
| 16 | 00010000 | 10 |
| 10 | 00001010 | 0A |
- Binary to decimal: multiply each bit by 2^(its position), add results
- Decimal to binary: divide by 2 repeatedly, collect remainders bottom up
- Decimal to hex: divide by 16 repeatedly, use 0-9 then A-F for 10-15
Use the free Binary Converter and Hex Converter on CalConvs for instant conversions.
Binary to Decimal Conversion
Each binary digit (bit) represents a power of 2. Position values (right to left): 1, 2, 4, 8, 16, 32, 64, 128...
Example: Convert binary 10110101 to decimal
| Bit | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|
| Position | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
| Value | 128 | 0 | 32 | 16 | 0 | 4 | 0 | 1 |
Sum = 128 + 32 + 16 + 4 + 1 = 181
Decimal to Binary Conversion
Divide by 2 repeatedly. Write the remainders from bottom to top.
Example: Convert decimal 45 to binary
45÷2=22 r1, 22÷2=11 r0, 11÷2=5 r1, 5÷2=2 r1, 2÷2=1 r0, 1÷2=0 r1
Read remainders bottom to top: 101101. Verify: 32+8+4+1 = 45 ✓
Hexadecimal Explained
Hexadecimal uses 16 digits: 0 through 9, then A(10), B(11), C(12), D(13), E(14) and F(15). Each hex digit represents exactly 4 binary bits, making hex much more compact than binary.
| Hex | Binary | Decimal |
|---|---|---|
| 0 | 0000 | 0 |
| 9 | 1001 | 9 |
| A | 1010 | 10 |
| F | 1111 | 15 |
| FF | 11111111 | 255 |
| 1A | 00011010 | 26 |
Where These Number Systems Are Used
- Binary (base 2): All digital electronics and computers work in binary internally. Logic gates, memory addresses, network packets and CPU instructions.
- Decimal (base 10): Everyday human use. Currency, measurements, general maths.
- Hexadecimal (base 16): Colour codes in web design (#FF5733), memory addresses, MAC addresses, assembly language programming, error codes.
- Octal (base 8): Used in Unix file permissions (chmod 755). Each octal digit represents 3 binary bits.
Frequently Asked Questions
What is 255 in binary?
The decimal number 255 in binary is 11111111 (eight 1s). This is the maximum value of an 8-bit unsigned integer and corresponds to hexadecimal FF. It appears in networking as the broadcast address in an IPv4 subnet mask (255.255.255.0).
What is hexadecimal used for in web design?
Web colours are expressed as hex codes such as #FF0000 (red), #00FF00 (green) and #0000FF (blue). Each pair of hex digits represents one colour channel (red, green, blue) from 00 (0 intensity) to FF (full intensity).
How do I convert hex to decimal quickly?
Each hex digit is multiplied by 16 to the power of its position (right to left, starting from 0). For example, hex 2B: B=11 at position 0 = 11. Then 2 at position 1 = 2×16 = 32. Total = 32+11 = 43. Use the Hex Converter on CalConvs for any hex to decimal conversion instantly.
Related Tools
- Binary Converter: binary to decimal, hex and octal
- Hex Converter: hexadecimal to decimal, binary and octal
- All Math Tools: 46 tools on CalConvs
