Hex to Decimal Converter

9×16¹16=144
C×16⁰1=12
total=156

Show the working for decimal → hex

Going the other way? Convert decimal back to hex →

How do you convert hex to decimal?

Hex to decimal conversion gives each digit the weight of its position, multiplies the digit by that weight, and adds the products together.

In short

Hex 9C is decimal 156. Multiply each hex digit by its power of 16 from the right, with A to F worth 10 to 15, and add the products: 9 × 16 + 12 × 1 = 156.

  1. Number the positions from the right, starting at 0.
  2. Give each position the weight 16ⁿ, so the rightmost digit is worth 1.
  3. Multiply every digit by its weight and add the products.
  4. The total is the decimal value: 9C = 156.

Hex to decimal is positional expansion with powers of 16; the number base converter takes any of the four bases and explains that method alongside repeated division.

Hexadecimal to Decimal Conversion Table

One hexadecimal digit equals exactly 4 bits (16 = 2⁴); one octal digit equals exactly 3 bits (8 = 2³). Hex and octal are therefore converted by grouping bits, and hex ↔ octal passes through binary. That is the whole method, so the table below is the only thing you need: every group of 4 bits has exactly one hex digit, and the mapping never changes. Binary writes values on the digit set 0, 1 with each place worth 2ⁿ, and a value marked 0b is binary; hex values are marked 0x.

Hexadecimal to Decimal Conversion Table
4 bitsHexDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

Each base is defined by three things: which digits it uses, how a value is marked, and what each position is worth.

Base reference
BaseRadixDigits PrefixPlace worthTypical range
Hexadecimal160–9, A–F (A=10 … F=15; case-insensitive) 0x16ⁿ2 digits cover a byte (00–FF); 6 digits = RGB colour; 8 digits = 32-bit word
Decimal100–9 none10ⁿany; decimal pages treat 0–255 as the byte range

Worked Example: 9C to Decimal

One value, converted the long way so the working is visible. This is the same grid the converter shows when you turn on "show steps".

9×16¹16=144
C×16⁰1=12
total=156

Result: 9C = 156

Number the positions from the right, starting at 0. Each position is worth 16 raised to that number, so the rightmost digit is worth 1, the next 16, the next 256, and so on up the value.

That turns 9C into 9 x 16^1 + C x 16^0, which adds up to 156. Digits that are 0 contribute nothing and can be skipped, but the position still counts — dropping a zero shifts every digit to its left and changes the value. This is the same expansion decimal itself uses; only the base in the weights differs.

Check it in reverse

The value returns unchanged. Convert 156 back and you get 9C, because a base change rewrites the digits without touching the quantity they stand for. That is the whole test: if the round trip differs, a digit was misread. To check it by hand, convert the decimal result back to hex and compare it with the number you started from.

Worked examples: hex to decimal

Each example gives the value first, then the working. Click a value to load it in the converter.

What is 0xFF in decimal?

0xFF in hexadecimal is 255 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x9C in decimal?

0x9C in hexadecimal is 156 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x2F in decimal?

0x2F in hexadecimal is 47 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0xA in decimal?

0xA in hexadecimal is 10 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x64 in decimal?

0x64 in hexadecimal is 100 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x8 in decimal?

0x8 in hexadecimal is 8 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x10 in decimal?

0x10 in hexadecimal is 16 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x20 in decimal?

0x20 in hexadecimal is 32 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x40 in decimal?

0x40 in hexadecimal is 64 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x80 in decimal?

0x80 in hexadecimal is 128 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0xC in decimal?

0xC in hexadecimal is 12 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0xF in decimal?

0xF in hexadecimal is 15 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x14 in decimal?

0x14 in hexadecimal is 20 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x19 in decimal?

0x19 in hexadecimal is 25 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x32 in decimal?

0x32 in hexadecimal is 50 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0xC8 in decimal?

0xC8 in hexadecimal is 200 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x3E8 in decimal?

0x3E8 in hexadecimal is 1000 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x5 in decimal?

0x5 in hexadecimal is 5 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x7 in decimal?

0x7 in hexadecimal is 7 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

What is 0x9 in decimal?

0x9 in hexadecimal is 9 in decimal.

Method: multiply each digit by its place value and add the products.

Load this value in the converter

Every example above reverses exactly — divide the same value down to hex digits.

What About Padding, Fractions and Width?

Leading zeros and width

A number carries no leading zeros unless a width is fixed. 156 and 0156 are the same value, so the converter writes the short form. Fixed widths belong to bytes and registers, not to arithmetic. the number system conversion guide covers where width does matter.

Fractions and the point

Digits after a point convert by the same rule with negative powers, so the first place after the point is worth 1/10. Many fractions that end neatly in decimal repeat forever in binary, which is where rounding creeps in.

Negative values

A minus sign is kept in front of the digits: -9C converts to -156. Fixed-width binary encodes sign differently, using two's complement, and that is a separate rule from the base change itself.

How large a value can be

The method has no ceiling; each extra hexadecimal digit multiplies the range by 16. Practical limits come from the width a machine stores the value in, not from the conversion.

Hex to Decimal in Code

The same rule in one line. Both read the digits and return the decimal total.

Python: int('9C', 16)
JavaScript: parseInt('9C', 16)

Common Mistakes

  • Reading the remainders top to bottom. They come out in reverse, so the digits land backwards.
  • Using a digit the base does not have — an 8 in octal, or a 2 in binary. The value cannot be read at all.
  • Grouping bits from the left. Groups are counted from the right, and the leftmost group is the one that gets padded.
  • Treating the result as a character code. 41 is a number here, not the letter A.

Frequently Asked Questions

How do you convert a signed hex value to decimal?

Fix the width first, because the sign lives in the top bit. FB is 251 as an unsigned byte; read as 8-bit two's complement its top bit is set, so it is 251 − 256 = −5. This converter reads hex as unsigned, or keeps a minus sign you type in front.

What is endianness (big-endian vs little-endian)?

It is the order the bytes of a multi-byte value are stored in. Big-endian puts the most significant byte first, so 9C 01 reads as 9C01; little-endian puts it last, and the same two bytes read as 019C. This converter takes the digits in the order you type them.

Can you enter hex with a 0x or # prefix?

Yes. Both are stripped before the digits are read, so 0x9C, #9C and 9C all give 156. 0b marks binary, 0o octal, 0x hexadecimal; a leading # marks a hex colour. Hexadecimal is not case-sensitive (FF = ff); iToolHub writes hex digits in uppercase.

What are A to F worth in hexadecimal?

A is 10, B is 11, C is 12, D is 13, E is 14 and F is 15; the digit set is 0–9, A–F (A=10 … F=15; case-insensitive). Each takes the weight of its column, so in 9C the 9 is worth 9 × 16 and the C is worth 12, giving 156.

How do you read a hex memory address or MAC address as decimal?

The same way as any hex number: multiply each digit by its power of 16 and add the products. Both are written in hex because one byte is exactly two digits, so a six-byte MAC address is twelve of them and the byte 1B is 27.

Place value works in both directions, so the same value converts straight back in the decimal to hex direction.

The rest of the family sits on the binary converter index.