Skip to content

Hex to decimal converter

Math & numbers

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 read in base 16

The same number in other bases

In binary
11111111
In octal
377
In hexadecimal
ff

Sponsored Links

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

How to use

  1. Type the number. Digits above 9 are letters: A or a is ten, F is fifteen.
  2. Choose the base it is written in, then the base to convert to. 10 is the everyday decimal, 2 binary, 8 octal and 16 hexadecimal.
  3. Copy the result. The same number is also shown in the other common bases.

How it works

A base says how many digits a numbering system has, and each place is worth that many times the one to its right. In decimal the places are ones, tens, hundreds. In binary they are ones, twos, fours, eights. In hexadecimal, which has 16 digits (0–9 and A–F), they are ones, sixteens, 256s and so on. Computers use binary, and hexadecimal is a compact way to write it: one hex digit is exactly four binary digits.

To convert, add up each digit times the value of its place. For example hex FF is 15 × 16 + 15 = 255, which is 11111111 in binary and 377 in octal. Going the other way, divide by the new base again and again and read the remainders backwards (Knuth, The Art of Computer Programming, vol. 2, section 4.1).

This tool works with whole numbers of any size, so a 64-bit or even larger value stays exact, and accepts bases from 2 to 36, where the letters a to z are the digits ten to thirty-five. You can type spaces or underscores to group digits, a minus sign, and the usual 0x, 0b and 0o prefixes. Fractions are not converted.

Worked example

What is hexadecimal 2A in decimal?

  1. Its digits represent 2 × 16 + 10.

The decimal value is 42.

Sponsored Links

Sponsored Links

Sponsored Links