Decimal to Hex Converter

To convert decimal to hex, type the number in the Decimal box and the hexadecimal value appears at once, together with binary and octal. It works in every direction: type a hex value such as FF to get 255 in decimal. Very large whole numbers are converted exactly. To convert by hand, divide by 16 repeatedly and read the remainders from bottom to top.

How to use it

  1. Type a number in any box: decimal, hexadecimal, binary or octal.
  2. The other three boxes update as you type.
  3. Hex values may start with 0x; spaces and underscores are ignored.
  4. Copy the value you need.

How to convert decimal to hex by hand

Divide the decimal number by 16 and keep the remainder. Divide the result by 16 again, and repeat until the result is 0. Write the remainders as hex digits (10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F) and read them from the last one to the first.

StepDivisionResultRemainderHex digit
12024 ÷ 1612688
2126 ÷ 16714E
37 ÷ 16077

Reading the remainders from the bottom up gives 7E8, so 2024 in hex is 7E8. Check it the other way: 7 × 256 + 14 × 16 + 8 = 2024.

How to convert hex to decimal

Multiply each hex digit by a power of 16, starting with 16⁰ = 1 on the right, then 16¹ = 16, 16² = 256, 16³ = 4,096, and add the results. For 1A3: 1 × 256 + 10 × 16 + 3 × 1 = 419.

Decimal, hex, binary and octal side by side

DecimalHexBinaryOctal
0000
99100111
10A101012
15F111117
16101000020
100641100100144
255FF11111111377
256100100000000400
1,0003E811111010001750
65,535FFFF1111111111111111177777

Why programmers use hexadecimal

One hex digit is exactly four binary digits, so hex is a short, readable way to write binary values: a byte is always two hex digits and a 32-bit number eight. That is why hex appears in memory addresses, colour codes such as #1C1B19, error codes, MAC addresses and Unicode code points such as U+00E9.

To turn bytes of text into hex or binary, use the hex to text converter or the binary translator.

Frequently asked questions

How do I convert decimal to hexadecimal?

Type the number in the Decimal box. By hand, divide the number by 16, write down the remainder, divide the result by 16 again, and repeat until you reach 0; the remainders read from the last to the first are the hex digits (10–15 are written A–F).

How do I convert hex to decimal?

Type the hex value in the Hexadecimal box. By hand, multiply each digit by 16 to the power of its position, counting from 0 on the right, and add them up: 2F = 2 × 16 + 15 = 47.

What is 255 in hex?

255 is FF in hexadecimal, 11111111 in binary and 377 in octal. It is the largest value that fits in one byte.

What is A in hexadecimal?

A stands for 10. Hexadecimal uses A, B, C, D, E and F for the values 10 to 15, because a single digit has to represent each of the 16 values.

How do I convert binary to hex?

Type the binary number in the Binary box. By hand, split it into groups of four digits from the right and replace each group with one hex digit: 1010 1111 is AF.

Can it convert negative numbers or fractions?

No, the converter works with whole numbers of zero or more, which covers addresses, colours, IDs and byte values. It handles very large integers exactly.

Last updated · Built and checked by Moeed Hussain

Related tools