Hexadecimal to Decimal

Convert hexadecimal to decimal (hex to decimal) as you type, with every step shown. This free online converter gives exact results for numbers of any size, and nothing you type leaves your browser.

1 Enter your value

From
To

Examples

2 Your answer

Decimal

419dec

Show in other bases

Tap any value to copy it.

See the working

Guide

How it works

Three steps, whether you are reading a memory address, a bit flag or a byte value.

  1. 1

    Choose what to convert

    Pick what you have and what you want: decimal, hexadecimal, binary or octal.

  2. 2

    Type or paste a value

    Write it however you like: 65,535, 0xFF, FFh, with commas, spaces or underscores.

  3. 3

    Read the answer

    It appears as you type, in every other base, with the working shown.

The formulas

A digit's value depends on its position. Every answer here uses one of these rules:

Hexadecimal to decimal

decimal = Σ digit × 16position

0x1A3 is 1 × 256 + 10 × 16 + 3 × 1 = 419, so the answer checks out.

Decimal to hexadecimal

divide by 16, keep the remainders

419 ÷ 16 = 26 r 3, 26 ÷ 16 = 1 r 10 (A), 1 ÷ 16 = 0 r 1, so 419 is 0x1A3.

Hexadecimal to binary

each hexadecimal digit = 4 binary bits

0x1A3 is 1 → 0001, A → 1010, 3 → 0011, so 0x1A3 is 0001 1010 0011.

Decimal to hexadecimal digit chart

The decimal values 0 to 15 are the single hexadecimal digits 0 to F. Click one to add it to the converter.

All conversions

Decimal, hexadecimal, binary and octal converter

One free tool for every direction. Use it as a decimal to hexadecimal converter, convert decimal to binary or octal, or work backwards as a hexadecimal to decimal converter that turns 0x to decimal values. It also converts hexadecimal to binary, binary to hexadecimal and octal to decimal, so it works as a full number base converter and hexadecimal calculator. Pick a conversion to start.

Method

How to convert hexadecimal to decimal

To convert hexadecimal to decimal, number the digits from the right, starting at 0. Multiply each digit by 16 raised to the power of its position.

Add the results together to get the decimal number. Remember that A to F stand for 10 to 15.

Worked example

0x1A3 = 1 × 16² + 10 × 16¹ + 3 × 16⁰
= 256 + 160 + 3
= 419

Hexadecimal to Decimal conversion table

Use this hexadecimal to decimal table as a quick hexadecimal to decimal chart for common values, from 0 to 65,535.

HexadecimalDecimal
00
11
22
33
44
55
66
77
88
99
A10
B11
C12
D13
E14
F15
1016
2032
4064
64100
7F127
80128
FF255
100256
200512
3E81,000
4001,024
10004,096
FFFF65,535

Help

Questions

Quick answers to what people most often ask about hexadecimal, decimal and binary.

01How do I convert hexadecimal to decimal?

To convert hexadecimal to decimal, number the digits from the right, starting at 0. Multiply each digit by 16 raised to the power of its position. Add the results together to get the decimal number. Remember that A to F stand for 10 to 15.

02What is FF in decimal?

0xFF in hexadecimal is 255 in decimal. Type FF into the converter above to see every step.

03What is 400 in decimal?

0x400 in hexadecimal is 1,024 in decimal.

04What is 10 in decimal?

0x10 in hexadecimal is 16 in decimal. That is why 0x10 means sixteen, not ten.

05What is FFFF in decimal?

0xFFFF in hexadecimal is 65,535 in decimal. It is the largest unsigned 16-bit number.

06What is 7FFFFFFF in decimal?

0x7FFFFFFF in hexadecimal is 2,147,483,647 in decimal. It is the largest signed 32-bit integer.

07Why does hexadecimal use the letters A to F?

Base 16 needs sixteen single-digit symbols, but there are only ten digits, 0 to 9. The letters A to F stand for 10 to 15, so A = 10 and F = 15, and 0xFF is 15 × 16 + 15 = 255.

08How do I convert hexadecimal to decimal in Excel?

Use the HEX2DEC function: =HEX2DEC("FF") returns 255. It works the same way in Google Sheets. These functions only handle up to 10 input characters, and the binary ones only −512 to 511, so use this converter for larger numbers.

09How do I convert hexadecimal to decimal in Python or JavaScript?

In Python, int('FF', 16) returns 255. In JavaScript, parseInt('FF', 16) returns 255. Python handles any size; in JavaScript use BigInt for numbers above 2⁵³.

10Does the converter use two’s complement for negative numbers?

No. It keeps the minus sign, so −255 is −0xFF, −0b11111111 and −0o377. Computers usually store negative numbers in two’s complement, where the pattern depends on the width: −1 is 1111 1111 (0xFF) in 8 bits and 0xFFFF in 16 bits. To read a signed value whose top bit is set, subtract 2ⁿ: 0xFF as a signed 8-bit number is 255 − 256 = −1.

11Can I convert hexadecimal numbers with a fractional part?

The converter works with whole numbers. By hand, convert the fractional part by multiplying it by the target base again and again and keeping the whole-number part each time. For example, 0.5 × 16 = 8, so 0.5 is 0x0.8 in hexadecimal, 0b0.1 in binary and 0o0.4 in octal.

12How many hexadecimal digits are in a byte?

Two. One hexadecimal digit is 4 bits, so a byte (8 bits) is two digits, from 00 to FF (0 to 255). A 16-bit number is 4 digits, a 32-bit number is 8 and a 64-bit number is 16.

13How do I convert a hex colour code to RGB?

Split the six digits into three pairs and convert each pair to decimal: #FF8000 is FF = 255 red, 80 = 128 green and 00 = 0 blue, so it is rgb(255, 128, 0).

14Is there a limit to how big a hexadecimal number can be?

No. The converter uses exact whole-number arithmetic, so 64-bit, 128-bit and longer hexadecimal values convert to decimal with every digit correct, with no rounding.

15What does “hex to dec” mean?

“hex to dec” is short for hexadecimal to decimal, which means going from base 16 to base 10: a number written in base 16 is rewritten in base 10. For example, 0xFF becomes 255.

16Does this hexadecimal to decimal calculator show the working?

Yes. It converts hexadecimal to decimal with steps: open “See the working” under the answer to see each digit multiplied by its power of 16. Every answer is also shown in decimal, hexadecimal, binary and octal at once.

17Is this hexadecimal to decimal converter free?

Yes. It is free with no sign-up, works online on phones, tablets and computers, and every hexadecimal to decimal conversion runs in your browser, so nothing you type is sent anywhere.