Decimal to Hex Converter

Type a decimal number to see it in hexadecimal, and in the other number bases.

Enter the number

Result

Hexadecimal (base 16)
FF
The same number in every base
BaseValue
Binary (base 2)1111 1111
Octal (base 8)377
Decimal (base 10)255
Hexadecimal (base 16)FF

How to use it

  1. Type the number (spaces and prefixes such as 0x are fine).
  2. Check the From and To bases, or change them.
  3. Read the result, and the same number in every base in the table.

About this tool

To convert decimal to hexadecimal, divide by 16 repeatedly and write the remainders, using A to F for 10 to 15. Read the remainders from last to first. For 255: 255÷16=15 r15, 15÷16=0 r15, which reads FF.

Two hex digits cover one byte (0 to 255), which is why colors and byte values are written in hex.

Formula

  • Divide by 16 repeatedly and collect the remainders from bottom to top, using A–F for 10–15.

Examples

  • Decimal 10 = A (hexadecimal)
  • Decimal 255 = FF (hexadecimal)
  • Decimal 4095 = FFF (hexadecimal)
  • Decimal 65535 = FFFF (hexadecimal)

Tips

  • For a web color, convert each of the red, green and blue values (0 to 255) to two hex digits.
  • Very long numbers are handled exactly, up to 200 digits.
  • Negative numbers are accepted with a minus sign.

Questions and answers

How do I convert decimal to hexadecimal?

Divide by 16 repeatedly and collect the remainders from bottom to top, using A–F for 10–15.

What is 255 in hexadecimal?

255 in decimal is FF in hexadecimal.

Can I use lowercase letters or a prefix?

Yes. Lowercase letters work, and prefixes such as 0b, 0o and 0x are accepted.

Are my numbers saved or sent anywhere?

No. The conversion runs in your browser on your own device. Nothing you type is sent to Paul Digital or any other server.

More tools

Privacy

The conversion runs in your browser on your own device. Nothing you type is sent to Paul Digital or any other server. Very long numbers are handled exactly.