Binary Calculator · Practical guide
Convert Binary to Decimal and Hexadecimal
Each binary digit is a power of two — add the places holding a 1 for decimal, group by fours for hex.
At a glance
Binary to Decimal: Add the Place Values
Every binary digit sits on a power of two: 1, 2, 4, 8, 16, and so on from right to left. Add the places that hold a 1. For 1010: 8 + 0 + 2 + 0 = 10 in decimal. The calculator above performs the conversion as part of any operation — adding binary 0 to a number returns the same value alongside its decimal and hex forms.
Interactive tool
Binary Calculator
Enter your own values, then compare the result with the examples below.
Result
Binary to Hexadecimal: Group by Fours
Because 16 = 2^4, each hex digit covers exactly four binary digits. Split the binary number into groups of four from the right, then convert each group:
| Binary | Decimal | Hex |
|---|---|---|
| 1000 | 8 | 0x8 |
| 1010 | 10 | 0xA |
| 1111 | 15 | 0xF |
| 10000 | 16 | 0x10 |
| 11111111 | 255 | 0xFF |
Worked Example: 11111111
Eight 1s mean 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255 in decimal. Grouped as 1111 1111, each half is 15, which is F in hex — so 11111111 = 0xFF, the largest value in one byte.
Going the Other Way
To convert decimal to binary, repeatedly divide by 2 and record the remainders in reverse: 13 becomes 1101. Hex to binary is even easier — expand each hex digit into its four-bit group, so 0xA5 becomes 10100101.
Frequently Asked Questions
Why does hexadecimal pair so well with binary?
One hex digit represents exactly four bits, so converting between hex and binary never requires arithmetic — just lookup and grouping.
What is the largest decimal value of one byte?
A byte is 8 bits, and 11111111 in binary equals 255, or 0xFF in hexadecimal.
How do I convert a binary fraction like 0.1?
Digits after the point are negative powers of two: 0.1 binary is 1/2 = 0.5 decimal, and 0.11 is 0.75. This calculator handles whole numbers.
What does the 0x prefix mean?
0x is the standard prefix marking a number as hexadecimal, used in C, JavaScript, and most programming contexts. 0xA means decimal 10.