Decimal to Hex Calculator
Enter a decimal integer to convert it to hexadecimal.
How to Convert Decimal to Hex
Method: repeated division by 16
- Divide the number by 16. Note the remainder (0�15 → 0�9, A�F).
- Repeat with the quotient until it reaches 0.
- Read remainders from bottom to top — that is the hex result.
Example: 255 → 15 R15(F) → 0 R15(F) → FF
Quick reference
| Decimal | Hex | Binary |
|---|---|---|
| 10 | A | 1010 |
| 16 | 10 | 10000 |
| 32 | 20 | 100000 |
| 255 | FF | 11111111 |
| 256 | 100 | 100000000 |
Related Calculators
How to Convert Decimal to Hexadecimal
Divide the decimal number by 16 repeatedly, recording the remainders. Remainders 10–15 are written as letters A–F. Read the remainders from bottom to top for the hex result. For example, converting 255: 255÷16=15 r15(F), 15÷16=0 r15(F) → reading bottom-up: FF. This is why #FFFFFF is white in CSS (all colour channels at maximum). Hex is the standard for colour codes, memory addresses, and network packet headers.
Decimal to Hex Reference Table
| Decimal | Hex | Decimal | Hex |
|---|---|---|---|
| 10 | A | 100 | 64 |
| 16 | 10 | 255 | FF |
| 32 | 20 | 256 | 100 |
| 64 | 40 | 1000 | 3E8 |
Converting Decimal to Hexadecimal
Hexadecimal (base-16) uses digits 0–9 and letters A–F, where A=10, B=11, C=12, D=13, E=14, F=15. To convert decimal to hex, repeatedly divide by 16 and record the remainders, reading upward. For decimal 255: 255÷16=15 R15 (F), 15÷16=0 R15 (F) → FF. Each hex digit encodes exactly 4 binary bits, making hex a compact notation for binary data.
Hex is ubiquitous in computing: HTML/CSS colors are 6-digit hex codes (#1A2B3C), memory addresses are displayed in hex, error codes in Windows and Linux use hex, and network MAC addresses use hex pairs. Knowing how to convert decimals to hex lets you read debugger outputs, understand color pickers, and work with low-level protocols and hardware registers.
Decimal to Hex Reference
| Decimal | Hex | Common Usage |
|---|---|---|
| 0 | 00 | Null / black |
| 10 | 0A | |
| 15 | 0F | |
| 16 | 10 | Page size |
| 31 | 1F | |
| 32 | 20 | Space (ASCII) |
| 64 | 40 | |
| 127 | 7F | DEL (ASCII) |
| 128 | 80 | |
| 255 | FF | Max byte / white |
Why Hexadecimal Matters in Computing
Hexadecimal (base 16) is the most widely used compact number system in computing because it aligns perfectly with binary. Each hexadecimal digit corresponds to exactly four binary bits (a nibble), making conversion between the two systems effortless and error-free compared to converting between decimal and binary directly. Hexadecimal uses the digits 0 through 9 and the letters A through F to represent values 10 through 15 in a single character. This compactness is invaluable when reading memory addresses, color values in HTML and CSS (where #FF5733 encodes red, green, and blue channel intensities), MAC addresses in networking, and machine code in disassemblers. To convert a decimal number to hexadecimal manually, repeatedly divide by 16, recording each remainder as a hex digit (using A-F for remainders 10-15), and read the remainders from last to first. For example, 255 divided by 16 gives quotient 15 remainder 15, and 15 divided by 16 gives quotient 0 remainder 15. Reading bottom to top: FF in hexadecimal, which represents the maximum single-byte value. This method extends to any decimal integer, no matter how large.
Decimal to Hexadecimal Reference Table
| Decimal | Hexadecimal | Decimal | Hexadecimal |
|---|---|---|---|
| 0 | 0 | 8 | 8 |
| 1 | 1 | 10 | A |
| 4 | 4 | 12 | C |
| 5 | 5 | 15 | F |
| 16 | 10 | 32 | 20 |
| 100 | 64 | 255 | FF |
| 256 | 100 | 65535 | FFFF |
