Hex to Decimal Converter

Hex to Decimal Converter

Popular AI Skill PRO

Enter Calculation

Formula

Decimal=∑i=0n−1di×16iwhere di are digits of Hex\text{Decimal} = \sum_{i=0}^{n-1} d_i \times 16^{i} \quad\text{where } d_i \text{ are digits of } \text{Hex}
Usage stats

Advertisement

Results

Decimal Value
26
Input Hexadecimal 1A
Binary 11010
Decimal 26

Report an error on this page

What This Hex to Decimal Converter Does

This tool converts a hexadecimal (base-16) number into its decimal (base-10) value and also shows you the binary (base-2) equivalent. You type a hex number into the single input field — Hexadecimal Number — and the calculator instantly returns both the decimal result and the matching string of 1s and 0s. It's handy for programmers reading memory addresses or colour codes, students learning number systems, and anyone working with low-level data.

How to Use It

  • Enter your hexadecimal value in the Hexadecimal Number field. Hex uses the digits 0–9 plus the letters A–F (case does not matter, so FF and ff work the same).
  • The converter reads your input and produces two outputs: the decimal value and the binary representation.
  • Use it for whole-number hex values such as 1A, FF, or 2F4B — no decimal point or "0x" prefix is needed.

The Formula Behind It

Each hex digit represents a power of 16. Reading from right to left, the rightmost digit is multiplied by 16⁰, the next by 16¹, then 16², and so on. The decimal value is the sum of all these products:

Decimal = Σ (digit × 16position)

Internally the tool uses Long.parseLong(hex, 16) to parse the string as a base-16 number, then Long.toBinaryString() to generate the binary equivalent from that decimal result.

Advertisement
Hex digits each multiplied by powers of 16 and summed to a decimal total
Each hex digit is multiplied by a power of 16 based on its position, then summed.

Worked Example

Suppose you enter 2F:

  • The digit F equals 15, in the 16⁰ place: 15 × 1 = 15
  • The digit 2 is in the 16¹ place: 2 × 16 = 32
  • Add them together: 32 + 15 = 47 (decimal)
  • The binary equivalent of 47 is 101111

So entering 2F returns a decimal value of 47 and a binary value of 101111.

Worked example expanding a hex number into weighted terms summing to a decimal value
A worked example: each digit's value times its 16-power, added together.

Hex Digit to Decimal and Binary Lookup Table

Hexadecimal (base 16) uses sixteen symbols: 0-9 for values zero to nine, and A-F for values ten to fifteen. Letters are not case-sensitive, so a and A both mean 10.

Hex digit Decimal value 4-bit binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
A 10 1010
B 11 1011
C 12 1100
D 13 1101
E 14 1110
F 15 1111

Note: each hex digit maps to exactly 4 bits (one nibble), because 16 = 24. To get the binary form of any hex number, replace each digit with its 4-bit group and, if you like, drop the leading zeros.

Common Hex Values and Their Decimal Equivalents

Powers of 16

Each position in a hex number is worth a power of 16, counting from 0 at the rightmost digit.

Power Value
160 1
161 16
162 256
163 4,096
164 65,536

Frequently Seen Hex Values

Hex Decimal Binary
0A 10 1010
10 16 10000
7F 127 1111111
80 128 10000000
FF 255 11111111
100 256 100000000
3E8 1,000 1111101000
FFFF 65,535 1111111111111111 (sixteen 1s)
7FFFFFFF 2,147,483,647 thirty-one 1s (too long to list)

Useful patterns: FF is the largest value in one byte (8 bits), FFFF is the largest in two bytes, and 7FFFFFFF is the largest value of a signed 32-bit integer in two's complement representation.

Advertisement

More Worked Examples

Example 1: Convert 1A3 to decimal

  1. Write the digits with their positions (right to left starting at 0): 3 is at position 0, A at position 1, 1 at position 2.
  2. Replace A with 10.
  3. Multiply each digit by its power of 16:
    1 × 162 = 1 × 256 = 256
    A × 161 = 10 × 16 = 160
    3 × 160 = 3 × 1 = 3
  4. Add the products: $$256 + 160 + 3 = $$ 419

Binary check: 1 = 0001, A = 1010, 3 = 0011, giving 0001 1010 0011. Dropping the leading zeros gives 110100011.

Example 2: Convert 2F4B to decimal

  1. Positions from the right: B at 0, 4 at 1, F at 2, 2 at 3.
  2. Replace F with 15 and B with 11.
  3. Multiply each digit by its power of 16:
    2 × 163 = 2 × 4096 = 8192
    F × 162 = 15 × 256 = 3840
    4 × 161 = 4 × 16 = 64
    B × 160 = 11 × 1 = 11
  4. Add the products: $$8192 + 3840 + 64 + 11 = $$ 12107

Binary check: 2 = 0010, F = 1111, 4 = 0100, B = 1011, giving 0010 1111 0100 1011. Dropping the leading zeros gives 10111101001011.

Tip: you can also work left to right (Horner's method): start with 2, then 2×16 + 15 = 47, then 47×16 + 4 = 756, then 756×16 + 11 = 12107.

Frequently Asked Questions

Does capitalisation matter? No. Hex letters A–F are case-insensitive, so ABC and abc both convert to 2748.

Can I include the "0x" prefix? No. Enter only the digits themselves (for example 1A, not 0x1A), since the parser expects a plain base-16 string.

What is the largest number I can convert? The tool parses values as a 64-bit long, so it handles hex numbers up to 7FFFFFFFFFFFFFFF (9,223,372,036,854,775,807 in decimal) reliably.

Last updated:

Most popular in Math and Statistics

View all Math and Statistics calculators