Decimal to Hex Converter

Convert any whole number to hexadecimal, with optional 0x prefix.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Decimal to hex — base-10 to base-16

Enter a whole number and this tool returns its hexadecimal (base 16) value in uppercase, with an optional 0x prefix, plus the binary and octal forms. Hex is everywhere in programming — colour codes, memory addresses, byte dumps and bitmasks — so a quick, accurate converter is a daily-driver tool.

How it works

Hexadecimal is base 16, using the symbols 0-9 then A-F (A=10 through F=15). Each hex digit encodes exactly four binary bits (a nibble), which is why hex is a compact stand-in for binary. To convert, the number is repeatedly divided by 16 and the remainders — mapped to 0-9 and A-F — are read in reverse. The tool outputs uppercase digits, optionally adds the C-style 0x prefix, and also shows the binary and octal equivalents. Inputs must be whole, non-negative integers up to 9,007,199,254,740,991.

Example

Convert 48879:

48879 ÷ 16 repeatedly → digits B, E, E, F → 0xBEEF

BaseValue
Decimal (10)48879
Hex (16)0xBEEF
Binary (2)1011111011101111
Octal (8)137357

It all runs in your browser — nothing is uploaded.

Ad placeholder (rectangle)