Base-16 (Hexadecimal) Number System

The bridge between human-readable and machine code - essential for memory addressing, networking, and cybersecurity applications.

What is Hexadecimal?

Hexadecimal (Base-16) uses 16 distinct symbols to represent numbers:

Digits (0-9):

0 1 2 3 4 5 6 7 8 9

Letters (A-F):

A B C D E F

Key Fact: One hex digit represents exactly 4 bits (a nibble)

Hexadecimal Values Reference

HexDecimalBinaryHexDecimalBinary
000000881000
110001991001
220010A101010
330011B111011
440100C121100
550101D131101
660110E141110
770111F151111

Notation Styles

Programming:0x2AC, Java, Python
Web Colors:#FF0000HTML, CSS
Assembly:2AhAssembly language
Mathematical:2A₁₆Mathematical notation

Hex to Decimal Conversion

Positional Value Method

Example: Convert 2A3₁₆ to decimal

PositionDigitBase PowerCalculationValue
2216² = 2562 × 256512
1A (10)16¹ = 1610 × 16160
0316⁰ = 13 × 13
Result: 2A3₁₆ = 512 + 160 + 3 = 675₁₀

Decimal to Hex Conversion

Repeated Division by 16

Example: Convert 255₁₀ to hexadecimal

255 ÷ 16 = 15 remainder F
15 ÷ 16 = 0 remainder F
Read remainders upward:
FF₁₆

Binary to Hex Conversion

Group by 4 Method

Example: Convert 11010110₂ to hex

11010110₂
1101 | 0110
D | 6
D6₁₆
Remember:
1101₂ = D₁₆ = 13₁₀
0110₂ = 6₁₆ = 6₁₀
Memory Addressing

Computer memory addresses are commonly displayed in hexadecimal:

0x7FFF0000
32-bit memory address

Each pair of hex digits represents one byte of data.

MAC Addresses

MAC addresses use 6 bytes (12 hex digits) separated by colons:

00:1A:2B:3C:4D:5E
00:1A:2B Manufacturer ID
3C:4D:5E Device ID

Web Color Codes

RGB colors use 3 bytes (6 hex digits) for red, green, and blue:

#FF0000
FF = 255 Red
00 = 0 Green
00 = 0 Blue
#00FF00
00 = 0 Red
FF = 255 Green
00 = 0 Blue
#0000FF
00 = 0 Red
00 = 0 Green
FF = 255 Blue

Cryptographic Hashes

Hash values are typically displayed in hexadecimal:

MD5 Hash:
5d41402abc4b2a76b9719d911017c592
SHA-256 Hash:
2cf24dba4f21d4288094c3b8e9ba6c3a57b2d6ec9b8c0b8d7f4e4e6e7f8f9fa
Exercise 1: Hex to Decimal

Convert these hex values to decimal:

A7₁₆ = ?

Solution:

A7₁₆ = (A×16¹) + (7×16⁰)

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

= 160 + 7 = 167₁₀

Exercise 2: Decimal to Hex

Convert these decimal values to hex:

200₁₀ = ?

Solution:

200 ÷ 16 = 12 remainder 8

12 ÷ 16 = 0 remainder C

200₁₀ = C8₁₆

Exercise 3: Binary to Hex

Convert these binary values to hex:

10110011₂ = ?

Solution:

10110011₂

Group by 4: 1011 | 0011

Convert: B | 3

10110011₂ = B3₁₆

Exercise 4: Message Decoding

Decode this hex message (ASCII):

48656C6C6F = ?

Solution:

48₁₆ = 72₁₀ = 'H'

65₁₆ = 101₁₀ = 'e'

6C₁₆ = 108₁₀ = 'l'

6C₁₆ = 108₁₀ = 'l'

6F₁₆ = 111₁₀ = 'o'

Message: "Hello"

Hex Calculator

Enter a hex value to see the conversion
Quick Hex Reference
A=10
B=11
C=12
D=13
E=14
F=15