Binary to Hex Converter
Binary to Hex Converter. Paste your value into Binary Input and the Binary to Hex Converter instantly fills in Hex Output. The hex to rgb converter breaks a hex color code down into its red, green, and blue components with a single click.
Use this binary to hex converter to turn any string of 0s and 1s into its hexadecimal form in one click: type your bits, hit the Convert button, and get a clean hex value back. Because every group of four binary digits maps to exactly one hex symbol, a long binary string shrinks to a quarter of its length, and the sections below show you how to get the same answer by hand.
Binary to Hex Converter: Type Bits, Read Hexadecimal
This free online tool is built for quick checks. Paste a binary number such as 1011011101010011, press the Convert button, and the answer B753 appears live beside it. The converter reads your digits from the right, works through them four at a time, and prints the matching symbols from left to right with no rounding at all, because a base-2 value always converts exactly into base-16.
Treat the binary to hex conversion tool as a calculator for your own manual work: it gives you the final answer, while the rest of this page explains why that answer is right. Any binary to hexadecimal converter follows the same rule, so once you understand it, you can check the result yourself. The input length is effectively unlimited, and the accuracy never drops, since grouping bits loses no information.
- Enter binary digits only: 0 and 1, with optional spaces to keep long strings readable.
- Expect a hexadecimal result built from 0-9 and A-F.
- Use the same value in the other direction to confirm the answer returns your original input.
How Binary to Hexadecimal Conversion Works
The conversion works because 16 equals 24. A nibble, which is four bits, can hold exactly 16 different patterns, and a hex symbol has exactly 16 possible values, so the two line up one for one. That is why you never need to pass through decimal to get from binary to hexadecimal: each group of four is converted on its own, then the results are joined.
The value of one group follows this formula, where b3 to b0 are the four bits of the group:
$$h = 8b_3 + 4b_2 + 2b_1 + 1b_0$$
The numbers 8, 4, 2 and 1 are the place-value weights of each position, which are the powers of 2 from \(2^{3}\) down to \(2^{0}\). A group of 1011 therefore gives \(8 + 0 + 2 + 1 = 11\), and 11 is written as the letter B.
The Binary System
Binary is a numeral system with radix 2. In the binary system every column is worth twice the one on its right, which makes it a positional system just like everyday counting. Electronics and computers use it because a circuit only has to detect an electric signal that is either off or on, and a long run of those states is simply binary code. Written as base 2, it needs just two symbols.
The Hexadecimal System
The hexadecimal system is a number system that uses base 16, so it needs sixteen symbols: the ten decimal digits 0-9 plus the letters A-F for the values 10 to 15. Each hexadecimal digit stands for four bits, which is why a hexadecimal number is just an abbreviated way to write a binary number. A single hex digit such as C always means 1100, and a full hex value is a row of those digits.
Step-by-Step: How to Convert Binary to Hex
Follow this step-by-step method whenever you want to convert without a tool:
- Write the binary number and split it into a group of four, then the next group, and so on, starting at the rightmost position.
- If the leftmost group is short, add zeros on its left until it holds four bits.
- Write the weights 8, 4, 2 and 1 under each group.
- Add up only the weights that sit under a 1, giving a number from 0 to 15 for each group.
- Replace every sum with its hex symbol (10 becomes A, 11 becomes B, up to 15 becoming F) and keep the original order.
Leading Zeros and Padding
Leading zeros are the most common source of confusion. Adding them on the left never changes a value, so 110 and 0110 are both 6, but you must add them before you split the groups so that the grouping lines up with the right edge. Manual errors almost always come from splitting from the left instead.
Binary to Hex Conversion Chart for Every Nibble
Keep this conversion table nearby while you practise. It is the complete binary to hexadecimal conversion chart, because there are only sixteen four-bit patterns to learn, and two nibbles together make a byte.
| Nibble (binary) | Hexadecimal digit | Decimal equivalent |
|---|---|---|
| 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 |
Worked Conversion Examples With Hex Results
These conversion examples use fresh values so you can follow each move. Start with 1011011101010011, which is sixteen bits and splits cleanly into four groups.
| Group | Weights applied | Decimal sum | Hex digit |
|---|---|---|---|
| 1011 | 8 + 0 + 2 + 1 | 11 | B |
| 0111 | 0 + 4 + 2 + 1 | 7 | 7 |
| 0101 | 0 + 4 + 0 + 1 | 5 | 5 |
| 0011 | 0 + 0 + 2 + 1 | 3 | 3 |
Joined in order, the result is (B753)16. To verify it, expand the hex value back into a decimal equivalent:
$$11 \times 16^{3} + 7 \times 16^{2} + 5 \times 16^{1} + 3 \times 16^{0} = 46{,}931$$
That matches the decimal reading of the original binary string, so the answer passes your double-check.
Now try an odd length: 11010110111 has eleven digits. Split from the right to get 110, 1011 and 0111, add one zero to the short group to make 0110, and the groups become 6, B and 7. So (11010110111)2 = (6B7)16, which is 1,719 in decimal.
Binary Fractions and Rounding
To convert a binary fraction into hex, follow the same rule, but you group outward from the point in both directions. For 1101.01101 the whole part is already one nibble, while the fractional part 01101 needs zeros on its right, not its left, giving 0110 1000. The result is D.68. Rounding only matters when a fractional part does not end cleanly, and for binary fractions entered in base 2 it ends cleanly every time.
Two's Complement and Negative Values in Hex
Computers store negative numbers with a trick: if the leftmost bit of a byte is 1, a reader that expects negative values subtracts 256 from the unsigned reading. The hex digits do not change, only the interpretation does.
| Bit pattern | Hex | Unsigned value | Signed value |
|---|---|---|---|
| 11110110 | F6 | 246 | -10 |
| 10110100 | B4 | 180 | -76 |
| 01111111 | 7F | 127 | 127 |
| 10000000 | 80 | 128 | -128 |
So F6 is 246 when read as a plain amount and -10 when read as a two's complement signed value, and the hex notation is identical either way.
Reading a Sensor Status Register in Hex
Dariusz Wolak is bringing up a temperature sensor board, and his logic analyzer captures the 16-bit status register as 1100101001110100. The datasheet lists every flag as a hex mask, so he needs the register in hexadecimal before he can compare anything.
He splits the capture into four groups, starting at the low end: 1100, 1010, 0111 and 0100. Dropping the full string into the converter returns CA74 as the hexadecimal reading of that register, which matches his hand check of C (12), A (10), 7 and 4. In decimal that is 51,828, the figure his logging script prints, so the two tools agree.
Now the useful part. The datasheet defines the over-temperature fault as mask 0x4000, and the converted top digit C is 1100, so the 0x4000 flag is set: the sensor is reporting over-temperature.
After a one-minute power-down, the recapture 1000101001110100 converts to 8A74. The leading digit has dropped from C to 8 and the 0x4000 mask no longer matches, which confirms the fault was thermal. Comparing in hex took seconds; comparing sixteen raw bits by eye would not have shown which flag changed.
Why Hexadecimal Beats Binary for Developers
Readability is the first reason. Thirty-two bits take thirty-two characters in binary but only eight in hex, which is why mathematics textbooks, hardware manuals and information technologies teams all prefer the shorter form. Hex stays compact without hiding anything, since every symbol still maps to four bits.
- Memory addresses and memory representation: debuggers print each byte as two hex symbols, so a converted address is easy to compare at a glance and speeds up debugging.
- Low-level programming and data encoding: flags, masks and registers are written in hex, and network protocols document their headers the same way, so you convert the raw bits first.
- HTML colors are three hex pairs: 11111111 01100100 00110010 converts to FF 64 32, written #FF6432.
For developers working across computing layers, a good binary to hexadecimal converter is a daily habit, not a classroom exercise.
Hex Conversion in Code and Real Systems
Python, Java and JavaScript
Every major language can do this in one line. In Python, wrap the string in int(..., 2) and pass it to hex(); JavaScript uses parseInt followed by toString(16); Java combines Integer.parseInt with Integer.toHexString:
hex(int("1011011101010011", 2))
parseInt("1011011101010011", 2).toString(16).toUpperCase()
Integer.toHexString(Integer.parseInt("1011011101010011", 2))All three return the B753 you calculated by hand, though Python and Java print it in lowercase.
ASCII Text and Octal
ASCII text converts to hex one character at a time, so the text "Hi" is 01001000 01101001, which converts to 48 69. Octal groups three bits instead of four, which is why hex fits byte-aligned data more neatly.
Choosing a Reliable Hex Converter and Checking Its Output
A trustworthy converter should accept long input, keep every leading digit you type, and return the same answer you reach on paper. When you test a new binary to hex converter, feed it a short value you already know, such as 1111, and confirm it returns F. Then run the output back through a hexadecimal converter and compare it with your starting string. A hex converter that cannot round-trip a value cleanly is not worth trusting with real work.
Some sites bundle a binary converter, a decimal converter and a text converter on one page, so you can move from decimal to binary, or from ASCII text to hex, without switching pages. Whichever converter you use, read the decimal result as a second opinion: if the decimal reading of your input and the decimal reading of the output disagree, a digit was dropped somewhere, and you should recheck the grouping before you trust the answer.