Skip to content

Hex to Decimal Converter

Type a hex number and get the decimal value as you type, with the binary and signed values too. Works with 0x, # and long numbers. Switch direction to go from decimal to hex.

7E4 = 7×256 + 14×16 + 4 = 2020

0x, # and h are fine. Separate several numbers with spaces or new lines.

Decimal
2020
Binary
11111100100

How to Convert Hex to Decimal

Hex (hexadecimal) counts in sixteens instead of tens. It uses the digits 0–9 and then the letters A–F for ten to fifteen. Each place is worth 16 times the place to its right, so to convert:

  1. Write down the value of each digit. A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
  2. Starting from the right, multiply the digits by 1, 16, 256, 4,096 and so on.
  3. Add the results. That's the decimal number.
What each hex place is worth
Place (from the right)WorthAs a power of 16
1st116⁰
2nd1616¹
3rd25616²
4th4,09616³
5th65,53616⁴
decimal = digit × 1 + digit × 16 + digit × 256 + … (reading from the right)

Worked Example: 7E4 to Decimal

Convert the hex number 7E4 to decimal.

Step 1: Write each digit's value

7 = 7 · E = 14 · 4 = 4

Step 2: Multiply by the place values, from the right

4 × 1 = 4 · 14 × 16 = 224 · 7 × 256 = 1,792

Step 3: Add them up

1,792 + 224 + 4 = 2,020

Result: 7E4 in hex = 2020 in decimal. The tool above opens with this number loaded.

Hex to Decimal Chart (00 to FF)

Every two-digit hex value. Find the first digit down the side and the second along the top: for example, row B, column 4 gives B4 = 180. FF = 255 is the largest two-digit value, which is why colour codes and bytes stop there.

Hex values 00 to FF and their decimal equivalents. Row is the first hex digit, column is the second.
First digit0123456789ABCDEF
00123456789101112131415
116171819202122232425262728293031
232333435363738394041424344454647
348495051525354555657585960616263
464656667686970717273747576777879
580818283848586878889909192939495
696979899100101102103104105106107108109110111
7112113114115116117118119120121122123124125126127
8128129130131132133134135136137138139140141142143
9144145146147148149150151152153154155156157158159
A160161162163164165166167168169170171172173174175
B176177178179180181182183184185186187188189190191
C192193194195196197198199200201202203204205206207
D208209210211212213214215216217218219220221222223
E224225226227228229230231232233234235236237238239
F240241242243244245246247248249250251252253254255

Bigger values worth knowing:

Common larger hex values in decimal
HexDecimal
100256
3E81,000
4001,024
FFF4,095
10004,096
271010,000
FFFF65,535
F42401,000,000
FFFFFF16,777,215

Where You See Hex Numbers

Most people meet hex in one of these places, and each one is read a little differently:

Common places hex numbers appear
WhereExampleIn decimal
Web and design color codes: each pair is one channel#FF8800255, 136, 0 (red, green, blue)
Windows error codes0x800700052,147,942,405, also shown as −2,147,024,891
Unicode characters and HTML codesU+00E9 (é)233, written é in HTML
Number literals in code0x1F4500

Don't convert a whole color code as one number: #FF8800 as a single number is 16,746,496, which isn't useful. Convert each pair instead, or use the HEX to RGB converter.

Why FF Can Mean 255 or −1

Read as an ordinary number, FF is 255. But computers often store negative numbers by counting back from the top of the range, so in a program that expects a signed byte, FF means −1. That is why the same Windows error code shows up as a large positive number in one place and a negative number in another. The tool shows both readings whenever a value has 2, 4, 8 or 16 digits and starts with 8 or higher.

Hex values read as ordinary and as signed numbers
HexOrdinary numberSigned number
7F (2 digits)127127
80 (2 digits)128−128
FF (2 digits)255−1
FFFF (4 digits)65,535−1
80070005 (8 digits)2,147,942,405−2,147,024,891

Hex to Decimal in Excel, Python and JavaScript

Converting hex to decimal in common tools
ToolHowResult for 7E4
Excel or Google Sheets=HEX2DEC("7E4")2020
Pythonint("7E4", 16)2020
JavaScriptparseInt("7E4", 16)2020
JavaScript (very long numbers)BigInt("0x7E4")2020n
Windows CalculatorProgrammer mode → HEX → type 7E4 → read DEC2020

Excel's HEX2DEC takes up to 10 hex digits and treats a 10-digit value starting with 8 or higher as negative, so =HEX2DEC("FFFFFFFFFF") gives −1. In JavaScript, parseInt starts losing accuracy past about 15 decimal digits; use BigInt for long values.

Frequently asked questions

What is FF in decimal?

FF is 15 × 16 + 15 = 255. It is the largest number two hex digits can hold, which is why it appears so often in colors and bytes.

What does the 0x in front of a hex number mean?

It just marks the number as hex, so 0x10 isn't mistaken for ten. 0x10 is 16. The tool ignores the 0x, as well as a # or a trailing h.

Does uppercase or lowercase matter?

No. 7e4 and 7E4 are the same number.

How do I convert hex to binary instead?

Swap each hex digit for its 4-bit pattern: 7E4 becomes 0111 1110 0100. The binary row in the tool shows it, or use the hex to binary converter for lists of values.

Sources