Hex to Decimal Converter

Hex to Decimal Converter. Enter your value into Hex Input and the Hex to Decimal Converter instantly calculates its exact Decimal Output. Use the decimal to octal converter to batch-convert several decimal numbers at once — put each one on its own line and click Convert.

Need the base-10 answer for a code like 3F8A without doing the arithmetic by hand? This hex to decimal converter turns any hexadecimal number into its plain decimal form, and the guide below shows exactly how the result is built, so you can check the answer yourself and trust it when it matters.

Hex to Decimal Conversion: How Base-16 and Base-10 Differ

Every number system is defined by its radix, the count of symbols it uses before it rolls over to a new column. Decimal is a base-10 numeral system with the symbols 0 to 9. The hexadecimal system is base-16: it has sixteen symbols, the ten digits plus the letters A-F, where A stands for 10, B for 11, C for 12, D for 13, E for 14 and F for 15. Letters are used because each of those values has to fit in a single character.

That is why hex to decimal conversion is more than a lookup: the same written digit means different amounts depending on where it sits. A hex digit in the second column from the right is worth sixteen times its face value, not ten times.

Base-16 and base-10 side by side

Base-16 and base-10 side by side
PropertyHexadecimalDecimal
Base1610
Symbols0-9 and A-F0-9
Column weights1, 16, 256, 40961, 10, 100, 1000
Typical useBytes, colors, memoryEveryday counting

Why one hex digit equals four bits

Sixteen is two to the fourth power, so every hex digit stands for exactly four bits, one nibble. Two hex digits describe a full byte, from 00 to FF. This tidy fit is the reason hexadecimal became the shorthand for binary numbers: it is far easier to read than a long run of ones and zeros.

  • One hex digit = four bits, so 0 to F covers all 16 binary patterns.
  • Two hex digits = one byte, the unit that memory and files are measured in.
  • Binary, octal and hexadecimal are all just different views of the same data.

Hex to Decimal Formula and Place Value

The hex to decimal formula relies on positional notation. Read the number from right to left, give the rightmost digit position 0, and multiply each digit by 16 raised to its position. Then add the products together. Using exponents of 16 makes each place value explicit:

$$\text{decimal} = d_{n-1} \times 16^{n-1} + \dots + d_2 \times 16^{2} + d_1 \times 16^{1} + d_0 \times 16^{0}$$

Here each \(d\) is the decimal equivalent of one hex digit. The power of 16 grows quickly, which is why a short code can hold a big number:

Hex to Decimal Formula and Place Value
PositionPowerPlace value in decimal
0 (rightmost digit)\(16^{0}\)1
1\(16^{1}\)16
2\(16^{2}\)256
3\(16^{3}\)4,096
4\(16^{4}\)65,536

Step-by-step: convert hex to decimal by hand

  1. Write the hex digits out and replace each letter with its value (A=10 through F=15).
  2. Number the positions from the rightmost digit, starting at 0 and moving left.
  3. Multiply every digit by 16 to the power of its position.
  4. Take the sum of all the products; that total is the decimal number.

Worked Example: Hexadecimal to Decimal for 3F8A

Take the hex value 3F8A. The leftmost digit is 3 in position 3, F is 15 in position 2, 8 sits in position 1, and A, the rightmost digit, is 10 in position 0.

$$3\text{F8A}_{16} = 3 \times 16^{3} + 15 \times 16^{2} + 8 \times 16^{1} + 10 \times 16^{0}$$
Worked Example: Hexadecimal to Decimal for 3F8A
Hex digitDecimal valuePlace valueProduct
334,09612,288
F152563,840
8816128
A10110

The sum is 12,288 + 3,840 + 128 + 10, so 3F8A in hex is 16,266 in decimal. When you convert hex to decimal with a tool, it performs this same multiply-and-add in one click, and typing the value in lowercase or uppercase gives the same answer.

Waterfall chart showing the hex number 3F8A built from place-value products 12,288, 3,840, 128 and 10 that add up to 16,266 in decimal
The four place-value products of 3F8A add up to 16,266 in decimal.

Reading a hex number with a 0x prefix

Programmers often write a hex value as 0x7C2. The 0x prefix is only a label that says "this is base-16"; it carries no value. Drop it and the digits 7, C and 2 give 7 × 256 + 12 × 16 + 2 = 1,986. A good online converter accepts the prefix, ignores spaces between bytes, and treats 7c2 and 7C2 alike.

Hex to Decimal Chart and Conversion Table

For quick lookups, a hex to decimal chart covers the single hex digits you will meet most often. Memorize this one and every longer value becomes a short sum. A fuller hex to decimal table or hex to decimal conversion table simply repeats the pattern for two-digit values, which is handy when you want to check one byte at a glance.

Hex to Decimal Chart and Conversion Table
HexadecimalDecimalHexadecimalDecimal
0088
1199
22A10
33B11
44C12
55D13
66E14
77F15

Related conversions you may need next

  • Decimal to hex: divide by 16 repeatedly and read the remainders back to front.
  • Binary to decimal: the same positional idea with powers of 2 instead of 16.
  • Hex to binary: replace each digit with its four bits, no arithmetic needed.
  • Octal groups binary in threes, which is why it feels like a cousin of hexadecimal.
  • ASCII text codes are usually printed as hex, one byte per character.

Hex Converter Code: Convert Hex to Decimal in Programming

Developers rarely convert by hand. Every major language ships built-in functions for it, and they are accurate, fast and easy to read. In Python, the int() function takes a base as its second argument; in JavaScript, parseInt does the same job.

int("3F8A", 16)       # Python  -> 16266
parseInt("3F8A", 16)  // JavaScript -> 16266

Both languages also accept hex literals such as 0x3F8A directly in source code. A browser-based hex converter is handy when you only need one answer, and a hexadecimal converter built on arbitrary-precision integers can handle values longer than 16 hex characters without rounding. Without that, very large numbers may lose accuracy.

Invalid input and common errors

Most mistakes are small. Watch for these before trusting a result:

  • Letters beyond F (like G or Z) are invalid in a hex number and should be flagged, not guessed.
  • Mixing up the letter O with the digit 0 produces wrong values.
  • Position counting must start at 0 on the right, not 1.
  • A leading 0x prefix is fine, but a stray # belongs to colors, not to the number.

Hexadecimal to Decimal Conversion in Practical Applications

Hexadecimal to decimal work shows up wherever people read machine-oriented data. Software engineers use it for debugging, hardware designers read register values, and administrators decode a network setting. In computing and information technologies generally, hex is the compact representation of raw data.

Hex color codes in web design

In web design, a hex color such as #2E9BD6 packs three bytes into six hex digits for red, green and blue. Converting each pair gives the RGB channels: 2E is 46, 9B is 155, and D6 is 214. That is how HTML and CSS colors map onto the decimal numbers that graphics code expects.

Bar chart converting the hex color code #2E9BD6 into decimal red 46, green 155 and blue 214
Each pair of digits in a hex color code converts to one decimal RGB value.

Memory addresses, machine code and hashes

  • Memory addresses are printed in hex because each digit lines up with four bits of the address.
  • Machine code and hardware registers are documented in hexadecimal, so a decimal conversion helps when you compare a value against a limit.
  • Network values such as ports and packet fields are often shown in hex while tools report them as decimal numbers.
  • Hashes and checksums are long hex strings that you can convert to see their size.

Checking a Packet Length With Hexadecimal to Decimal Conversion

A network technician is reading a capture where a length field shows 1B4E. Dropped frames are the problem, and the standard Ethernet payload limit of 1,500 bytes is the first suspect, so the technician needs the decimal figure before deciding anything.

They paste 1B4E into the converter and run the hex-to-decimal step. The tool reads the digits as 1, 11, 4 and 14, and the sum works out as 1 × 4,096 + 11 × 256 + 4 × 16 + 14 = 6,990. As a quick cross-check by hand, the leading 1 and B alone give 4,096 + 2,816 = 6,912, and the remaining 78 brings the total to 6,990.

Now the number can be compared with something concrete. 6,990 bytes is more than 4.6 times the 1,500-byte standard payload, so these cannot be ordinary frames, yet it sits under the 9,000-byte ceiling commonly used for jumbo frames. That points away from corruption and toward an MTU mismatch.

  • Check the interface MTU on the sending host: it should read 9000, not 1500.
  • Confirm that the switch port between the two machines is also set to 9000.
  • Re-run the capture and verify that the length field now matches the configured size.

The whole check takes one conversion and one comparison, and it replaces guesswork about a log full of hex with a specific setting to change.

Hexadecimal to Decimal Converter Use Cases for Learners and Engineers

A hexadecimal to decimal converter earns its place in two very different routines. Students use it to confirm homework, while engineers use it to read values that a device prints in the hex system but a specification states in the decimal system. In both cases the goal is the same: a trustworthy decimal equivalent for a given hexadecimal number.

One more example with a fractional part

Fractions work the same way, only the positions after the point use negative exponents. Take the hexadecimal number A.C: the digit A before the point is 10 × 160 = 10, and C after the point is 12 × 16-1 = 0.75. Add them and the decimal equivalent is 10.75. Most everyday tools handle whole numbers only, so check what yours supports before pasting a fractional hexadecimal number.

Sanity checks that catch most mistakes

  • Count the digits: a hexadecimal number with four digits must land between 4,096 and 65,535.
  • Check the last digit: it is the decimal equivalent of the rightmost hex digit plus a multiple of 16.
  • Test the case: ff, Ff and FF are all 255, so a tool that treats them differently is not reliable.
  • Estimate first: a leading 8 or higher in a four-digit hexadecimal number means the answer is above 32,768.

Another good example of a quick estimate is B7F0. The leading B is 11, and 11 × 4,096 is already 45,056, so the full decimal number must sit comfortably above that; the exact answer is 47,088.

Using an Online Hex to Decimal Converter Tool Accurately

A good online hex to decimal converter tool should be free, run in your browser, validate each character and tell you when the input is invalid. It should also show a clean decimal number with no rounding. Treat the answer as a check on your own step-by-step working: if the two disagree, recount the positions before assuming the tool is wrong.

If you need to go the other way, or do arithmetic directly in base-16, a hex calculator and a decimal-to-hex tool cover the rest of the workflow. Between them and the method above, you can move between the number system of machines and the one you count with every day, with the accuracy that practical engineering and mathematics demand.