Loading Calculator...
Please wait a moment
Please wait a moment
Convert decimal numbers (base-10) to hexadecimal (base-16) instantly. Perfect for web colors, memory addresses, and low-level programming.
| Decimal | Hexadecimal |
|---|---|
| 0 | 0x0 |
| 10 | 0xA |
| 15 | 0xF |
| 16 | 0x10 |
| 31 | 0x1F |
| 32 | 0x20 |
| 100 | 0x64 |
| 128 | 0x80 |
| 255 | 0xFF |
| 256 | 0x100 |
| 512 | 0x200 |
| 1000 | 0x3E8 |
| 4095 | 0xFFF |
| 65535 | 0xFFFF |
Hexadecimal (hex) is a base-16 number system using digits 0-9 and letters A-F (where A=10, B=11, C=12, D=13, E=14, F=15). It's widely used in computing because one hex digit represents exactly 4 bits, making it a compact representation of binary data.
Divide the decimal number by 16 repeatedly and record the remainder. Continue until the quotient is 0. Convert remainders 10-15 to letters A-F. The hexadecimal number is the remainders read from bottom to top.
Example: Convert 254 to hexadecimal
254 ÷ 16 = 15 remainder 14 (E)
15 ÷ 16 = 0 remainder 15 (F)
Result: FE (reading remainders from bottom to top)
Hexadecimal provides a more compact representation of binary data than decimal. One hex digit equals exactly 4 bits, making it easier to work with computer memory, which operates in binary. Two hex digits represent a byte (8 bits), which is more intuitive than the 3-digit decimal equivalent (0-255).
Divide 255 by 16: quotient is 15 (F in hex), remainder is 15 (F in hex). Since the quotient equals its hex representation, the result is FF. This is why 255 is often seen in computing - it's the maximum value for a byte (8 bits = 2 hex digits).
The 0x prefix indicates a hexadecimal literal in most programming languages (C, C++, JavaScript, Python, etc.). For example, 0xFF equals 255 in decimal. This prefix prevents confusion between hex and decimal numbers in source code.
Hex color codes use the format #RRGGBB, where RR (red), GG (green), and BB (blue) are each two hex digits (00-FF or 0-255 in decimal). For example, #FF0000 is pure red (255 red, 0 green, 0 blue), and #FFFFFF is white (maximum values for all channels).
Yes, hexadecimal can represent fractions using a hexadecimal point (similar to decimal point). For example, 0.8 in hex equals 0.5 in decimal (8/16 = 0.5). Hex fractions are used in some programming contexts and floating-point representations, though they're less common than integer hex values.