Number bases
Computers store and process all data as numbers. Humans usually count in base 10 (decimal), but computers use base 2 (binary). Programmers and engineers also use base 16 (hexadecimal) as a more compact way of writing binary. You need to be confident counting in all three bases.
What "base" means
The base (or radix) is the number of distinct digits you use, and the value of each place is a power of that base.
- Decimal (base 10): digits 0-9; place values 1, 10, 100, 1000, …
- Binary (base 2): digits 0-1; place values 1, 2, 4, 8, 16, 32, 64, 128, …
- Hexadecimal (base 16): digits 0-9 and A-F; place values 1, 16, 256, 4096, …
In hex, A=10, B=11, C=12, D=13, E=14, F=15. We need single-character digits for values up to 15.
Counting in binary
0 = 0
1 = 1
10 = 2 (one 2, zero 1s)
11 = 3 (one 2, one 1)
100 = 4
101 = 5
110 = 6
111 = 7
1000 = 8
1001 = 9
1010 = 10
1011 = 11
1100 = 12
Each new column to the left is double the value of the column to its right. To go from binary 1010 to decimal: 8 + 0 + 2 + 0 = 10.
Counting in hex
0..9 → 0..9
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
10 = 16 (one 16, zero 1s)
11 = 17
1A = 26 (16 + 10)
FF = 255 (15×16 + 15)
Two hex digits can represent any value 0-255 — exactly one byte (8 bits).
Why three bases?
- Decimal is for humans — natural to read and write.
- Binary is the underlying physical representation in transistors (on/off, 0/1).
- Hex is a compromise — every hex digit corresponds to exactly 4 bits (a nibble), so it's a compact way to write long binary values.
11111111(8 bits) becomesFF(2 hex digits).
This is why colour codes (#FF6633), MAC addresses (00:1A:2B:3C) and memory addresses are written in hex.
Bit, nibble, byte
- Bit (b): a single binary digit, 0 or 1.
- Nibble: 4 bits — exactly one hex digit.
- Byte B: 8 bits — two hex digits.
A byte can store 2⁸ = 256 distinct values (0-255 unsigned, or -128 to +127 signed in two's complement — beyond GCSE).
Quick recognition
When you see a number prefix or suffix, it tells you the base:
0b1010or just1010₂→ binary0x1Aor1A₁₆→ hexadecimal- No prefix → assume decimal in plain text
✦Worked example— Worked example — counting upwards in binary
Add 1 to a binary number by working right to left, flipping bits and carrying.
0011 + 1 = 0100 (carry through three 1-bits)
0111 + 1 = 1000
⚠Common mistakes— Pitfalls
- Forgetting hex letters are 10-15. A is not 11 — A is 10.
- Padding wrong. Each binary place is a power of 2 starting from 1 (2⁰), not from 2 (2¹).
- Mis-reading hex with similar letters. Be careful with O vs 0 and I vs 1.
- Using base notation incorrectly.
10in any base means "1 of the base + 0 of the units" — so binary 10 = 2, hex 10 = 16, decimal 10 = 10. - Confusing nibble and byte. A nibble is 4 bits, a byte is 8 bits.
➜Try this— Quick check
Without converting, which is bigger: binary 1011 or hex C?
- Binary 1011 = 8 + 2 + 1 = 11.
- Hex C = 12.
- So hex C > binary 1011.
AI-generated · claude-opus-4-7 · v3-deep-computer-science