Binary to decimal
Convert binary to decimal in your browser with arbitrary precision, and see the signed reading at each register width.
Runs in your browser
Enter a number.
Any length, exactly
Binary strings get long quickly — a 64-bit value is 64 characters — and that length is precisely where converters built on ordinary numbers start returning approximations.
This uses arbitrary-precision integers. A 200-digit binary string converts exactly.
The 0b prefix is optional, and spaces or underscores between digits are
ignored, so the grouped form people actually write — 0b1010 1010 or
1010_1010 — works as pasted.
The signed reading
A binary string on its own does not say how wide the register is or whether it is signed, and both change what the bits mean.
11111111 is 255 as an unsigned byte and −1 as a signed one. The
conversion shows both, at each width the value fits into, so you do not have to
work out the two’s complement by hand.
That is the usual reason for reading binary in the first place: a status register, a permission mask, or a packed field where the top bit is a sign.
Counting bits
The bit count shown is the magnitude — how many bits the number actually
needs — not the width of any container. 255 needs 8; 256 needs 9.
That distinction matters when you are checking whether a value will fit somewhere. A number needing 33 bits does not fit in a 32-bit field, whatever its decimal form looks like.
Nothing is uploaded
Converted in this page.