What is Hexadecimal?
Hexadecimal (hex) is a base-16 number system. While decimal uses digits 0โ9 and binary uses 0โ1, hex uses 16 symbols: digits 0โ9 plus letters AโF (where A=10, B=11, C=12, D=13, E=14, F=15). A single hex digit can represent values from 0 to 15.
Why Do Computers Use Hex?
Computers store everything in binary, which can become very long very quickly. Hex is a compact shorthand: one hex digit represents exactly 4 binary bits (a "nibble"), and two hex digits represent one byte (8 bits). This makes hex much easier to read and write than binary while still mapping cleanly to how computers store data.
Hex to Decimal Conversion
Each position represents a power of 16. To convert hex to decimal, multiply each digit by 16 to the power of its position.
Example: 2F in hex
- 2 ร 16^1 = 32
- F (=15) ร 16^0 = 15
- Total: 32 + 15 = 47 in decimal
Common Hex Values
- 0xFF = 255 (max value of one byte)
- 0x10 = 16
- 0x1A = 26
- 0x64 = 100
- 0xFFFFFF = 16,777,215 (used in RGB color codes)
Where You'll See Hex in Real Life
- Colors in web design: #FF5733, #1E90FF are hex RGB values
- Memory addresses in programming and debugging
- MAC addresses on network devices (e.g. A1:B2:C3:D4:E5:F6)
- File formats and encodings in low-level programming
Convert hex to decimal, binary or octal instantly with our free number system converter.
Step-by-Step Conversion Examples
Decoding a Web Color: #3B82F6
The CSS color #3B82F6 (a shade of blue used widely in UI design) breaks down as three hex pairs โ one per RGB channel:
- 3B (red): 3ร16 + 11 = 48 + 11 = 59 out of 255
- 82 (green): 8ร16 + 2 = 128 + 2 = 130 out of 255
- F6 (blue): 15ร16 + 6 = 240 + 6 = 246 out of 255
So #3B82F6 = RGB(59, 130, 246) โ a strong blue with low red, moderate green, and high blue. There are exactly 16,777,216 possible web colors (256ยณ), corresponding to six hex digits (two per channel). #FFFFFF = white (255,255,255); #000000 = black; #FF0000 = pure red.
Reading a Memory Address in a Debugger
A crash report shows address 0x00007FFE4A3C. The hex prefix tells a systems programmer the memory region instantly:
- Addresses 0x0000_0000 to 0x7FFF_FFFF โ user space (below 2 GB boundary)
- Addresses 0xFFFF_8000_0000_0000 and above โ kernel space (64-bit Linux)
- 0x7FFE = 32,766 decimal โ confirming this address is in user space
In 64-bit Windows processes, user-mode addresses stay below 0x7FFF_FFFF_FFFF. Reading hex directly makes these region boundaries visible โ 0x80000000 = exactly 2 GiB = the classic 32-bit user/kernel boundary โ in a way that decimal (2,147,483,648) does not.
Converting Hex to Binary Directly
Every hex digit maps to exactly 4 binary bits (a nibble), making the conversion table worth memorizing:
- 0 = 0000 1 = 0001 2 = 0010 3 = 0011
- 4 = 0100 5 = 0101 6 = 0110 7 = 0111
- 8 = 1000 9 = 1001 A = 1010 B = 1011
- C = 1100 D = 1101 E = 1110 F = 1111
Converting 0xDEAD to binary: D=1101, E=1110, A=1010, D=1101 โ 1101 1110 1010 1101. To decimal: 8192+4096+2048+1024+512+256+128+32+8+4+1 = 57,005. The 0xDEAD value famously appears in embedded systems debugging as a sentinel value for uninitialized memory. 0xBEEF, 0xCAFE, and 0xFACE are similar mnemonics used as magic numbers.
Hex in Security and Networking
A MAC address identifies a network interface uniquely worldwide. The address A1:B2:C3:D4:E5:F6 translates as:
- First 3 bytes (OUI โ Organizationally Unique Identifier): A1:B2:C3 โ identifies the hardware manufacturer
- Last 3 bytes: D4:E5:F6 โ device-specific identifier assigned by the manufacturer
SHA-256 cryptographic hashes are 64 hex characters = 256 bits = 32 bytes. Git commit hashes are 40 hex characters (SHA-1 = 160 bits). UUID v4 identifiers follow the pattern xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx โ all hex digits โ providing 122 bits of randomness (approximately 5.3ร10ยณโถ unique values). Every time you install a package, clone a repo, or send a secure HTTPS request, you're working with hexadecimal behind the scenes.
Source: IEEE 802 MAC address standard; W3C CSS Color Level 4 specification. Last verified: May 2026.
Frequently Asked Questions
How do I convert hexadecimal to decimal?
Multiply each hex digit by its positional value (powers of 16 from right to left). Hex digits AโF represent 10โ15. Example: 1F hex = (1ร16) + (15ร1) = 16+15 = 31 decimal. FF hex = (15ร16)+(15ร1) = 255. Our Binary & Number Systems converter handles any hex value instantly.
Why is hex used for colours in web design?
Web colours use hex because each RGB component (red, green, blue) fits in exactly one byte (0โ255), which is two hex digits. So #FF5733 means red=255, green=87, blue=51. Hex is more compact and readable than decimal for this purpose โ six hex characters fully describe any of 16.7 million colours.
What is the difference between hexadecimal and binary?
Both are used in computing, but for different purposes. Binary (base 2) uses only 0 and 1 โ it's how data is physically stored. Hexadecimal (base 16) is a compact human-readable shorthand for binary: 4 binary digits map to exactly 1 hex digit. For example, binary 1111 = F in hex = 15 in decimal.
Convert between hexadecimal, decimal, binary, and octal instantly.
โก Binary & Number Systems Converter โ FreeAccuracy note: Conversion factors on SwiftConvertHub are sourced from NIST and IEC standards. Results are accurate for general use. For safety-critical or professional applications, verify results independently. Full disclaimer โ
Victor A. Calvo S. is a software engineer and digital entrepreneur who builds practical, free tools for developers, students, and professionals worldwide. He is the creator of SwiftConvertHub, InstantLinkHub, and Feexio. All conversion factors are cross-referenced against NIST and IEC standards. Learn more โ