Skip to main content

Command Palette

Search for a command to run...

How does a normal number like 255 become FF?

Published
3 min readView as Markdown
H

In my free time iwrite and raise my voice in toast.

Step 1: What is Decimal?

Decimal is the number system you already know.

It’s called base 10 because it has 10 digits:

0 1 2 3 4 5 6 7 8 9

When you write:

345

It really means:

(3 × 100) + (4 × 10) + (5 × 1)

Because:

  • 100 = 10²

  • 10 = 10¹

  • 1 = 10⁰

That’s decimal.


Step 2: What is Hexadecimal?

Hexadecimal is base 16.

Instead of 10 digits, it has 16:

0 1 2 3 4 5 6 7 8 9 A B C D E F

After 9, we don’t have symbols for 10, 11, 12...

So we use letters:

A = 10
B = 11
C = 12
D = 13
E = 14
F = 15

That’s it. Nothing magical.


Step 3: Converting Decimal → Hex (Easy Method)

We divide by 16.

Let’s convert:

Example 1: Convert 26 to hex

Step 1: Divide by 16

26 ÷ 16 = 1 remainder 10

So:

  • Quotient = 1

  • Remainder = 10

But 10 in hex = A

So we write:

1A

✅ 26 in decimal = 1A in hex


Example 2: Convert 255 to hex

Step 1: Divide by 16

255 ÷ 16 = 15 remainder 15

15 in hex = F

So we get:

F F

✅ 255 = FF


Example 3: Convert 100 to hex

100 ÷ 16 = 6 remainder 4

So:

64

Check:

6 × 16 = 96
96 + 4 = 100

✅ Correct.


Why Are We Dividing by 16?

Because hexadecimal is base 16.

Just like:

  • To convert to binary → divide by 2

  • To convert to decimal → divide by 10

  • To convert to hex → divide by 16


Let’s Make It Even Simpler

Think of hex like this:

Each position represents powers of 16.

Example:

1A

Means:

(1 × 16) + (10 × 1)
= 16 + 10
= 26

That’s all.


Why Crypto People Love Hex

Because:

  • Computers store numbers in binary (0s and 1s).

  • Binary is long and ugly.

  • Hex makes binary shorter and readable.

Example:

Binary:

11111111

Hex:

FF

Much cleaner.


Ignore Everything Else For Now

You don’t need:

  • Merkle trees

  • Primitive roots

  • Discrete logs

Those come MUCH later.

Right now you only need:

  1. Understand decimal

  2. Understand base 16

  3. Practice dividing by 16


Let’s Practice Together

Try this one:

Convert 45 to hexadecimal.

Do:

45 ÷ 16
2 views