Hexadecimal Number System Explained for Beginners

20 min read

Learn the hexadecimal number system, its base-16 digits, real-world uses, and how to convert hexadecimal to decimal and binary with examples.

hexadecimal number system

Calcifyai Team

Expert calculators & financial tools

The hexadecimal number system is an important concept in computer science, programming, and digital technology. It provides a simple way to represent large binary numbers using fewer characters, making computer data easier for developers to read, understand, and work with.

If you are new to number systems, hexadecimal may look confusing because it uses both numbers and letters. However, once you understand its basic rules, converting hexadecimal numbers into decimal and binary becomes much easier.

In this beginner-friendly guide, you will learn what the hexadecimal number system is, how it works, why computers use it, and how to convert hexadecimal numbers step by step with practical examples.

What Is the Hexadecimal Number System?

The hexadecimal number system is a number system with a base of 16. It uses 16 different symbols to represent values, including ten numeric digits (0–9) and six letters (A–F).

Unlike the decimal number system, which uses base 10, hexadecimal uses base 16. Each position in a hexadecimal number represents a power of 16.

For example:

  • 0–9 represent values from zero to nine.

  • A represents 10.

  • B represents 11.

  • C represents 12.

  • D represents 13.

  • E represents 14.

  • F represents 15.

Once the value reaches 15 (F), the next number becomes 10 in hexadecimal, which represents 16 in decimal.

Example:

  • Decimal 10 = Hexadecimal A

  • Decimal 15 = Hexadecimal F

  • Decimal 16 = Hexadecimal 10

  • Decimal 25 = Hexadecimal 19

  • Decimal 255 = Hexadecimal FF

Hexadecimal is commonly used in programming, computer memory addresses, web design, and digital electronics.

You can also practice more conversions and calculations using the Hex Calculator, which helps convert hexadecimal, decimal, and binary values without performing every step manually

Why Is the Hexadecimal Number System Used?

Computers process information using binary numbers, which contain only 0s and 1s. Although binary works well for computers, long binary sequences can be difficult for humans to read and understand.

Hexadecimal solves this problem by representing four binary digits (bits) with just one hexadecimal digit.

For example:

Binary: 11111111

Hexadecimal: FF

Both represent the same value, but the hexadecimal version is shorter and easier to read.

Some common uses of hexadecimal include:

1. Computer Programming

Programmers use hexadecimal values to represent data, memory locations, and low-level instructions. It makes large binary values easier to read and manage.

2. HTML and CSS Color Codes

Web developers use hexadecimal color codes to define colors on websites.

For example:

  • #FF0000 – Red

  • #00FF00 – Green

  • #0000FF – Blue

  • #FFFFFF – White

  • #000000 – Black

Each color code contains three pairs of hexadecimal values representing red, green, and blue.

3. Computer Memory Addresses

Hexadecimal is commonly used to display memory addresses because it represents binary data in a compact format.

For example, a memory address might look like:

0x7FFFFFFF

The prefix 0x indicates that the number is written in hexadecimal notation.

4. Digital Electronics

Hexadecimal is useful in digital systems, microcontrollers, and hardware programming. Engineers use it to represent binary data in a shorter and more manageable form.

Hexadecimal Number System Table (0–15)

Understanding the relationship between hexadecimal, decimal, and binary is the first step toward learning hexadecimal conversions.

Here is a reference table showing the first 16 hexadecimal values.

Decimal

Hexadecimal

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

10

A

1010

11

B

1011

12

C

1100

13

D

1101

14

E

1110

15

F

1111

Important: One hexadecimal digit always represents four binary bits. This relationship makes hexadecimal-to-binary conversion straightforward.

How Does the Hexadecimal Number System Work?

The hexadecimal number system follows positional notation. This means that the value of each digit depends on its position within the number.

Each position represents a power of 16, starting from the right.

The place values are:

Position

Place Value

First from right

16⁰ = 1

Second from right

16¹ = 16

Third from right

16² = 256

Fourth from right

16³ = 4,096

Fifth from right

16⁴ = 65,536

For example, consider the hexadecimal number 2A5.

Its place values are:

  • 2 is in the 256s position.

  • A (10) is in the 16s position.

  • 5 is in the 1s position.

To calculate its decimal value:

  • 2 × 256 = 512

  • 10 × 16 = 160

  • 5 × 1 = 5

Add the results:

512 + 160 + 5 = 677

Therefore, 2A5 in hexadecimal equals 677 in decimal.

This method works for any whole-number hexadecimal value.

How to Convert Hexadecimal to Decimal

Converting hexadecimal to decimal means changing a base-16 number into a base-10 number.

You can do this manually by multiplying each hexadecimal digit by its corresponding power of 16 and adding the results.

Step-by-Step Conversion Method

Follow these steps:

  1. Write the hexadecimal number.

  2. Start assigning place values from right to left, beginning with 16⁰.

  3. Convert letters A–F into their decimal values.

  4. Multiply each digit by its place value.

  5. Add all the results to get the decimal equivalent.

Example 1: Convert 3A to Decimal

We need to convert hexadecimal 3A into decimal.

Step 1: Identify the digits.

  • 3 = 3

  • A = 10

Step 2: Assign place values.

  • 3 is in the 16s position.

  • A is in the 1s position.

Step 3: Multiply each digit by its place value.

  • 3 × 16 = 48

  • 10 × 1 = 10

Step 4: Add the results.

48 + 10 = 58

Final Answer

3A (Hexadecimal) = 58 (Decimal)

Example 2: Convert 1F4 to Decimal

Let's convert hexadecimal 1F4 into decimal.

Step 1: Identify the values.

  • 1 = 1

  • F = 15

  • 4 = 4

Step 2: Assign place values.

  • First position: 16⁰ = 1

  • Second position: 16¹ = 16

  • Third position: 16² = 256

Step 3: Multiply each digit.

  • 1 × 256 = 256

  • 15 × 16 = 240

  • 4 × 1 = 4

Step 4: Add the results.

256 + 240 + 4 = 500

Therefore, 1F4 in hexadecimal equals 500 in decimal.

How to Convert Decimal to Hexadecimal

Decimal-to-hexadecimal conversion means changing a base-10 number into a base-16 number.

The easiest manual method is repeated division by 16.

Step-by-Step Conversion Method

  1. Divide the decimal number by 16.

  2. Write down the remainder.

  3. Divide the quotient by 16 again.

  4. Repeat until the quotient becomes zero.

  5. Read the remainders from bottom to top.

  6. Replace remainders from 10 to 15 with A to F.

Example: Convert 125 to Hexadecimal

Let's convert decimal 125 into hexadecimal.

Step 1: Divide 125 by 16.

125 ÷ 16 = 7 remainder 13

Step 2: Convert the remainder.

The decimal value 13 represents D in hexadecimal.

Step 3: Divide the quotient by 16.

7 ÷ 16 = 0 remainder 7

Step 4: Read the remainders from bottom to top.

  • First remainder: 7

  • Second remainder: D

Final Answer

125 (Decimal) = 7D (Hexadecimal)

This method works for any non-negative whole-number decimal value.

How to Convert Binary to Hexadecimal

Binary-to-hexadecimal conversion is easy because one hexadecimal digit represents exactly four binary bits.

You do not need to convert the binary number into decimal first.

Step-by-Step Conversion Method

  1. Write the binary number.

  2. Divide the digits into groups of four, starting from the right.

  3. Add leading zeros to the left if the first group contains fewer than four digits.

  4. Convert each four-bit group into its hexadecimal equivalent.

  5. Combine the hexadecimal digits.

Example: Convert 11111111 to Hexadecimal

Step 1: Write the binary number.

11111111

Step 2: Divide it into groups of four.

1111 | 1111

Step 3: Convert each group.

  • 1111 = F

  • 1111 = F

Step 4: Combine the results.

Final Answer

11111111 (Binary) = FF (Hexadecimal)

Another Example: Convert 10101100 to Hexadecimal

Divide the binary number into two groups:

1010 | 1100

Convert each group:

  • 1010 = A

  • 1100 = C

Therefore:

10101100 (Binary) = AC (Hexadecimal)

How to Convert Hexadecimal to Binary

Hexadecimal-to-binary conversion follows the reverse process of binary-to-hexadecimal conversion.

Each hexadecimal digit is replaced with its corresponding four-bit binary value.

Step-by-Step Conversion Method

  1. Write the hexadecimal number.

  2. Convert each digit into its four-bit binary equivalent.

  3. Keep the groups in the same order.

  4. Join the groups to get the binary number.

Example: Convert 2F to Binary

Step 1: Identify each hexadecimal digit.

  • 2 = 0010

  • F = 1111

Step 2: Combine the binary groups.

0010 + 1111 = 00101111

Final Answer

2F (Hexadecimal) = 00101111 (Binary)

Difference Between Binary, Decimal, and Hexadecimal Number Systems

Binary, decimal, and hexadecimal are three commonly used number systems in computing and mathematics. Their main difference is the number of symbols they use and their base values.

Feature

Binary

Decimal

Hexadecimal

Base

2

10

16

Symbols

0–1

0–9

0–9, A–F

Common use

Computer processing

Everyday counting

Programming and computing

Place values

Powers of 2

Powers of 10

Powers of 16

Example

1010

10

A

All three systems can represent the same numerical value.

For example:

  • Binary: 1111

  • Decimal: 15

  • Hexadecimal: F

The number looks different in each system, but its value remains the same.

Hexadecimal Number System in Real-World Applications

Hexadecimal is not just a theoretical concept. It plays an important role in modern computing and software development.

Here are some practical examples.

1. Web Development and Color Representation

Web developers use hexadecimal color codes in HTML and CSS to define website colors.

For example, the color code #FF5733 represents a shade of orange.

A standard six-digit hexadecimal color code contains three pairs:

  • First pair: Red

  • Second pair: Green

  • Third pair: Blue

Each pair represents a color intensity between 0 and 255.

2. Programming Languages

Programming languages such as Python, JavaScript, C, and C++ support hexadecimal number representations.

For example, in Python:

number = 0xFFprint(number)

Output:

255

The prefix 0x tells Python that the value is hexadecimal.

3. Memory Addresses

Computers use hexadecimal notation to display memory addresses because it provides a shorter representation of binary data.

For example:

0x1A2B

This is a hexadecimal-style memory address representation.

4. Network and Digital Systems

Hexadecimal is also useful when working with network protocols, debugging tools, data packets, and hardware registers.

It helps developers inspect and understand low-level data without reading long binary sequences.

What Is the Relationship Between Hexadecimal and Binary?

Hexadecimal and binary have a direct mathematical relationship.

The reason is that 16 is equal to 2 raised to the fourth power. Therefore, one hexadecimal digit can represent four binary bits.

Here is a simple comparison:

Hexadecimal

Binary

0

0000

1

0001

2

0010

3

0011

4

0100

5

0101

6

0110

7

0111

8

1000

9

1001

A

1010

B

1011

C

1100

D

1101

E

1110

F

1111

For example, an 8-bit binary number can be represented using just two hexadecimal digits.

Binary: 11001010

Hexadecimal: CA

This is why hexadecimal is often used as a compact representation of binary data.

Common Mistakes to Avoid When Learning Hexadecimal

Beginners sometimes make simple mistakes when working with hexadecimal numbers. Understanding these mistakes can help you perform conversions more accurately.

1. Forgetting That A–F Represent Numbers

A common mistake is treating A, B, C, D, E, and F as ordinary letters.

Remember:

  • A = 10

  • B = 11

  • C = 12

  • D = 13

  • E = 14

  • F = 15

2. Using the Wrong Base

Hexadecimal uses base 16, not base 10.

When converting hexadecimal to decimal, each position must be multiplied by the appropriate power of 16.

3. Reading Remainders in the Wrong Order

When converting decimal to hexadecimal using repeated division, always read the remainders from bottom to top.

Reading them from top to bottom produces an incorrect result.

4. Forgetting Leading Zeros in Binary Groups

When converting binary to hexadecimal, every group must contain four bits.

For example, binary 101 should be treated as 0101 when converting it into one hexadecimal digit.

5. Confusing Hexadecimal and Decimal Values

The hexadecimal number 10 does not represent decimal 10. It represents decimal 16.

Always check which number system is being used before interpreting a value.

Practice Questions: Test Your Hexadecimal Knowledge

Try these questions to check your understanding of the hexadecimal number system.

  1. What is the decimal equivalent of hexadecimal A?

  2. Convert hexadecimal 2F into decimal.

  3. Convert decimal 64 into hexadecimal.

  4. What is the binary equivalent of hexadecimal B?

  5. Convert binary 11110000 into hexadecimal.

Answers:

Question

Answer

A to Decimal

10

2F to Decimal

47

64 to Hexadecimal

40

B to Binary

1011

11110000 to Hexadecimal

F0

Frequently Asked Questions About the Hexadecimal Number System

1. What is the hexadecimal number system in simple words?

The hexadecimal number system is a base-16 number system that uses 16 symbols: 0–9 and A–F. It is commonly used in computers and programming to represent binary data in a shorter and easier-to-read format.

2. Why does hexadecimal use letters A to F?

Hexadecimal needs 16 unique symbols. Since the digits 0–9 provide only ten symbols, the letters A–F are used to represent the remaining six values, from 10 to 15.

3. What is the base value of the hexadecimal number system?

The hexadecimal number system has a base value of 16. Each digit position represents a power of 16.

4. What is the difference between hexadecimal and decimal?

The decimal system uses ten digits (0–9), while hexadecimal uses sixteen symbols (0–9 and A–F). Decimal uses powers of 10 for place values, whereas hexadecimal uses powers of 16.

5. How many binary bits are represented by one hexadecimal digit?

One hexadecimal digit represents exactly four binary bits. For example, hexadecimal A represents binary 1010.

6. Where is the hexadecimal number system used?

Hexadecimal is used in computer programming, HTML and CSS color codes, memory addresses, digital electronics, networking, and software debugging.

7. What does FF mean in hexadecimal?

FF is a hexadecimal number that represents 255 in decimal. Each F represents 15, so the calculation is 15 × 16 + 15 = 255.

8. Is hexadecimal easier than binary?

For humans, hexadecimal is generally easier to read and write because it represents four binary bits using one character. However, computers still process information using binary at the hardware level.

Conclusion

The hexadecimal number system is an essential part of computer science and modern technology. It uses 16 symbols, including numbers 0–9 and letters A–F, to represent numerical values.

Understanding hexadecimal makes it easier to work with binary data, convert between different number systems, understand programming concepts, and interpret computer memory addresses.

The best way to learn hexadecimal is through regular practice. Start with the basic hexadecimal table, understand place values, and try converting numbers between hexadecimal, decimal, and binary.

For additional learning, you can explore Visit official NTU educational resource, which explains how hexadecimal represents binary values and how the system is used for digital color representation.

Disclaimer

The information provided in this article is for educational and informational purposes only. It should not be considered as professional financial, medical, or legal advice. Always consult with qualified professionals for specific guidance related to your situation.

Popular Calculators

Explore our most-used free calculators for finance, health, and everyday needs.