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

Common Hex Values

Where You'll See Hex in Real Life

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:

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:

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:

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:

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 โ€” Free

Accuracy 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 โ†’

๐Ÿ‘ค
Written by
Victor A. Calvo S.

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 โ†’