Number Systems Basics

Decimal, binary and hexadecimal side by side, the basis for everything close to computer hardware.

Last updated: September 1, 2026

Basic terms

Decimal systemThe familiar number system with ten digits, 0 to 9
Binary systemUses only two digits, 0 and 1, the basis of all computer technology
Hexadecimal systemUses 16 characters, 0 to 9 and A to F, often used to compactly represent binary numbers
BaseThe number of distinct digits in a number system

Bit and byte

BitThe smallest unit of storage, either 0 or 1, true or false, high or low, stored in a memory cell in RAM or ROM
ByteEight bits together, can represent 256 different values
KilobyteUsually 1024 bytes
MegabyteUsually 1024 kilobytes

Converting

Decimal to binaryRepeatedly divide by 2, the remainders from bottom to top form the binary number
Binary to decimalMultiply each digit by its matching power of two and add them up
4 bits to hexEvery four binary digits form exactly one hexadecimal digit

Comparison table, 0 to 15

0Binary 0000 · Hex 0
1Binary 0001 · Hex 1
2Binary 0010 · Hex 2
3Binary 0011 · Hex 3
4Binary 0100 · Hex 4
5Binary 0101 · Hex 5
6Binary 0110 · Hex 6
7Binary 0111 · Hex 7
8Binary 1000 · Hex 8
9Binary 1001 · Hex 9
10Binary 1010 · Hex A
11Binary 1011 · Hex B
12Binary 1100 · Hex C
13Binary 1101 · Hex D
14Binary 1110 · Hex E
15Binary 1111 · Hex F
Worth a look

The structure of a byte

A byte consists of eight bits. Each position has a fixed place value, from 128 down to 1. Here it shows the number 156.

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

128 + 16 + 8 + 4 = 156