Loading Calculator...
Please wait a moment
Please wait a moment
Convert hexadecimal numbers (base-16) to decimal numbers (base-10) instantly. Perfect for color codes, memory addresses, and programming.
| Hexadecimal | Decimal |
|---|---|
| 0x0 | 0 |
| 0x1 | 1 |
| 0xA | 10 |
| 0xF | 15 |
| 0x10 | 16 |
| 0x1F | 31 |
| 0x20 | 32 |
| 0x64 | 100 |
| 0xFF | 255 |
| 0x100 | 256 |
| 0x3E8 | 1000 |
| 0xFFF | 4095 |
| 0xFFFF | 65535 |
Hexadecimal (hex) is a base-16 number system using digits 0-9 and letters A-F. It's extensively used in computing because one hex digit represents exactly 4 bits, making it a compact way to represent binary data. Hex is commonly seen in color codes, memory addresses, and debugging.
Each hex digit has a position value based on powers of 16. Multiply each digit by 16 raised to its position (from right to left, starting at 0), then sum the results. Remember: A=10, B=11, C=12, D=13, E=14, F=15.
Example: Convert 2A3 to decimal
2 × 16² = 2 × 256 = 512
A × 16¹ = 10 × 16 = 160
3 × 16⁰ = 3 × 1 = 3
Total: 512 + 160 + 3 = 675
In hexadecimal, letters represent values beyond 9: A=10, B=11, C=12, D=13, E=14, F=15. This extends the single-digit range to 16 values (0-15), which is why it's called base-16. Both uppercase and lowercase letters are valid.
Web colors use hex because each color channel (Red, Green, Blue) requires 8 bits (0-255). Two hex digits perfectly represent 8 bits (00-FF), making #RRGGBB notation compact and intuitive. For example, #FF0000 is pure red (255 red, 0 green, 0 blue).
The 0x prefix is a programming convention indicating a hexadecimal number. For example, 0x10 means 16 in decimal (not 10). This prefix helps compilers and interpreters distinguish hex from decimal numbers. Some languages use other prefixes like &H or $.
One hexadecimal digit can represent 16 different values (0-15 in decimal). This is exactly 4 bits of information (2⁴=16), which is why hex is so efficient for representing binary data. Two hex digits represent a byte (256 values, 0-255).
No, hexadecimal is not case-sensitive. 'FF' and 'ff' both represent 255 in decimal. However, convention varies: programmers often use uppercase (0xFF), while web colors typically use lowercase (#ffffff). Choose a consistent style for readability.