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
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
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.
| Binary | Hex | Decimal |
|---|---|---|
| 0000 0000 | 00h | 0 |
| 0010 1010 | 2Ah | 42 |
| 1111 1111 | FFh | 255 |
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.
| Decimal | 8-bit binary | Hexadecimal |
|---|---|---|
| 1 | 0000 0001 | 01h |
| 2 | 0000 0010 | 02h |
| 3 | 0000 0011 | 03h |
| 4 | 0000 0100 | 04h |
| 5 | 0000 0101 | 05h |
| 6 | 0000 0110 | 06h |
| 7 | 0000 0111 | 07h |
| 8 | 0000 1000 | 08h |
| 9 | 0000 1001 | 09h |
| 10 | 0000 1010 | 0Ah |
| 11 | 0000 1011 | 0Bh |
| 12 | 0000 1100 | 0Ch |
| 13 | 0000 1101 | 0Dh |
| 14 | 0000 1110 | 0Eh |
| 15 | 0000 1111 | 0Fh |
| 16 | 0001 0000 | 10h |
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.