Max byte
- Input
- 11111111₂
- Expected output
- 255₁₀
The whole byte turned on adds 128+64+32+16+8+4+2+1, every power of 2 from 2⁰ to 2⁷ at once.
binary to decimal
Each binary digit carries an increasing power of 2 from right to left: the rightmost bit is worth 2⁰, the next 2¹, and so on up to the most significant bit, which alone accounts for the largest share of the final value. The tool adds up these weights in BigInt, accepting up to 256 digits in the source base and an optional minus sign, without the 32- or 64-bit ceiling that trips up ordinary calculators.
The whole byte turned on adds 128+64+32+16+8+4+2+1, every power of 2 from 2⁰ to 2⁷ at once.
The two highest bits, 128 and 64, already add up to 192 alone: it is the first octet in addresses like 192.168.x.x.
A ninth bit to the left no longer fits in a single byte: 256 is the first decimal value that 8 bits alone cannot represent, since the largest is 255.
Multiply each bit by its weight, which is a power of 2 counted from the right starting at 2 to the power of 0, and add the results. For example, binary 1011 is 1x8 + 0x4 + 1x2 + 1x1 = 11. A quick check: 11111111 is always 255, because it is eight set bits, 2^8 - 1. To see the weight table laid out, use the Step by step tab.
Yes: just prefix the binary value with a minus sign, like -1010₂, which the tool converts to -10₁₀. That differs from the two's complement processors use internally, where the highest bit marks the sign without a separate character.
Because it alone accounts for nearly half of the total value: in an 8-bit byte, the MSB is worth 128, more than the sum of the other seven bits combined (127). Getting that one bit wrong changes the result more than getting any combination of the rest wrong.
Up to 256 digits in the source base, computed entirely in BigInt: no floating-point rounding enters the calculation, unlike what would happen if it used JavaScript's Number type past 53 bits.
Results
11111111377255FF7V73193All data stays in your browser. No numbers are sent to any server.