>_

Hex to Decimal

Type a hexadecimal number below to get the decimal value — other bases are shown too. The manual method is explained further down.

Try it

Custom base

Two’s complement

How to convert by hand

Multiply each digit by 16 raised to its position, counting from 0 on the right:
FF = F×16^1 + F×16^0
= 15×16 + 15×1
= 255

Reference table

Hex → Decimal

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A 10
B 11
C 12
D 13
E 14
F 15
10 16
20 32
40 64
64 100
7F 127
80 128
FF 255
100 256
3E8 1000
400 1024
1000 4096
FFFF 65535

In code

JavaScript

parseInt('FF', 16) // 255

Python

int('FF', 16)  # 255

More examples

Open the full Number Base Converter →