Binary Numbers

Computers store everything as 1s and 0s. Each bit represents a power of two; add the active ones together to get the number. Click any bit to toggle it.

8-bit representation

Click any bit cell to flip it.

Representations

Decimal
0
Binary
00000000
Hexadecimal
0x00

How binary works

Binary is base 2 — just like decimal is base 10 but with only two digits (0 and 1). Each bit position represents the next power of two: the rightmost is 2⁰ = 1, the next is 2¹ = 2, then 4, 8, 16, 32, 64, 128.

To read a binary number, add up the place values wherever a 1 appears. For example, 00101010 has 1s in the 32, 8, and 2 positions: 32 + 8 + 2 = 42.

An 8-bit byte can represent 2⁸ = 256 distinct values (0 – 255). Bytes are the atom of computer memory, and most cryptographic operations work on bytes or groups of bytes.

Hexadecimal (base 16, digits 0 – F) is a compact shorthand: each hex digit maps to exactly four bits (a nibble), so one byte is always two hex digits. That's why you see ciphertext, hashes, and keys written in hex.