A byte: FF
FF
255
F × 16 + F × 1 is 15 × 16 + 15 = 240 + 15 = 255, the largest value one byte can hold.
Type a hexadecimal number and read its decimal value, with every step of the calculation shown underneath. It opens on FF, which is 255.
Last updated
Coddy teaches you by writing real code in your browser - interactive lessons, instant feedback, and AI help when you get stuck.
Hexadecimal is base 16. It uses the digits 0 to 9 and the letters A to F, where A is 10, B is 11 and so on up to F, which is 15. Each position is worth 16 times the one to its right: the rightmost digit counts ones, the next counts sixteens, then 256s, then 4096s.
To convert, take each digit's value, multiply it by its place value and add everything up. 2A is 2 × 16 + 10 × 1 = 42. 1F4 is 1 × 256 + 15 × 16 + 4 × 1 = 500. The panel under the converter writes out these lines for whatever you type.
The converter accepts upper or lower case and an optional 0x prefix, and it uses BigInt arithmetic, so values past 2⁵³ such as FFFFFFFFFFFFFFFF convert exactly.
00 is 0 and FF is 255.0x in front of a number, as in 0xFF, only marks it as hex. It is not part of the value.FF
255
F × 16 + F × 1 is 15 × 16 + 15 = 240 + 15 = 255, the largest value one byte can hold.
#1E90FF
rgb(30, 144, 255)
Each pair of digits is one color channel: 1E is 1 × 16 + 14 = 30, 90 is 9 × 16 = 144 and FF is 255.
1F4
500
1 × 256 + 15 × 16 + 4 × 1 = 256 + 240 + 4 = 500.
0x7FFF
32767
7 × 4096 + 15 × 256 + 15 × 16 + 15 = 32767, the largest signed 16-bit integer.
A is 10 and F is 15, and no single digit is worth more than 15.10 is sixteen, not ten.0x or # prefix in the arithmetic. Drop it before converting.10 is 1 × 16 + 0 = 16.int('FF', 16) returns 255. In JavaScript, parseInt('FF', 16) returns 255; for values above 2⁵³ use BigInt('0xFF') so nothing is rounded.