255₁₀ → hex — number base conversion
corethe byte boundary
Answer
FF
Why this example is worth doing
Two hundred and fifty-five is the largest unsigned eight-bit value, and it is FF in hex and 1111 1111 in binary — three ways of writing an all-ones byte. The page uses it to anchor the boundary values a student should recognise on sight: FF, 7F as the largest signed byte, 80 as the most negative, and 100 as the first value that does not fit. Recognising these saves time in every later exercise.
Try your own input in the Binary ⇄ decimal ⇄ hex ⇄ octal. Convert between any two bases, integers and fractions, with the positional working.
How the answer is reached
Base 10 to base 16
Convert 255 from base 10 to base 16. The sign is carried across unchanged; only the magnitude is converted.
| digit | value | weight | weight (base 10) | digit x weight |
|---|---|---|---|---|
| 2 | 2 | 10^2 | 100 | 200 |
| 5 | 5 | 10^1 | 10 | 50 |
| 5 | 5 | 10^0 | 1 | 5 |
| total | 255 |
Integer part: divide by 16 and read the remainders bottom to top.
| n | divide by | quotient | remainder |
|---|---|---|---|
| 255 | 255 ÷ 16 | 15 | F |
| 15 | 15 ÷ 16 | 0 | F |
255 (base 10)FF (base 16)