Loading Calculator...
Please wait a moment
Please wait a moment
Convert binary numbers (base-2) to hexadecimal (base-16) instantly. Essential for programming, debugging, and low-level computing.
| Binary (4-bit) | Hexadecimal | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
Hexadecimal (hex) is a base-16 number system that uses 16 symbols: 0-9 for values zero to nine, and A-F for values ten to fifteen. Hex is widely used in computing because it provides a more compact way to represent binary data - one hex digit represents exactly 4 binary bits.
The easiest method is to group binary digits into sets of 4 (starting from the right), then convert each group to its hexadecimal equivalent. If needed, pad the leftmost group with zeros to make it 4 bits.
Example: Convert 11010101 to hex
Group: 1101 0101
1101 = 13 = D in hex
0101 = 5 = 5 in hex
Result: D5
Hexadecimal provides a compact, human-readable representation of binary data. One hex digit represents exactly 4 bits, making it easy to convert between binary and hex. It's much more concise than binary and more intuitive for programmers working with memory addresses, byte values, and bit patterns.
In hexadecimal, A=10, B=11, C=12, D=13, E=14, and F=15. These letters extend the numbering system beyond the ten digits (0-9) to create a 16-symbol system. Both uppercase and lowercase letters are acceptable, though uppercase is more common.
The 0x prefix is a programming convention that indicates a hexadecimal number. For example, 0xFF represents 255 in decimal. This prefix helps distinguish hex numbers from decimal numbers in code. Some systems use other prefixes like &h or $ for hexadecimal.
One hexadecimal digit represents exactly 4 binary digits (bits). This is because 2⁴ = 16, matching the 16 possible values (0-F) in hexadecimal. This clean relationship makes conversion between binary and hex straightforward and is why hex is so popular in computing.
Yes, you can perform all arithmetic operations in hexadecimal just like in decimal. Programmers often use hex arithmetic when working with memory addresses, bit masks, and hardware registers. Many calculators and programming tools support hex arithmetic directly.