Binary to Decimal to Hexadecimal Converter
Can convert negatives and fractional parts too.
numbers/images/bin-dec-hex.js
Instructions
Just type in any box, and the conversion is done "live".
Accuracy is "unlimited" between binary and hexadecimal (and vice versa), and is up to 20 digits for decimals.
Try It
- Type 15 into the Decimal box. Watch how it becomes 1111 in Binary and a single letter F in Hexadecimal
- Type 255 into the Decimal box. It becomes 11111111 in binary and FF in Hex
- Type 0.5 into the Decimal box to see how fractional parts are shown
Binary Format
We allow for several formats of binary data:
| Number | As a standard number (default): | 101.01 | ||
| 0001 | Leading/trailing zeros, to match hexadecimal: | 0101.0100 | ||
| signed 8-bit | twos-complement signed 8-bit | 11111111 | ||
| signed 16-bit | twos-complement signed 16-bit | (16 bits) | ||
| signed 32-bit | twos-complement signed 32-bit | (32 bits) |
What's "signed" binary?
Computers use a clever trick called two's complement to write negative numbers.
In a signed 8-bit system, the very first bit on the left tells us if the number is positive (0) or negative (1). This is why -1 looks like 11111111
Other Bases
You can convert to other bases (such as base-3, base-4, octal and more) using Base Conversion