Ekuation

conversion

Decimal to Hexadecimal Converter

Convert decimal numbers to hex. Shows each division step with remainders mapped to hex digits 0-F.

Back to Number Base Converter

Enter a decimal number (digits 0-9).

Maximum fractional digits for non-terminating expansions.

Number Base Conversion Tips

Click to show tips

Try an Example

Pick a scenario to see how the calculator works, then adjust the values

ASCII Letter A

Convert the ASCII code for uppercase A (65) across all bases.

Key values: Decimal 65 · Binary 1000001 · Hex 41

Byte Maximum

The largest value a single byte can hold (255).

Key values: Decimal 255 · Binary 11111111 · Hex FF

Hex Color Code

Convert a common hex color code (deep sky blue) to other bases.

Key values: Hex 00BFFF · Decimal 49151 · Binary nibbles

Documentation

The Division Method

Repeatedly divide the decimal number by 16 and record the remainders. Convert remainders 10–15 to letters A–F. Read the remainders bottom to top:

687÷16=42 R 15  (F)42÷16=2 R 10  (A)2÷16=0 R 2\begin{aligned} 687 \div 16 &= 42 \text{ R } \mathbf{15} \;(F) \\ 42 \div 16 &= 2 \text{ R } \mathbf{10} \;(A) \\ 2 \div 16 &= 0 \text{ R } \mathbf{2} \end{aligned}

Reading bottom-to-top: 68710=2AF16687_{10} = \text{2AF}_{16}.


Converting Larger Numbers

Convert 1,000,000101,000,000_{10} to hex:

1000000÷16=62500 R 062500÷16=3906 R 43906÷16=244 R 2244÷16=15 R 415÷16=0 R 15  (F)\begin{aligned} 1000000 \div 16 &= 62500 \text{ R } 0 \\ 62500 \div 16 &= 3906 \text{ R } 4 \\ 3906 \div 16 &= 244 \text{ R } 2 \\ 244 \div 16 &= 15 \text{ R } 4 \\ 15 \div 16 &= 0 \text{ R } 15\;(F) \end{aligned}

Result: 1,000,00010=F4240161{,}000{,}000_{10} = \text{F4240}_{16}.


The Binary Shortcut

If you already know the binary representation, group the bits into sets of 4 from right to left and convert each group to a hex digit:

68710=10  1010  11112102  1010A  1111F=2AF16687_{10} = 10\;1010\;1111_2 \to \underbrace{10}_{2}\;\underbrace{1010}_{A}\;\underbrace{1111}_{F} = \text{2AF}_{16}

This works because 16=2416 = 2^4 — each hex digit corresponds to exactly 4 binary digits (one nibble). This is why hex is the standard shorthand for binary in programming.


Hex in Memory Addresses

Memory addresses are displayed in hex because they are inherently binary values, and hex provides a compact, readable form:

  • 32-bit address 0xFFFFFFFF = 4,294,967,295 — much shorter than the binary form (32 digits)
  • 64-bit address 0x00007FFE12345678 — 16 hex digits vs 64 binary digits
  • Memory alignment is visible: addresses ending in 0 or 00 are naturally aligned to 16-byte or 256-byte boundaries

Frequently Asked Questions

How do you convert decimal to hexadecimal?

Repeatedly divide by 16 and record the remainders. Convert remainders 10–15 to letters A–F. Read the remainders bottom to top. For example, 687÷16=42687 \div 16 = 42 R 15(F), 42÷16=242 \div 16 = 2 R 10(A), 2÷16=02 \div 16 = 0 R 2, giving 2AF.

Is there a shortcut for decimal-to-hex conversion?

Yes. If you know the binary representation, group the bits into sets of 4 from right to left and convert each group to one hex digit. This works because 16=2416 = 2^4, so each hex digit corresponds to exactly 4 bits (one nibble).

Why is hexadecimal used for memory addresses?

Memory addresses are binary values, and hex provides a compact, readable form. A 32-bit address like 0xFFFFFFFF is just 8 characters versus 32 binary digits. Alignment is also visible: addresses ending in 0 or 00 are naturally aligned.

How do I convert RGB color values to hex?

Convert each RGB channel (0–255) to a two-digit hex value and concatenate them. For example, RGB(255, 87, 51) becomes FF (255), 57 (87), 33 (51), giving the hex color #FF5733.

What is a nibble and why is it important for hex conversion?

A nibble is a group of 4 binary digits (bits), representing values 0–15. Since 16=2416 = 2^4, one hex digit maps to exactly one nibble. Two nibbles make one byte (8 bits). This 4-bit alignment is why hex is the standard shorthand for binary in computing.

Related conversion Variants

Explore more conversion options

More Math Calculators

Explore the category

Calculator Search

Search and find calculators