Binary numbers: Bits and place values

A byte has eight bits. Each bit has a place value. Turn bits on and off to build a number.

Number basics

Binary uses 0 and 1

A bit is one binary digit. A bit can be 0 or 1. Each place is a power of two. From right to left, the place values are 1, 2, 4, 8, 16, 32, 64 and 128.

Choose a starting number

Decimal value

You can also press any bit below. The buttons work with a keyboard.

One byte

Place values

A 1 means “include this place value.” A 0 means “add zero.” Add the included values to get decimal.

Binary and hexadecimal

Hexadecimal uses sixteen digits: 0–9 and A–F. Four bits make one hex digit. For example, 0010 1010 is 2Ah, which is 42 in decimal.

BinaryHexDecimal
0000 000000h0
0010 10102Ah42
1111 1111FFh255

Numbers 1 to 16 in binary

Each row shows the same value in decimal, 8-bit binary and hexadecimal. The leading zeroes fill the byte; they do not change the value.

Decimal8-bit binaryHexadecimal
10000 000101h
20000 001002h
30000 001103h
40000 010004h
50000 010105h
60000 011006h
70000 011107h
80000 100008h
90000 100109h
100000 10100Ah
110000 10110Bh
120000 11000Ch
130000 11010Dh
140000 11100Eh
150000 11110Fh
160001 000010h

Eight bits can show unsigned values from 0 to 255. The same byte can also represent a signed value from −128 to +127. See Negative numbers in binary and hexadecimal for the two’s-complement method.