Decimal to Hex Converter

Exact decimal to hexadecimal conversion with the divisions shown

Hexadecimal

Everything happens in your browser: your text is never sent anywhere.

How to convert decimal to hex

Step 1

Type or paste decimal numbers, one per line

Step 2

Choose lowercase letters, the 0x prefix or groups of digits

Step 3

Copy or download the hex numbers

How decimal numbers become hex

To write a decimal number in hexadecimal, divide it by 16 again and again until nothing is left: the remainders are the hex digits, read from the last one to the first, with 10 to 15 written as A to F. For 255 that is 255 ÷ 16 = 15, remainder 15, then 15 ÷ 16 = 0, remainder 15, so 255 is FF. The converter does this for every number you type, one per line, and shows the divisions for the first one under the result. It is exact for numbers of any length, so 18446744073709551615, the largest 64-bit value, gives FFFFFFFFFFFFFFFF, and negative numbers keep their minus sign.

Fractions are converted too, by multiplying the part after the point by 16: 10.625 is A.A. Many decimal fractions never end in hex, such as 0.1, which is 0.1(9): the digits in brackets repeat forever, and the converter shows them that way instead of rounding. Tick “Lowercase letters” for ff instead of FF, “Prefix 0b, 0o or 0x” for 0xFF as in program code, and “Group digits” to split long results into groups of four. With “From” and “To” you can also convert to binary, octal or any base from 2 to 36, and “Swap” turns the hex results back into decimal.

Was AnyTextEditor useful to you?

Hello. We tried very hard to create a convenient website that we use ourselves. If you liked any of our tools and editors, add it to your bookmarks, because it will be useful to you more than once. And don't forget to share on social media. We will be better for you.