Convert decimal numbers to hexadecimal format using repeated division method. Essential for programming and web development.
Start with the decimal number you want to convert
Divide the number by 16 and record the quotient and remainder
Convert the remainder to its hexadecimal equivalent (0-9, A-F)
Continue dividing the quotient by 16 until you get 0
The hexadecimal equivalent is the remainders read in reverse order
65029 ÷ 16 = 4064 remainder 5 → 5
4064 ÷ 16 = 254 remainder 0 → 0
254 ÷ 16 = 15 remainder 14 → E
15 ÷ 16 = 0 remainder 15 → F
Reading remainders from bottom to top: FE05₁₆
hex(255) # Returns '0xff'
format(255, 'X') # Returns 'FF'
255.toString(16) // Returns 'ff'
255.toString(16).toUpperCase() // Returns 'FF'
Integer.toHexString(255) // Returns "ff"
String.format("%X", 255) // Returns "FF"
English