Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

Binary to Decimal

Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Convert binary to decimal, exact for long values, with each step written out

Paste binary and read it in decimal, with each bit times its power of two written out, and its signed value when the top bit is set.

How to use it

  1. Paste bits. Spaces, _ and a 0b prefix are fine: 1011 0110 and 0b10110110 read the same.
  2. Read the decimal value on top and the sum by hand under it.
  3. For a signed value, pick the width in Bits: the same bits read as two’s complement show beside the unsigned value.

Examples

One byte

Input
1011 0110
Result
182

1×128 + 0×64 + 1×32 + 1×16 + 0×8 + 1×4 + 1×2 + 0×1

The same byte read as signed

Input
10110110
Result
Unsigned  182
Signed    -74

Bits: 8. The top bit is set, so the signed value is 182 − 256.

How to convert binary to decimal by hand

Number the bits from the right, starting at 0. Each 1 adds 2 to the power of its place; each 0 adds nothing. For 1011: 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11.

Place76543210
Worth1286432168421

Bytes worth knowing

BinaryDecimalWhere you meet it
1111 1111255the largest byte; an IPv4 octet, a color channel
1000 0000128the top bit of a byte; -128 when signed
0111 1111127the largest signed byte; the last ASCII code
1111 1111 1111 111165,535the largest port number

Questions

Is 11111111 255 or -1?
Both, depending on how the bits are read. As an unsigned byte it is 255; as a signed 8-bit number in two’s complement it is -1. Pick 8 in Bits to see both.
Can I paste more than 64 bits?
Yes. The value is worked out exactly, up to 5,000 digits, so a 128-bit or 256-bit pattern converts to all its decimal digits. The steps by hand show for up to 32 bits.
Is the number I type uploaded?
No. Everything runs in your browser, so your numbers stay on your device. Nothing you paste is uploaded unless you share it.

Related tools