Mustafa Bilgic Published: 1 January 2025 | Updated: 20 February 2026
Hexadecimal Arithmetic Calculator
+
−
×
÷
Hex / Decimal / Binary Converter
RGB to Hex Colour Converter
Enter RGB values (0–255 each) to get the hex colour code — or enter a hex code to convert to RGB.
Include the # symbol
What Is Hexadecimal?
Hexadecimal is a base-16 number system. It uses 16 symbols: the digits 0–9 and the letters A–F (where A=10, B=11, C=12, D=13, E=14, F=15).
Decimal
Hex
Binary
Decimal
Hex
Binary
The key insight is that one hex digit = four binary bits. This makes hex a compact and human-readable shorthand for binary. A byte (8 bits) is always exactly two hex digits (00 to FF).
How to Convert Hex to Decimal
Multiply each hex digit by 16 raised to its positional power (rightmost position = 0), then sum the results:
Key hex sums:
F + 1 = 10 (carry!)
9 + 9 = 12
F + F = 1E
A + 6 = 10 (carry!)
Hex Colour Codes in CSS and HTML
Web colours are specified as six hex digits in the format #RRGGBB, where each pair represents the red, green, and blue channels on a scale of 00 (0) to FF (255):
#FF0000 = Red (R=255, G=0, B=0)
#00FF00 = Lime green (R=0, G=255, B=0)
#0000FF = Blue (R=0, G=0, B=255)
#FFFFFF = White (R=255, G=255, B=255)
#000000 = Black (R=0, G=0, B=0)
#FF5733 = Custom orange (R=255, G=87, B=51)
With 256 levels per channel, there are 256³ = 16,777,216 possible colours — over 16 million. Shorthand 3-digit codes (#F00) expand to 6 digits by doubling each digit (#FF0000).
Hex in Computer Memory Addresses
Computer memory is byte-addressable, and memory addresses are displayed in hex because it is compact and maps cleanly to binary. Examples:
0x00000000 — start of memory (null pointer)
0x7FFFFFFF — 2GB boundary (common 32-bit user space limit)
0xFFFFFFFF — maximum 32-bit address (4GB)
The 0x prefix is the convention in C, C++, Python, and many other languages to indicate a hexadecimal literal. In assembly language and many debugging tools, hex is the standard for addresses, opcodes, and raw data.
Hexadecimal (base 16) uses 0–9 and A–F. It is used in computing because one hex digit represents exactly 4 bits, making it a compact and readable shorthand for binary. A byte (8 bits) is always exactly 2 hex digits. This makes hex ideal for colour codes, memory addresses, and machine code.
How do you convert hex to decimal?
Assign each hex digit its positional value (rightmost = 16⁰ = 1, next = 16¹ = 16, etc.). Multiply each digit by its positional value and sum. Example: 3E8 = (3×256)+(14×16)+(8×1) = 768+224+8 = 1000. Our calculator shows all steps.
How do you add hexadecimal numbers?
Add column by column right to left. Sum is carried when it reaches 16 (not 10). F+1=10 in hex (carry 1, write 0). 9+8=11 in hex (1×16+1=17, so write 1, carry 1). Practice: B+7=12 (11+7=18=1×16+2, so write 2, carry 1).
What do hex colour codes mean?
#RRGGBB specifies Red, Green, Blue channels each as two hex digits (00–FF = 0–255). #FF0000 is pure red, #00FF00 is lime, #0000FF is blue, #FFFFFF is white, #000000 is black. There are 256³ = 16,777,216 possible colours. Short codes like #F80 expand to #FF8800.
What is the difference between hex and binary?
Binary (base 2) uses only 0 and 1 — 8 bits for a byte. Hexadecimal (base 16) uses 0–9 and A–F — only 2 digits for a byte. One hex digit always represents exactly 4 binary bits. FF in hex = 11111111 in binary. Hex is simply a compact way to read and write binary data.
How are hex numbers used in memory addresses?
Computer memory is byte-addressed and addresses are shown in hex for compactness. A 32-bit address like 0x7FFFFFFF is 8 hex digits instead of 32 binary digits. The 0x prefix denotes hex in C, C++, Python, and assembly. Debuggers, operating systems, and network protocols all use hex for addresses and data.