Developer Bases
Decimal to hex
Decimal value
Hexadecimal FF
Divide by 16, keep the remainders
The same number elsewhere
Decimal 255
Binary 11111111
Binary, grouped 1111 1111
Octal 377
Bits needed 8
Note
Divide by 16, read remainders backwards
The same number in each base
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Advertisement
320 × 100
To convert decimal to hexadecimal, divide repeatedly by 16 and read the remainders backwards. 255 gives 15 remainder 15, which is F and F — so FF. Values 10 to 15 are written A to F.
How to convert decimal to hex
1 Enter the decimal number.
2 Read the hexadecimal result.
3 Compare against the binary and octal forms.
4 Prefix with 0x if you are pasting it into code.
The repeated-division method works for any base and is worth understanding rather than memorising. Divide by the target base, note the remainder, divide the quotient again, and continue until the quotient is zero — then read the remainders bottom to top. It is the same procedure whether you are going to base 2, 8, 16 or 36; only the divisor changes.
Questions
FF. It is the maximum value of one byte.
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING