Mathematics

Hexadecimal: Base-16 Basics

Hexadecimal is a base-16 numeral system that uses sixteen symbols to represent values. It uses the familiar digits 0–9, then the letters A–F for values ten through fifteen.

The hexadecimal digits are:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

Their decimal values are:

A = 10

B = 11

C = 12

D = 13

E = 14

F = 15

After F, the next hexadecimal number is:

10₁₆

which represents:

16₁₀

Hexadecimal is especially useful in computing because one hexadecimal digit corresponds exactly to four binary bits, making long binary values much easier to read.

What Is Hexadecimal?

Hexadecimal is a positional numeral system with base 16.

In ordinary decimal notation, each position represents a power of 10:

10⁰, 10¹, 10², 10³, …

In hexadecimal, each position represents a power of 16:

16⁰, 16¹, 16², 16³, …

So the hexadecimal number:

2F₁₆

means:

2 × 16¹ + F × 16⁰

Since:

F = 15

we get:

2 × 16 + 15

= 32 + 15

= 47

Therefore:

2F₁₆ = 47₁₀

The powers involved follow the same mathematical rules described under exponents.

Why Does Hexadecimal Use Letters?

A base-16 system needs sixteen distinct digit symbols.

Decimal already provides ten:

0 through 9

Six more are required.

Hexadecimal conventionally uses:

A, B, C, D, E, F

for:

10, 11, 12, 13, 14, 15

The letters are digits within the hexadecimal numeral. They are not algebraic variables.

For example:

C7₁₆

means:

12 × 16 + 7

not “C multiplied by 7.”

Hexadecimal Place Values

From right to left, hexadecimal integer positions represent:

16⁰ = 1

16¹ = 16

16² = 256

16³ = 4,096

16⁴ = 65,536

For example:

3A7₁₆

expands as:

3 × 16² + A × 16¹ + 7 × 16⁰

Replace A with 10:

3 × 256 + 10 × 16 + 7

= 768 + 160 + 7

= 935

Therefore:

3A7₁₆ = 935₁₀

Hexadecimal Digit Table

HexadecimalDecimalBinary
000000
110001
220010
330011
440100
550101
660110
770111
881000
991001
A101010
B111011
C121100
D131101
E141110
F151111

This one-to-four relationship between hexadecimal and binary numbers is one of the main reasons hexadecimal is widely used in digital systems.

Counting in Hexadecimal

Decimal counting proceeds:

8, 9, 10, 11, 12, …

Hexadecimal counting proceeds:

8, 9, A, B, C, D, E, F, 10, 11, …

Remember:

F₁₆ = 15₁₀

and:

10₁₆ = 16₁₀

Continuing:

11₁₆ = 17₁₀

12₁₆ = 18₁₀

1F₁₆ = 31₁₀

20₁₆ = 32₁₀

The transition from F to 10 is analogous to decimal changing from 9 to 10.

Hexadecimal to Decimal Formula

For hexadecimal digits:

dₙdₙ₋₁…d₁d₀

the decimal value is:

Value = d₀ × 16⁰ + d₁ × 16¹ + d₂ × 16² + … + dₙ × 16ⁿ

Each letter digit must first be interpreted as its numerical value from 10 through 15.

Example: Convert 7B to Decimal

Expand:

7B₁₆ = 7 × 16¹ + B × 16⁰

Since:

B = 11

calculate:

7 × 16 + 11

= 112 + 11

= 123

Therefore:

7B₁₆ = 123₁₀

Example: Convert 1A4 to Decimal

Expand by place value:

1A4₁₆ = 1 × 16² + A × 16 + 4

Substitute:

A = 10

Then:

= 1 × 256 + 10 × 16 + 4

= 256 + 160 + 4

= 420

Therefore:

1A4₁₆ = 420₁₀

Example: Convert FFF to Decimal

Each F represents 15.

FFF₁₆ = 15 × 16² + 15 × 16 + 15

Calculate:

15 × 256 = 3,840

15 × 16 = 240

Then:

3,840 + 240 + 15 = 4,095

Therefore:

FFF₁₆ = 4,095₁₀

The next hexadecimal value is:

1000₁₆ = 4,096₁₀

Converting Decimal to Hexadecimal

To convert a positive decimal integer to hexadecimal, repeatedly divide by 16 and record the remainders.

The remainders must be interpreted as hexadecimal digits.

For example:

10 → A

11 → B

12 → C

13 → D

14 → E

15 → F

The repeated-division process uses the same quotient-and-remainder structure described under division and remainders.

Example: Convert 47 to Hexadecimal

Divide:

47 ÷ 16 = 2 remainder 15

The remainder 15 is:

F

The quotient is:

2

Therefore:

47₁₀ = 2F₁₆

Check:

2 × 16 + 15 = 47

Example: Convert 255 to Hexadecimal

Divide:

255 ÷ 16 = 15 remainder 15

Both 15 values become:

F

Therefore:

255₁₀ = FF₁₆

Check:

F × 16 + F

= 15 × 16 + 15

= 240 + 15

= 255

Example: Convert 1,000 to Hexadecimal

First divide:

1000 ÷ 16 = 62 remainder 8

Then:

62 ÷ 16 = 3 remainder 14

Remainder 14 is:

E

Finally:

3 ÷ 16 = 0 remainder 3

Read the remainders from last to first:

3E8

Therefore:

1000₁₀ = 3E8₁₆

Check:

3 × 256 + 14 × 16 + 8

= 768 + 224 + 8

= 1,000

Hexadecimal and Binary

Every hexadecimal digit corresponds to exactly four binary digits.

For example:

A₁₆ = 1010₂

F₁₆ = 1111₂

7₁₆ = 0111₂

Therefore:

7A₁₆

becomes:

0111 1010₂

Dropping the unnecessary leading zero:

7A₁₆ = 1111010₂

This direct grouping makes hexadecimal a compact representation of binary data.

Convert Hexadecimal to Binary

Convert:

3F9₁₆

Translate each digit separately:

3 = 0011

F = 1111

9 = 1001

Combine:

0011 1111 1001

Therefore:

3F9₁₆ = 001111111001₂

Leading zeros may be omitted when they are not needed to preserve a fixed bit width.

Convert Binary to Hexadecimal

Convert:

110101101011₂

Group from the right into sets of four:

1101 0110 1011

Translate:

1101 = D

0110 = 6

1011 = B

Therefore:

110101101011₂ = D6B₁₆

If the leftmost group has fewer than four bits, add leading zeros before translating.

Why Four Binary Bits Match One Hexadecimal Digit

Four binary bits can represent:

2⁴ = 16

different combinations.

Those combinations range from:

0000₂ = 0

through:

1111₂ = 15

Hexadecimal also contains exactly 16 digit values:

0 through F

Therefore one hexadecimal digit maps perfectly onto four binary bits.

Hexadecimal and Bytes

A byte contains:

8 bits

Since one hexadecimal digit represents 4 bits:

8 bits = 2 hexadecimal digits

So one byte can be written with two hexadecimal digits:

00 through FF

For example:

FF₁₆ = 255₁₀

and in binary:

11111111₂

The storage relationship between binary units is covered more directly under bits to bytes.

Hexadecimal Addition

Hexadecimal values can be added directly in base 16.

Consider:

A + 5

Since:

A = 10

we have:

10 + 5 = 15

and hexadecimal 15 is:

F

Therefore:

A + 5 = F

Now consider:

F + 1

Decimal equivalent:

15 + 1 = 16

In hexadecimal:

16₁₀ = 10₁₆

Therefore:

F + 1 = 10₁₆

A carry occurs after a column reaches sixteen rather than ten.

Hexadecimal Addition Example

Calculate:

2A₁₆ + 17₁₆

Rightmost digits:

A + 7 = 10 + 7 = 17 decimal

Seventeen decimal is:

11₁₆

So write:

1

and carry:

1

to the next hexadecimal position.

Next column:

2 + 1 + carried 1 = 4

Therefore:

2A₁₆ + 17₁₆ = 41₁₆

Check in decimal:

2A₁₆ = 42

17₁₆ = 23

42 + 23 = 65

and:

41₁₆ = 4 × 16 + 1 = 65

Hexadecimal Subtraction

Hexadecimal subtraction follows the same positional logic as decimal subtraction, but borrowing contributes:

16

rather than 10.

For example:

20₁₆ – 1₁₆ = 1F₁₆

Check:

32₁₀ – 1 = 31₁₀

and:

1F₁₆ = 16 + 15 = 31

The ordinary sign and operation rules remain part of integer operations; only the numeral representation has changed.

Representation Does Not Change the Number

The same integer may be written:

26₁₀

1A₁₆

11010₂

These are not three different values.

They are three representations of the same number.

Therefore mathematical properties such as divisibility, primality, factors, and the greatest common factor depend on the underlying value, not on the numeral system used to display it.

For example:

GCF(24,36) = 12

remains true even if those values are written in hexadecimal.

Hexadecimal Place Values Form a Geometric Pattern

The hexadecimal place values are:

1, 16, 256, 4096, …

Each term is obtained by multiplying the previous one by:

16

Therefore these place values form a geometric sequence with common ratio:

r = 16

This is a useful way to understand positional notation: moving one place left multiplies the place value by the base.

Hexadecimal Is Not a Harmonic Sequence

A harmonic sequence is defined by reciprocals that form an arithmetic sequence.

Hexadecimal is instead a numeral system.

The hexadecimal place values:

1, 16, 256, 4096, …

are geometric, not harmonic.

This distinction matters because “base-16” describes positional representation rather than a sequence type.

Hexadecimal Fractions

Hexadecimal can also represent values less than 1 using positions to the right of a radix point.

Those positions represent:

16^-1, 16^-2, 16^-3, …

For example:

0.8₁₆

means:

8 × 16^-1

= 8/16

= 1/2

Therefore:

0.8₁₆ = 0.5₁₀

Example: Hexadecimal Fraction 0.C

Since:

C = 12

we have:

0.C₁₆ = 12 × 16^-1

= 12/16

Simplify:

12/16 = 3/4

Therefore:

0.C₁₆ = 0.75₁₀

The reduction uses ordinary fraction simplification.

Multiple Fractional Hexadecimal Digits

Consider:

0.18₁₆

Expand:

1 × 16^-1 + 8 × 16^-2

That is:

1/16 + 8/256

Simplify:

8/256 = 1/32

Then:

1/16 + 1/32

= 2/32 + 1/32

= 3/32

As a decimal:

3/32 = 0.09375

Therefore:

0.18₁₆ = 0.09375₁₀

Improper Fractions and Hexadecimal

An improper fraction represents a rational value whose numerator is at least as large in magnitude as its positive denominator under the usual positive-fraction definition.

For example:

31/16

equals:

1 + 15/16

Because:

15 = F₁₆

the value can be represented in hexadecimal positional form as:

1.F₁₆

The improper-fraction concept describes the ratio; hexadecimal describes how the resulting number is represented.

Decimal Arithmetic and Hexadecimal Conversion

When converting a hexadecimal fractional value to decimal, ordinary decimal arithmetic may be used after evaluating the powers of 16.

For example:

A.B₁₆

equals:

10 + 11/16

and:

11/16 = 0.6875

Therefore:

A.B₁₆ = 10.6875₁₀

The base conversion determines the value; decimal arithmetic handles its decimal representation.

Hexadecimal and Powers of 16

Common powers are:

16⁰ = 1

16¹ = 16

16² = 256

16³ = 4,096

16⁴ = 65,536

16⁵ = 1,048,576

Recognizing these values makes larger hexadecimal-to-decimal conversions faster.

For example:

10000₁₆ = 16⁴

= 65,536₁₀

Leading Zeros

Leading zeros do not change the numerical value.

For example:

00AF₁₆ = AF₁₆

Both represent:

10 × 16 + 15

= 175

Leading zeros may still be retained when a fixed number of hexadecimal digits is useful, such as representing byte or memory values.

Uppercase vs. Lowercase Hexadecimal

The letters may be written in uppercase:

A, B, C, D, E, F

or lowercase:

a, b, c, d, e, f

Numerically:

A₁₆ = a₁₆ = 10₁₀

The choice of letter case is a notation convention rather than a mathematical difference.

Hexadecimal Prefixes

In computing contexts, hexadecimal values are sometimes marked with a prefix such as:

0x

For example:

0xFF

commonly indicates hexadecimal:

FF₁₆

which equals:

255₁₀

The prefix is not part of the numerical value. It identifies the base used to interpret the following digits.

Common Hexadecimal Mistake: Treating A–F as Decimal Digits

For:

2C₁₆

C does not represent 12 separate from place value in an arbitrary way. It is the digit value:

12

So:

2C₁₆ = 2 × 16 + 12

= 44

Common Mistake: Using Powers of 10

Hexadecimal place values use powers of 16, not powers of 10.

For:

123₁₆

the correct expansion is:

1 × 16² + 2 × 16 + 3

not:

1 × 100 + 2 × 10 + 3

Calculate:

256 + 32 + 3 = 291

Therefore:

123₁₆ = 291₁₀

Common Mistake: Reading 10₁₆ as Ten

The hexadecimal numeral:

10₁₆

represents:

1 × 16 + 0

= 16₁₀

It is pronounced according to context as hexadecimal ten or one-zero base sixteen, but its numerical value is sixteen decimal.

Common Mistake: Reading Remainders in the Wrong Order

When converting decimal to hexadecimal through repeated division by 16, remainders are read from the final division upward.

For example, converting 254:

254 ÷ 16 = 15 remainder 14

15 ÷ 16 = 0 remainder 15

The remainders are:

E, F

but read in reverse order:

FE

Therefore:

254₁₀ = FE₁₆

not EF₁₆.

How to Check a Hexadecimal Conversion

Suppose:

2D5₁₆ = 725₁₀

Expand:

2 × 256 + 13 × 16 + 5

= 512 + 208 + 5

= 725

The decimal value is recovered.

For a decimal-to-hexadecimal conversion, convert the hexadecimal result back to decimal using place values.

This reverse check catches misplaced digits and incorrectly interpreted A–F values.

Frequently Asked Questions

What is hexadecimal?

Hexadecimal is a base-16 numeral system using digits 0–9 and letters A–F.

What does A mean in hexadecimal?

A₁₆ = 10₁₀

What does F mean in hexadecimal?

F₁₆ = 15₁₀

What comes after F in hexadecimal?

10₁₆

which equals:

16₁₀

What is FF in decimal?

FF₁₆ = 15 × 16 + 15 = 255₁₀

How do you convert hexadecimal to decimal?

Multiply each hexadecimal digit by its corresponding power of 16 and add the results.

How do you convert decimal to hexadecimal?

Repeatedly divide by 16, record the remainders, convert remainders 10–15 to A–F, and read the remainders from last to first.

Why is hexadecimal useful with binary?

One hexadecimal digit corresponds exactly to four binary bits.

How many hexadecimal digits represent one byte?

Two hexadecimal digits represent eight bits, which is one byte.

Is hexadecimal a different type of number?

No. It is a different numeral system for representing numerical values.

Can hexadecimal represent fractions?

Yes. Positions to the right of the radix point use negative powers of 16.

What is 0.8 in hexadecimal as a decimal value?

0.8₁₆ = 8/16 = 0.5₁₀

Final Example

Convert:

4D2₁₆

to decimal and binary.

Decimal Conversion

Expand:

4D2₁₆ = 4 × 16² + D × 16 + 2

Since:

D = 13

calculate:

4 × 256 + 13 × 16 + 2

= 1,024 + 208 + 2

= 1,234

Therefore:

4D2₁₆ = 1,234₁₀

Binary Conversion

Translate each digit:

4 = 0100

D = 1101

2 = 0010

Combine:

4D2₁₆ = 010011010010₂

Hexadecimal is therefore a compact base-16 representation built on powers of 16, with its strongest practical advantage coming from the exact four-bit correspondence between each hexadecimal digit and binary.

Mehran Khan

Mehran Khan is the primary author at The Logic Library and CEO & Founder of One Digit Media. With 10+ years of experience in software engineering, SEO, and digital publishing, he uses a research-led approach to Logics, Maths, Tech, Formulas, Science, and AI.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button