Developer Bases

Binary to decimal

Binary value
Decimal 170
Each place is a power of two
The same number elsewhere
Binary 10101010
Binary, grouped 1010 1010
Octal 252
Hexadecimal AA
Bits needed 8
Note
Places double: 1, 2, 4, 8, 16…
DecimalBinaryOctalHex
0000
1111
81000108
10101012A
15111117F
16100002010
64100000010040
100110010014464
25511111111377FF
256100000000400100
1024100000000002000400
655351111111111111111177777FFFF

From the right, the places are 1, 2, 4, 8, 16, 32, 64, 128. Add the ones where a bit is set: 10101010 has bits at 128, 32, 8 and 2, which totals 170. With practice a byte is readable directly, which is why the eight powers of two up to 128 are worth memorising.

Advertisement
320 × 100

Each binary place is a power of two, doubling from the right: 1, 2, 4, 8, 16 and so on. Add the values where a bit is set. 10101010 is 128 + 32 + 8 + 2 = 170.

How to convert binary to decimal

1 Enter the binary digits — spaces between bytes are fine.
2 Read the decimal value.
3 Check the hex form, which is often more compact to work with.
4 Anything other than 0 and 1 is rejected rather than ignored.

Grouping matters more than it looks. A long binary string is nearly unreadable, which is why it is conventionally written in groups of four or eight — 11111111 rather than the same eight digits run together with others. Four bits is a nibble and maps to one hex digit; eight is a byte and maps to two. The grouped output above uses nibbles for exactly that reason.

Questions

Ten. The places are 8, 0, 2, 0.

Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING