Loading Calculator...
Please wait a moment
Please wait a moment
Convert binary numbers (base-2) to hexadecimal (base-16) instantly. Essential for programming, debugging, color codes, and low-level computing tasks.
This table shows all 16 possible 4-bit binary nibbles and their hexadecimal equivalents. Memorizing this table makes manual binary-to-hex conversion fast and effortless.
| Binary (4-bit) | Hexadecimal | Decimal | Context |
|---|---|---|---|
| 0000 | 0 | 0 | Same in decimal and hex |
| 0001 | 1 | 1 | Same in decimal and hex |
| 0010 | 2 | 2 | Same in decimal and hex |
| 0011 | 3 | 3 | Same in decimal and hex |
| 0100 | 4 | 4 | Same in decimal and hex |
| 0101 | 5 | 5 | Same in decimal and hex |
| 0110 | 6 | 6 | Same in decimal and hex |
| 0111 | 7 | 7 | Same in decimal and hex |
| 1000 | 8 | 8 | Same in decimal and hex |
| 1001 | 9 | 9 | Same in decimal and hex |
| 1010 | A | 10 | Letter A = 10 |
| 1011 | B | 11 | Letter B = 11 |
| 1100 | C | 12 | Letter C = 12 |
| 1101 | D | 13 | Letter D = 13 |
| 1110 | E | 14 | Letter E = 14 |
| 1111 | F | 15 | Letter F = 15 |
Hexadecimal (often shortened to “hex”) is a base-16 number system that uses 16 unique symbols: the digits 0 through 9 for values zero to nine, and the letters A through F for values ten to fifteen. It was adopted in computing because it maps perfectly to binary — each hexadecimal digit corresponds to exactly four binary bits (one nibble).
This mapping exists because 24 = 16, meaning a group of four binary digits can express 16 distinct values, which is the same number of symbols that hexadecimal uses. A single byte (8 bits) is therefore always represented by exactly two hex digits, ranging from 00 to FF. This compact notation makes hexadecimal indispensable in fields like systems programming, network engineering, digital electronics, and web design.
Historically, hexadecimal notation gained popularity in the 1960s as computers standardized on 8-bit bytes. Earlier systems sometimes used octal (base-8), but hex proved more convenient for byte-oriented architectures. Today, programmers encounter hex daily in memory addresses, color codes (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), Unicode code points (U+1F600), and file format signatures (magic numbers).
The simplest and most widely used method is to group the binary digits into sets of four (called nibbles), starting from the rightmost digit, then convert each group independently to its single-digit hex equivalent. If the leftmost group has fewer than four bits, pad it with leading zeros.
Formula:
Binary → Group into nibbles (4 bits) → Convert each nibble to hex digit → Combine
Result: 11010101 (binary) = 0xD5 (hexadecimal)
Result: 101111101011 (binary) = 0xBEB (hexadecimal)
Result: 10000 (binary) = 0x10 (hexadecimal) = 16 in decimal
Once you memorize the 16-row nibble table above, you can convert any binary number to hex almost instantly. Simply scan right to left in groups of four, mentally look up each nibble, and concatenate. With practice, programmers convert values like 11111111 to FF or 10101010 to AA in seconds.
These examples show how larger binary values map to recognizable hexadecimal patterns used in programming and computer science.
| Binary | Hexadecimal | Description |
|---|---|---|
| 10101010 | 0xAA | Alternating bit pattern |
| 11111111 | 0xFF | Maximum byte value (255) |
| 00000000 | 0x00 | Zero / null byte |
| 11010101 | 0xD5 | Common test pattern |
| 0001000000000000 | 0x1000 | 4096 in decimal |
| 1111111100000000 | 0xFF00 | High byte set, low byte clear |
| 1100101011111110 | 0xCAFE | Hex "CAFE" pattern |
| 1011111011101111 | 0xBEEF | Hex "BEEF" pattern |
| 1101111011101101 | 0xDEED | Hex "DEED" pattern |
| 11111010110011101110 | 0xFACE | Hex "FACE" — 20 bits |
| Power | Decimal | Binary | Hexadecimal |
|---|---|---|---|
| 2^0 | 1 | 1 | 0x1 |
| 2^1 | 2 | 10 | 0x2 |
| 2^2 | 4 | 100 | 0x4 |
| 2^3 | 8 | 1000 | 0x8 |
| 2^4 | 16 | 10000 | 0x10 |
| 2^8 | 256 | 100000000 | 0x100 |
| 2^12 | 4,096 | 1000000000000 | 0x1000 |
| 2^16 | 65,536 | 10000000000000000 | 0x10000 |
Memory addresses, register contents, and hex dumps are displayed in hexadecimal. Understanding binary-to-hex conversion lets you quickly interpret raw memory values during debugging sessions.
CSS hex color codes (#RRGGBB) are three bytes expressed as six hex digits. Knowing how binary maps to hex helps designers understand color channel values and manipulate them precisely.
Hash functions (SHA-256, MD5), encryption keys, and digital certificates are routinely displayed in hexadecimal. Converting between binary and hex is essential for anyone working in cybersecurity.
MAC addresses, IPv6 addresses, and packet headers use hexadecimal notation. Network engineers constantly convert between binary bit fields and their hex representations when analyzing traffic.
Start forming 4-bit groups from the rightmost (least significant) bit and work left. Grouping from the left without padding leads to incorrect results.
If the leftmost group has fewer than 4 bits, pad it with zeros. For example, binary 10101 becomes 0001 0101 (not 1010 1), yielding 0x15.
A common mistake is confusing which letter corresponds to which value. Remember: A=10, B=11, C=12, D=13, E=14, F=15. Use the nibble table until it becomes second nature.
The hex value 10 is not the same as decimal 10. Hex 10 equals decimal 16. Always use the 0x prefix or explicitly state the base to avoid ambiguity.
After converting, take your hex result and convert it back to binary to confirm correctness. Each hex digit should expand back into the original 4-bit group.
In signed binary representations (two's complement), the leading bit indicates the sign. Be mindful of whether you are working with signed or unsigned binary before converting to hex.
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 is much more concise than binary and more intuitive for programmers working with memory addresses, byte values, and bit patterns.
In hexadecimal, A represents 10, B represents 11, C represents 12, D represents 13, E represents 14, and F represents 15. These letters extend the numbering system beyond the ten digits (0-9) to create a base-16 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 languages use other prefixes like &h, $, or # for hexadecimal values.
One hexadecimal digit represents exactly 4 binary digits (bits). This is because 2 to the power of 4 equals 16, matching the 16 possible values (0 through 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.
The largest 8-bit binary number is 11111111, which equals FF in hexadecimal (255 in decimal). Each nibble (4 bits) of 1111 converts to F. This is why a single byte (8 bits) is always represented by exactly two hex digits, ranging from 00 to FF.
Hex color codes like #FF5733 represent three pairs of hexadecimal digits for red, green, and blue channels. Each pair is an 8-bit binary value from 00000000 to 11111111 (0 to 255). For example, FF converts to binary 11111111, meaning full intensity for that color channel.
Binary is base-2 (digits 0-1), octal is base-8 (digits 0-7), decimal is base-10 (digits 0-9), and hexadecimal is base-16 (digits 0-9 and A-F). Each system represents the same numerical values using different groupings. Binary is the native language of computers, while hex provides a compact way to express binary data.
This calculator is provided for educational and informational purposes only. Always verify critical conversions independently.