ToolNimba

๐Ÿ”ข Hex to Decimal Converter with Positional Breakdown

Shihab Mia By Shihab Mia ยท Updated 2026-07-27

A 0x or # prefix is optional. Upper or lower case is fine.

Result summary appears here.

To convert hex to decimal, multiply each hex digit by 16 raised to its position from the right and add the results: 1A becomes 1x16 + 10x1 = 26. This converter does that instantly, accepts an optional 0x or # prefix in upper or lower case, and shows the full positional breakdown plus the binary and octal equivalents so you can check the math, not just trust it.

What is the Hex to Decimal Converter?

Hexadecimal, or base 16, is the number system programmers use to write byte values compactly. It has sixteen digits: 0 to 9 keep their usual values, then A stands for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. Decimal, the base 10 system everyone learns first, only has ten digits, so converting hex to decimal means translating those extra letter-digits and the base 16 place values into the base 10 form your calculator and everyday life use.

The method is positional expansion. Number the hex digits from right to left starting at zero. The rightmost digit sits in the 16^0 place (which equals 1), the next sits in the 16^1 place (16), then 16^2 (256), 16^3 (4096) and so on. To convert hex to decimal you multiply each digit's value by the place value above it and sum every product. For the hex value 1A, the A is worth 10 in the ones place (10x1 = 10) and the 1 is worth 1 in the sixteens place (1x16 = 16), so 16 + 10 = 26. That is exactly what parseInt('1A', 16) returns, and it is the calculation this tool performs and then lays out row by row.

Hex values are not always whole numbers, and they are not always positive. A hex fraction like 1F.4 works the same way but the digits after the point use negative powers of 16: the first fractional digit is worth 16^-1 (one sixteenth), the second is worth 16^-2, and so on, so 1F.4 equals 31 plus 4/16, or 31.25. Negative values are usually written with a leading minus sign for plain hex, but inside computer hardware a fixed-width value such as a byte or 32-bit word more often uses two's complement, where the top bit marks the number as negative and the remaining bits are reinterpreted. In an 8-bit signed byte, 0xFF is not 255, it is -1, while the same bit pattern read as an unsigned byte is 255. Whether a given hex value should be read as signed or unsigned depends entirely on the context it came from, such as a CPU register width or a file format's field definition.

Under the hood every hex to decimal conversion here uses the browser's built in parseInt with a radix of 16, which is fast and exact for whole numbers up to 2^53. Because the result is a normal integer, the same value is trivially re-expressed in other bases, so the converter also reports the binary (base 2) and octal (base 8) forms. This is handy when you are reading a color code, a memory address, a permission mask or a Unicode code point and need to move between the representations without a second tool.

Hex to decimal conversion turns up far more often than most people expect. Web colors such as #FF0000 are three hex byte pairs, HTTP and assembly dumps list addresses in hex, MAC addresses and UUIDs are hex, and character encodings map code points like U+1F600 that you frequently need as a plain decimal number. Windows error codes such as 0xC0000005 and HTTP status extensions are also written in hex and are far easier to look up once converted to decimal. Being able to convert hex to decimal quickly, and to see the arithmetic behind the answer, makes all of those tasks less error prone.

A quick sanity check: the number of decimal digits a hex value can produce grows roughly 20 percent faster than the hex digit count, because 16^n grows faster than any power of 10 with the same digit count. A 2-digit hex number (00 to FF) covers 0 to 255 in decimal, a 4-digit hex number (0000 to FFFF) covers 0 to 65535, and a 6-digit hex color value covers over 16.7 million combinations. Keeping that scale in mind helps you spot an obviously wrong conversion before you even check the math.

When to use it

  • Turning a hex color channel like FF or 80 into its 0 to 255 decimal value when tweaking CSS or design tokens.
  • Reading memory addresses, offsets or register values from a debugger or assembly dump as ordinary decimal numbers.
  • Converting a Unicode code point written in hex (for example 1F600) into the decimal code point used by some APIs.
  • Checking a students homework or a textbook exercise by seeing the full 16^n positional breakdown, not just the final answer.
  • Translating a Windows or system error code such as 0xC0000005 into decimal so it is easier to search in documentation.
  • Decoding hex fields in network packets, MAC addresses, or file headers seen in a hex editor into plain decimal values.

How to use the Hex to Decimal Converter

  1. Type or paste your hexadecimal value into the box (a leading 0x or # prefix is optional).
  2. Read the decimal result at the top; it updates as you type, so no button press is needed.
  3. Scan the positional breakdown and table to see how each digit contributes via its 16^n place value.
  4. Copy the decimal, binary or octal output with the Copy buttons if you need it elsewhere.

Formula & method

decimal = sum over each digit of ( digitValue x 16position ), where position counts from 0 at the rightmost digit. Digit values: 0 to 9 as written, A=10, B=11, C=12, D=13, E=14, F=15. Example: 1A = 1x161 + 10x160 = 16 + 10 = 26.
Hex 1A to Decimal1Aplace 16^1place 16^01 x 16 = 1610 x 1 = 1016 + 10= 26 decimal

Worked examples

Convert the hex value 1A to decimal.

  1. Number the digits from the right: A is position 0, 1 is position 1.
  2. Digit A has value 10, in the 16^0 (ones) place: 10 x 1 = 10.
  3. Digit 1 has value 1, in the 16^1 (sixteens) place: 1 x 16 = 16.
  4. Add the contributions: 16 + 10.

Result: 1A (hex) = 26 (decimal)

Convert the hex color channel FF to decimal.

  1. Both digits are F, which has value 15.
  2. Rightmost F is in the 16^0 place: 15 x 1 = 15.
  3. Left F is in the 16^1 place: 15 x 16 = 240.
  4. Add them: 240 + 15.

Result: FF (hex) = 255 (decimal), the maximum for one color channel

Convert the hex value with a fraction, 1F.4, to decimal.

  1. Split the value at the point: integer part 1F, fractional part .4.
  2. Integer part: F is 15 in the 16^0 place (15 x 1 = 15), 1 is in the 16^1 place (1 x 16 = 16). Sum: 16 + 15 = 31.
  3. Fractional part: the digit 4 sits in the 16^-1 place, worth 1/16, so 4 x 1/16 = 4/16 = 0.25.
  4. Add the integer and fractional results: 31 + 0.25.

Result: 1F.4 (hex) = 31.25 (decimal)

Hex digit to decimal value

Hex digitDecimal value
0 to 90 to 9 (same)
A10
B11
C12
D13
E14
F15

Common hex values and their decimal equivalents

HexDecimalWhere you see it
A10Single letter-digit
0F15Low nibble mask
1016One full place shift
1A26Classic teaching example
64100Round decimal in hex
6CF1743Three-digit example
FF255Max single byte / color channel
100256One byte overflow point
3E81000One thousand in hex
FFFF65535Max 16-bit unsigned value

Signed vs unsigned 8-bit byte values (two's complement)

HexUnsigned decimalSigned 8-bit decimal
0000
7F127127 (largest positive)
80128-128 (most negative)
C0192-64
F0240-16
FF255-1

Common mistakes to avoid

  • Reading letter-digits as their alphabet position. In hex, A is 10 and F is 15, not 1 or 6. A is the eleventh symbol counting from 0, so its value is 10. Mixing up the letter with its place in the alphabet is the most frequent hex to decimal error.
  • Counting positions from the left. Place values are counted from the right, starting at position 0. The rightmost digit is always the ones (16^0) place. Numbering from the left gives every digit the wrong power of 16.
  • Forgetting to strip or account for the 0x prefix. Notations like 0x1A and #1A carry a prefix that marks the value as hex; it is not part of the number. This tool removes 0x and # automatically, but by hand you must convert only the digits after it.
  • Treating hex like base 10 place values. Each hex place is worth 16 times the one to its right (1, 16, 256, 4096), not 10 times (1, 10, 100). Using powers of 10 instead of powers of 16 produces a wildly wrong decimal result.
  • Assuming a hex byte is always positive. A value like 0xFF is 255 if it is unsigned, but -1 if it is a signed 8-bit two's complement value. Whether hex is signed depends on the format it comes from (a CPU register, a file field, a network protocol), not on the digits alone.
  • Losing precision on very long hex strings. JavaScript numbers, and this converter, are exact only up to 2^53. Extremely long hex strings (beyond about 13 to 14 digits) can lose precision if treated as a plain integer; such values usually need a big-integer library instead.

Glossary

Hexadecimal
Base 16 number system using digits 0 to 9 and letters A to F, where A is 10 and F is 15.
Decimal
The everyday base 10 number system, using only the digits 0 to 9.
Positional expansion
Writing a number as the sum of each digit times its place value, the core method for hex to decimal conversion.
Place value
The weight of a digit based on its position; in hex the places are powers of 16 (1, 16, 256, 4096).
Nibble
A group of four bits, exactly one hexadecimal digit, holding a value from 0 to 15.
0x prefix
A marker (0x, or # for colors) placed before hex digits to signal the value is hexadecimal, not part of the number itself.
Byte
A group of 8 bits, represented compactly as exactly two hexadecimal digits ranging from 00 to FF.
Two's complement
The standard way computers represent negative numbers in a fixed number of bits; the top bit marks the sign, so 0xFF as a signed byte is -1, not 255.

Frequently asked questions

How do you convert hex to decimal?

Convert hex to decimal by multiplying each hex digit by 16 raised to its position (counting from 0 on the right) and adding the products. For 1A that is 1x16 + 10x1 = 16 + 10 = 26. Letter-digits use A=10, B=11, C=12, D=13, E=14 and F=15.

What is 1A in decimal?

1A in hex equals 26 in decimal. The A is worth 10 in the ones place (10x1) and the 1 is worth 16 in the sixteens place (1x16), and 16 + 10 = 26.

What is FF in decimal?

FF in hex equals 255 in decimal, because F is 15 and FF = 15x16 + 15x1 = 240 + 15. That is why 255 is the maximum value of one color channel or one byte, ranging 0 to 255.

What is 6CF in decimal?

6CF in hex equals 1743 in decimal: 6x256 + 12x16 + 15x1 = 1536 + 192 + 15 = 1743. This three-digit example shows the same positional method scaling up to the 16^2 (256) place.

Does this converter accept the 0x or # prefix?

Yes. You can enter 1A, 0x1A or #1A and the tool strips the 0x or # prefix automatically before converting, in upper or lower case. The prefix only labels the value as hexadecimal and is not part of the number.

How do you convert a negative or signed hex value to decimal?

If the hex value has a plain minus sign, convert the digits normally and reapply the sign. If it is a fixed-width signed value (two's complement, common in programming), a leading bit of 1 means negative: for an 8-bit signed byte, 0xFF is -1 and 0x80 is -128, while the same bytes read as unsigned are 255 and 128.

Can a hexadecimal number have a decimal point?

Yes. Digits after the point use negative powers of 16 (16^-1, 16^-2, and so on). For example, 1F.4 in hex equals 31 plus 4/16, which is 31.25 in decimal.

Why do the letters A to F appear in hexadecimal?

The letters A to F exist because base 16 needs sixteen single-character digits but the decimal system only supplies ten (0 to 9). A through F fill the gap, standing for the decimal values 10 through 15 so each hex digit stays a single character.

How many decimal digits does a hex value need?

Roughly, a hex value needs about 20 percent more decimal digits than hex digits, since 16^n grows faster than 10^n. A 2-digit hex byte (00 to FF) spans 0 to 255, and a 4-digit hex value spans 0 to 65535.

Is there a limit to how large a hex value I can convert?

This converter is exact for whole numbers up to 2 to the power of 53, the safe integer limit in JavaScript, which covers hex strings up to about 13 digits. Beyond that it warns you rather than returning a rounded, imprecise result.