Loading...
3+
3
Login

Hexadecimal (Base 16) Number System

The hexadecimal number system (base 16, often called "hex") is the most widely used alternative number system in computing. It uses 16 symbols: digits 0–9 and letters A–F, where A=10, B=11, C=12, D=13, E=14, F=15.

Hexadecimal Digits

HexDecimalHexDecimal
0088
1199
22A10
33B11
44C12
55D13
66E14
77F15

Hexadecimal Place Values

Place (from right)Power of 16Decimal Value
1st16⁰1
2nd16¹16
3rd16²256
4th16³4,096
5th16⁴65,536

Converting Hex to Decimal

2AF (hex) = (2×256) + (A×16) + (F×1) = 512 + 160 + 15 = 687

More Examples

HexWorkingDecimal
1F(1×16)+(15×1)31
A0(10×16)+0160
FF(15×16)+(15×1)255
100(1×256)256

Converting Decimal to Hex

Divide repeatedly by 16; record remainders (using A–F for 10–15). Read from bottom to top.

255 ÷ 16 = 15 R 15 (F)  |  15 ÷ 16 = 0 R 15 (F)  →  255 = FF (hex)

Hex and Binary

One hex digit equals exactly four binary digits (bits), making hex an ideal shorthand for binary data.

1011 1110 (binary) = B E (hex)

Real-World Uses

  • Memory addresses in computers (e.g., 0x7FFF0000).
  • HTML/CSS colours (#FF5733 = red-orange).
  • IPv6 addresses (e.g., 2001:0db8:85a3::8a2e:0370:7334).
  • Machine code, assembly language, and debuggers.
Key Points
  • Hex uses 16 symbols: 0–9 then A–F (A=10 through F=15).
  • Place values are powers of 16: 1, 16, 256, 4096, …
  • One hex digit = four binary bits.
  • Hex is compact: two hex digits represent all 256 possible byte values.

Quick Practice

  1. Convert hex 3C to decimal.
  2. Convert hex 1A4 to decimal.
  3. Convert decimal 200 to hexadecimal.
  4. What colour does the CSS value #000000 represent?
  5. Convert binary 11111111 to hexadecimal.

Summary

Hexadecimal is the dominant number system in computing because one hex digit compactly represents exactly four binary bits. Its place values are powers of 16, and its digit set extends from 0 to F. Hexadecimal is used in memory addressing, colour coding, and countless other computing contexts.

Home About Resources Dashboard