Decimal to Hex Converter
Type a decimal number to get its hexadecimal value, with the repeated-division method shown step by step.
- Binary · Octal · Decimal · Hex
- Step-by-step working
- Two’s complement
- Big numbers
What is a decimal to hex converter?
Decimal to hex conversion rewrites a base-10 number in base 16. The usual method divides the number by 16 repeatedly, keeping each remainder (10–15 written as A–F), then reads the remainders from last to first. This converter does it instantly for numbers of any size, shows each division with your number, and can show negative numbers as two’s complement hex for 8, 16, 32 or 64-bit integers.
How to convert decimal to hex
- Type a decimal number in the Decimal box. Prefixes, spaces and underscores are ignored.
- Read the hex result instantly. Binary, octal, decimal, hex and a custom base update together.
- Scroll to “How to convert decimal to hex” for the step-by-step working with your number.
- For negative numbers, tick Signed and choose a bit width to see the two’s complement form. Then copy any result.
Number base cheat sheet
- Binary (base 2) uses 0–1, octal (base 8) uses 0–7, decimal (base 10) uses 0–9 and hexadecimal (base 16) uses 0–9 then A–F for 10–15.
- One hex digit is exactly 4 bits (a nibble), so hex and binary convert digit by digit: F = 1111, A = 1010.
- Common prefixes: 0b for binary, 0o for octal and 0x for hex. They are optional here.
- In two’s complement, the top bit is the sign: 1111 1111 is −1 as a signed 8-bit number but 255 unsigned.
Why use this decimal to hex converter
- Converts as you typeNo Convert button: edit either side and the other updates immediately.
- Shows the workingStep-by-step place values or repeated division for the conversion you choose, ideal for homework and exams.
- Any size, signed or unsignedArbitrary-precision integers, plus two’s complement for 8, 16, 32 and 64-bit values.
- Private by designEverything is calculated in your browser. Nothing you type is sent to a server or saved.
Common uses
- Web colours. Turn RGB 255, 136, 0 into FF 88 00.
- Programming. Write constants and bit masks in hex.
- Unicode. Find the hex code point of a character number.
- Exams. Practise the division method with instant checking.
Related converters: number base converter, hex to decimal, binary to decimal, decimal to binary, hex to binary, binary to hex, binary calculator, hex calculator. Browse all encoding tools.
Example: decimal to hex
687 ÷ 16 = 42 remainder 15 (F) 42 ÷ 16 = 2 remainder 10 (A) 2 ÷ 16 = 0 remainder 2 Read upwards: 2AF
What to expect from the result
Whole numbers only: fractional values such as 0.1 are not converted. Very long numbers are converted exactly, but the step-by-step working is shown only for numbers up to 24 digits.
Decimal to Hex Converter questions
How do you convert decimal to hex?
Divide by 16 and note the remainder, then divide the quotient by 16 again until it reaches 0. Write the remainders in reverse order, using A–F for 10–15.
What is 255 in hex?
FF. 255 ÷ 16 = 15 remainder 15, and 15 is F.
What is 1000 in hex?
3E8: 3×256 + 14×16 + 8 = 1000.
How do I convert a negative decimal to hex?
Tick Signed and choose a bit width. −1 is FF in 8 bits, FFFF in 16 bits and FFFFFFFF in 32 bits.
How do I convert decimal to hex in Excel?
Use =DEC2HEX(687). It returns 2AF. This tool also shows the working.