Convert Binary to Decimal
Reading a binary literal, a bitmask, or a register value usually means working out its decimal value. This converter turns base-2 numbers into plain base-10 integers, accepting an optional 0b prefix.
Example · Binary → Decimal
Binary input
10 1010 101010 11111111
Decimal output
2 10 42 255
How to convert Binary to Decimal
- Take your binary value, e.g. 1010.
- Multiply each bit by 2 raised to its position, right to left.
- Sum the results — 1010 becomes 8 + 0 + 2 + 0 = 10.
Frequently asked questions
Does it accept a 0b prefix?
Yes. A leading 0b is stripped automatically, so both 1010 and 0b1010 convert to 10.
What if I enter non-binary digits?
Only 0 and 1 are valid. Any other character makes the value invalid, and the converter flags that line.
Related converters