Skip to content

What is a hexadecimal number in decimal?

Turn a hex number such as FF or 1A3 into an ordinary decimal number.

In decimal

255

2 digits in base 16

The same number in other bases

In binary
11111111
In octal
377
In hexadecimal
ff

Turn a hex number such as FF or 1A3 into an ordinary decimal number.

How to use

  1. Type the hexadecimal number, with or without a 0x in front. Letters can be upper or lower case.
  2. Leave the target on decimal and read the number.
  3. Use the same field to check a colour code or a memory address piece by piece.

Hexadecimal to decimal

HexDecimal
99
A10
F15
1016
1F31
7F127
80128
FF255
100256
FFF4095
FFFF65535

FF, one full byte, is 255.

How it works

Hex digits run from 0 to 9 and then A to F for ten to fifteen. Each place is worth 16 times the one to its right, so a three-digit hex number has places worth 256, 16 and 1.

For 1F4 that means 1 × 256 + 15 × 16 + 4 × 1, which is 500. The letter F counts as fifteen, so it is the largest single digit.

Hex turns up wherever bytes are written out: colour codes such as #FF8800, memory addresses, error codes and MAC addresses. Two hex digits are one byte, so a pair always lies between 0 and 255.

Another example: 3A7 is 3 × 256 + 10 × 16 + 7 × 1, which is 935. A colour such as #FF8800 is three pairs: FF is 255, 88 is 136 and 00 is 0. Four hex digits cover 0 to 65,535. Programmers often write hex with a 0x prefix, as in 0x1F4, to show that the digits are not decimal.

Worked example

What is the hexadecimal number 1F4 in decimal?

  1. Its digits are worth 1, 15 and 4 (F is fifteen), in places of 256, 16 and 1.
  2. 1 × 256 + 15 × 16 + 4 × 1 = 500

1F4 in hexadecimal is 500 in decimal.

Method

No outside data is used: the result is worked out directly from the formula explained under How it works.

Sources and methods

Frequently asked questions

What is FF in decimal?

255: F is fifteen, and 15 × 16 + 15 = 255. It is the largest value one byte can hold.

What do the two hex digits of a colour mean?

Each pair is one colour channel (red, green or blue) from 00 to FF, that is 0 to 255 in decimal.

Is 0x10 sixteen or ten?

Sixteen. The 0x prefix says the digits are hexadecimal, and 10 in hex is 1 × 16 + 0.

How many values can four hex digits hold?

65,536, from 0000 to FFFF, which is 0 to 65,535 in decimal. Each hex digit holds 16 values, and 16 × 16 × 16 × 16 is 65,536.

Send feedback