Convert between binary and hexadecimal number systems with instant results and explanations.
2026-03-28T00:00:00Z
Binary to hexadecimal (hex) conversion translates numbers between base-2 (binary) and base-16 (hexadecimal) systems. Hexadecimal is particularly useful because each hex digit represents exactly 4 binary digits (bits), making it a compact and human-readable way to represent binary data.
The relationship is elegant: binary groups of 4 bits map directly to single hex digits. For example, 1111₂ = F₁₆, 1010₂ = A₁₆, 0101₂ = 5₁₆. This direct mapping makes conversion straightforward—you can convert by grouping binary digits into sets of four and replacing each group with its corresponding hex digit.
Hexadecimal is ubiquitous in computing: memory addresses (0x7FFF), color codes (#FF5733), MAC addresses, assembly language, debugging, file formats, and cryptographic hashes all use hex. Understanding binary-hex conversion is essential for low-level programming, systems programming, networking, and anywhere you need to work with raw binary data in a readable format.
Convert 10110111₂ to Hexadecimal:
Hexadecimal is much more compact—one hex digit replaces four binary digits. It's easier for humans to read, write, and remember. For example, FF is simpler than 11111111 while conveying the same information.
Because 16 (hex base) = 2⁴ (binary). Four binary bits can represent 16 different values (0000-1111), which perfectly matches the 16 hex digits (0-F).
Use prefixes: 0x or # for hex (0xFF, #FF5733), or subscripts (FF₁₆). Context matters too—color codes are always hex, while regular numbers without markers are assumed decimal.
Add leading zeros to the left until you have a multiple of 4 bits. For example, 101 becomes 0101, which converts to 5 in hex.
Hex is perfect for representing byte values (00-FF), memory addresses, bit flags, color codes, and debugging. It's the sweet spot between binary (too verbose) and decimal (doesn't align with bit boundaries).
Yes! Memorize the 16 conversions (0-F to 0000-1111). Then replace each hex digit with its 4-bit equivalent. With practice, it becomes second nature.
0xFF (255 in decimal, 11111111 in binary) is the maximum value for a byte (8 bits). It's used constantly in programming: maximum color values, byte masks, and default values.
MAC addresses in networking, SHA hashes in cryptography, HTML/CSS color codes (#RGB), memory dumps, file headers (magic numbers), Unicode code points (U+0041), and hardware specifications.
Related Tools
Generate .dockerignore files.
Convert between number systems.
Convert binary to octal.
Convert decimal to hexadecimal.
Convert decimal to octal.
Convert HEX to RGB.