Number Base Converter (Binary, Hex)
Type a number into any field and the other bases update instantly. See the bits, two's complement, fractions and the working.
Prefixes 0b, 0o and 0x, spaces or _ as separators and full-width digits are all accepted. Fractions (0.1) and negative numbers (−5) work too.
Everything is calculated in this browser. The numbers you type are never sent anywhere.
Bits
With "Signed", the binary, octal and hex fields are read and written as fixed-width two's complement (FF at 8 bits is −1).
Numbers with a fractional part are not shown as bits (see the working below for the integer and fractional parts).
Click a bit to flip it between 0 and 1; the fields above update. The small number under each bit is its position (0 is the rightmost).
You can also click bits to build a number.
- Read as unsigned
- Read as signed (two's complement)
Negative numbers are shown in two's complement: flip every bit of the positive number and add 1. If the leftmost bit (the sign bit) is 1, the number is negative.
Working
Enter a number to see the steps here.