Binary to Hex Converter
Convert binary to hexadecimal instantly with an accurate base-2 to base-16 converter. Enter a binary integer to get its hex value, see the 4-bit grouping, and understand exactly how each binary group maps to a hexadecimal digit.
What Is a Binary to Hex Converter?
A binary to hex converter changes a number written in binary (base 2) into the equivalent hexadecimal (base 16) representation. Binary uses only 0 and 1. Hexadecimal uses sixteen symbols: the digits 0–9 followed by the letters A–F for values ten through fifteen.
Binary and hexadecimal have a particularly useful mathematical relationship: 16 equals 24. Therefore, every hexadecimal digit represents exactly four binary bits. This makes direct binary-to-hex conversion much simpler than converting through decimal.
For example, binary 1111 maps directly to hexadecimal
F, while 1010 maps to A.
Longer binary numbers can be divided into groups of four and converted
group by group.
Binary — Base 2
Uses two symbols, 0 and 1. Each position represents a power of two.
Hexadecimal — Base 16
Uses 0–9 and A–F. One hexadecimal digit can represent exactly four bits.
How to Use the Binary to Hex Converter
Type or paste a value such as 10101111. Only 0 and 1
are valid binary digits.
The result updates for valid input, or you can select the Convert to Hex button.
BinaryCon displays the corresponding hexadecimal value using uppercase A–F.
Review how the binary number was separated into groups and how each group produced one hexadecimal digit.
Use Copy when you need the hexadecimal value for code, debugging, documentation, study, or another conversion.
Binary to Hexadecimal 4-Bit Mapping
Four bits have 16 possible combinations, from 0000 through
1111. These combinations map exactly to the sixteen
hexadecimal digits.
| Binary | Hex | Decimal | Binary | Hex | Decimal |
|---|---|---|---|---|---|
0000 | 0 | 0 | 1000 | 8 | 8 |
0001 | 1 | 1 | 1001 | 9 | 9 |
0010 | 2 | 2 | 1010 | A | 10 |
0011 | 3 | 3 | 1011 | B | 11 |
0100 | 4 | 4 | 1100 | C | 12 |
0101 | 5 | 5 | 1101 | D | 13 |
0110 | 6 | 6 | 1110 | E | 14 |
0111 | 7 | 7 | 1111 | F | 15 |
Worked Example: Convert 10101111 Binary to Hex
The binary number 10101111₂ contains eight bits, so it divides evenly into two groups of four.
1111₂ = F₁₆ Step 3: Join the hexadecimal digits 10101111₂ = AF₁₆ Therefore, binary 10101111 equals hexadecimal AF.
What If the Binary Number Does Not Have Groups of Four?
A binary integer does not need to contain a multiple of four digits. When the leftmost group has fewer than four bits, add leading zeros until that group contains four bits.
Group from right: 10 1101
Add leading zeros: 0010 1101 Convert the groups: 0010₂ = 2₁₆
1101₂ = D₁₆ Therefore: 101101₂ = 2D₁₆ Both representations have decimal value 45.
101₂ = 5, but
1010₂ = 10.
Binary to Hex Conversion Table
These verified examples provide quick reference values for common binary integers.
| Binary | Hex | Decimal |
|---|---|---|
1 | 1 | 1 |
10 | 2 | 2 |
100 | 4 | 4 |
1000 | 8 | 8 |
1010 | A | 10 |
1111 | F | 15 |
10000 | 10 | 16 |
11111 | 1F | 31 |
100000 | 20 | 32 |
111111 | 3F | 63 |
1000000 | 40 | 64 |
1111111 | 7F | 127 |
10000000 | 80 | 128 |
11111111 | FF | 255 |
100000000 | 100 | 256 |
111111111111 | FFF | 4095 |
1000000000000 | 1000 | 4096 |
1111111111111111 | FFFF | 65,535 |
Why Is Hexadecimal Used With Binary?
Binary accurately represents individual bits, but long strings of 0s and 1s can be difficult for people to scan and compare. Hexadecimal provides a much shorter notation while retaining a direct relationship with the underlying bits.
An 8-bit binary value requires eight binary characters but only two hexadecimal digits. A 16-bit value requires four hex digits, and a 32-bit value requires eight. This compact representation is one reason hexadecimal appears frequently in programming and computer systems.
| Bit Width | Binary Digits | Hex Digits | Unsigned Maximum |
|---|---|---|---|
| 4-bit | 4 | 1 | F = 15 |
| 8-bit | 8 | 2 | FF = 255 |
| 16-bit | 16 | 4 | FFFF = 65,535 |
| 32-bit | 32 | 8 | FFFFFFFF = 4,294,967,295 |
Where Binary to Hex Conversion Is Useful
Programming
Hexadecimal is commonly used to express bit patterns, constants, masks, memory-related values, and other low-level numeric data.
Web colors
RGB colors are commonly written in hexadecimal notation such as
#FF0000, where each pair represents an 8-bit channel value.
Digital electronics
Register contents and bit patterns are often easier to read in hexadecimal because every hex digit corresponds to four bits.
Debugging
Hex dumps, machine-level data, protocol fields, byte values, and encoded data frequently use hexadecimal for compact presentation.
Uppercase vs Lowercase Hexadecimal
Hexadecimal digits A through F may be written in uppercase or lowercase.
For numeric purposes, AF and af represent the
same hexadecimal value. BinaryCon displays uppercase letters for consistency
and readability.
The letter digits have these values: A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. They are digits within base 16 rather than separate mathematical variables.
What Does the 0x Prefix Mean?
Programming languages and technical documentation often identify a
hexadecimal literal with a 0x prefix. For example,
0xFF identifies FF as a hexadecimal value and represents
decimal 255.
The hexadecimal result displayed by this converter does not require the
prefix, so it returns FF. You can add 0x when
the syntax of your programming language, configuration, or documentation
calls for it.
Common Binary to Hex Conversion Mistakes
For binary integers, start forming groups of four at the rightmost bit and work toward the left.
Three-bit grouping is for binary-to-octal conversion. Hexadecimal requires groups of exactly four binary bits.
When an integer needs padding, add zeros to the left. A zero added on the right changes the number by shifting its place values.
Values 10 through 15 are represented by A through F, not multi-digit decimal strings inside a hexadecimal digit.
Related BinaryCon Tools
Continue working with binary, hexadecimal, decimal, and other number representations using these closely related converters.
Binary to Hex Converter FAQs
How do I convert binary to hexadecimal?
Starting at the rightmost bit, divide the binary integer into groups of four. If the leftmost group is incomplete, pad it with leading zeros. Convert each group using the 0000–1111 hexadecimal mapping and join the resulting digits in the same order.
What is binary 1010 in hexadecimal?
1010₂ equals hexadecimal A. The four-bit
pattern 1010 has decimal value 10, and hexadecimal represents decimal
values 10 through 15 with the letters A through F.
What is 1111 binary in hex?
1111₂ equals F₁₆. The binary place values
are 8 + 4 + 2 + 1 = 15, and hexadecimal digit F represents decimal 15.
What is 11111111 binary in hexadecimal?
Group the bits as 1111 1111. Each group maps to F, producing
FF. Therefore 11111111₂ = FF₁₆, and both
represent decimal 255.
Why do we group binary digits in fours for hexadecimal?
Four bits have 16 possible patterns because 24 = 16. Hexadecimal also has sixteen possible digits. This gives every 4-bit binary pattern a direct hexadecimal equivalent.
Do I need to convert binary to decimal before hex?
No. Direct 4-bit grouping is usually faster and less error-prone. Converting through decimal is mathematically valid, but it adds an unnecessary intermediate step when converting binary integers to hex.
What binary value equals hexadecimal FF?
Each hexadecimal F maps to binary 1111, so FF becomes
1111 1111, or 11111111₂. Its unsigned decimal
value is 255.
Does a leading zero change binary-to-hex conversion?
Leading zeros do not change an unsigned integer’s numeric value.
For example, 1010 and 00001010 both convert
to hexadecimal A. Leading zeros can still be useful when showing a
fixed-width value.
Can hexadecimal contain letters?
Yes. Hexadecimal requires sixteen digits but the familiar decimal digits provide only ten symbols. Therefore A, B, C, D, E, and F represent values 10, 11, 12, 13, 14, and 15.
Is binary-to-hexadecimal conversion exact?
Yes for integer values. Every group of four binary bits corresponds exactly to one hexadecimal digit, so the conversion requires no approximation or rounding.
Can this converter handle very long binary numbers?
Yes. The converter processes the input as groups of binary characters instead of first forcing the entire value into a normal JavaScript floating-point number. This preserves the exact hexadecimal representation of long binary integers.
Does this converter support binary fractions?
This calculator is intended for binary integers. Binary fractions require grouping digits on both sides of the binary point and handling fractional positions separately, so a binary point is not accepted by this tool.
Fast Binary to Hex Conversion
Use BinaryCon for quick binary and hexadecimal conversions, clear bit grouping, verified reference values, worked examples, and free number-system tools without creating an account.