The hexadecimal number system is an important concept in mathematics and computer science. The word 'hexadecimal' comes from 'hexa', which means six, and 'decimal', which means ten, which is a base-16 system.
This uses 16 symbols to represent numbers: 0–9 for the first ten values and the next six AF (A = 10, B = 11, ..., F = 15). Unlike the decimal system (Base-10), hexadecimal works as a base with 16, making it very useful to represent a large number compactly.
Hexadecimal numbers are widely used in computers, digital systems, memory addresses, and web color codes. Examples include 1A, 2 F, B6, FF, 100, etc. In this article, we learn rules, conversions, operations, and applications of the hexadecimal number system with clear examples.
The Hexadecimal Number System is a way of writing numbers using 16 different symbols. These symbols are numbers 0 to 9 and letters A, B, C, D, E, F. In this system, A stands for 10, B stands for 11, C stands for 12, D stands for 13, E stands for 14, and F stands for 15.
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
Since it has 16 symbols, we call it a base-16 system. For example, decimal number 15 is written as F in hexadecimal, and decimal number 16 is written as 10 in hexadecimal. This system is mostly used in computers, coding, and digital devices, as it makes big numbers shorter and easier to read.
The hexadecimal number system is a base-16 system.
It uses decimal numbers (0-9) and letters (A-F).
Each hexadecimal number can also be written in binary form using 4 bits.
Decimal Number |
4-bit Binary Number |
Hexadecimal Number |
0 |
0 |
0 |
1 |
1 |
1 |
2 |
10 |
2 |
3 |
11 |
3 |
4 |
100 |
4 |
5 |
101 |
5 |
6 |
110 |
6 |
7 |
111 |
7 |
8 |
1000 |
8 |
9 |
1001 |
9 |
10 |
1010 |
A |
11 |
1011 |
B |
12 |
1100 |
C |
13 |
1101 |
D |
14 |
1110 |
E |
15 |
1111 |
F |
The hexadecimal number system has 16 digits. These digits are: 0,1,2,3,4,5,6,7,8,9, A, B, C, D, E, F
The digits 0-9 are the same as in the decimal system.
After 9 instead of writing 10, we use letters:
A = 10
B = 11
C = 12
D = 13
E = 14
F = 15
To convert a hexadecimal number into decimal, we replace each hex digit with its decimal value.
Hexadecimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
Binary |
0 |
1 |
10 |
11 |
100 |
101 |
110 |
111 |
1000 |
1001 |
1010 |
1011 |
1100 |
1101 |
1110 |
1111 |
To change a decimal number into hexadecimal, follow these steps:
Divide the decimal number 16.
Write down the reminder number.
Divide the quotient again by 16.
Repeat until the quotient becomes 0.
Write the reminder from bottom to top, that will be the hex number.
Example: Cobert (242)₁₀ into hexadecimal.
242 ÷ 16 = 15, reminder is 2
15 ÷ 16 = 0, reminder is 15
So,(242)₁₀ = (F2)₁₆
We can also change hexadecimal numbers into octal numbers.
Hexadecimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
Binary |
0 |
1 |
10 |
11 |
100 |
101 |
110 |
111 |
1000 |
1001 |
1010 |
1011 |
1100 |
1101 |
1110 |
1111 |
To convert octal into hexadecimal, we first convert octal to decimal, then decimal to hexadecimal.
Example: Convert (121)₈ to decimal.
Step 1: Change (121)₈ to decimal.
1 × 8² + 2 × 8¹ + 1 × 8⁰
64 + 16 + 1 = 81
Step 2: Change (81)₁₀ to hexadecimal.
81 ÷ 16 = 5, so the remainder is 1.
5 ÷ 16 = 0, so the remainder is 5.
So, (121)₈ = (51)₁₆
Each hexadecimal digit can be written as 4 4-digit binary number.
Hexadecimal |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
A |
B |
C |
D |
E |
F |
Binary |
0 |
1 |
10 |
11 |
100 |
101 |
110 |
111 |
1000 |
1001 |
1010 |
1011 |
1100 |
1101 |
1110 |
1111 |
So, to convert hexadecimal to binary, just replace each hex digit with its 4-bit binary value.
To change binary to hexadecimal, group the binary digits into 4 bits each and replace them with their hex values.
Example: Convert (11100011)₂ into hexadecimal.
Split into a group of 4: 1110 0011
1110 = E. 0011 =3
So, (11100011)₂ = (E3)₁₆
The word base 16 means that the location of each number increases in the value of the power of 16 because you move again from the decimal point. Each hexadecimal digit can represent a 4-bit binary sequence and directs the conversion between binary and hexadecimal.
Hexadecimal place value Table:
Position (Right to Left) |
Base Power |
Value |
1st |
16⁰ |
1 |
2nd |
16¹ |
16 |
3rd |
16² |
256 |
4th |
16³ |
4,096 |
5th |
16⁴ |
65,536 |
Example: Hex number 3A equals:
3 × 16¹ = 48
A × 16⁰ = 10
Total = 48 + 10 = 58 (in decimal)
The hexadecimal number system simplifies how computers and electronic systems manage large binary values. The applications are completed:
Memory Address (eg, 0x1A3F)
Hexadecimal color code in web development (eg, #FF5733)
MAC addresses and IPV6 addresses in networks
Programming at the assembly level and machine code representation
Debugging tools and system monitor
Using hexadecimal reduces the error and improves readability when working with the representation of bits and bytes. For example, a byte (8 bits) can be represented with only two hexadecimal digits, making it easier to interpret computer compact and digital electronics and leading to the basis conversion in data processing.
In web development and design, the color code is used in hexadecimal to represent RGB values in a human-readable format.
Each color (red, green, blue) appears with 2 hexagonal digits
Format: #RRGGBB
Example: #FF5733
Red: FF (255)
Green: 57 (87)
Blue: 33 (51)
Use matters:
Web design
Graphic software
CSS and HTML
The hexadecimal number system plays an important role in different domains of digital electronics and computer science, as large binary values have the ability to be represented more compactly. Some of the most important applications are included:
Memory address: Hexadecimal is used to represent a memory location. For example, the address 0x3F5A is easier to read and manage compared to the binary equivalent.
Machine-level programming: Hex is used to explain assembly codes, debugging, and machine instructions.
Microcontroller programming: Many microcontrollers collect data or memory configuration in hexadecimal format.
Digital signal processing: Hexadecimal simplifies the understanding of binary-coded data in the DSP system.
In software development, hexadecimal values are often used as they provide a human-readable way of viewing binary data. Examples include:
Color code in HTML/CSS: EG, #ff5733, where FF, 5,7, and 33 RGB components represent components.
Escape Sequence in Strings: For example, <<<< \ XA9 for the symbol.
Memory dump interpretation: Developers use hexadecimal to debug and inspect raw memory.
Bitmask and change: Hex values are used to define masks in built-in programming.
Here are some real-world examples showing the applications of the hexadecimal number system:
Use Case |
Hexadecimal Format Examples |
Web Color Code |
#FFFFFF (White), #000000 (Black) |
Memory Address |
0x1F4C |
MAC Address |
00:1B:44:11:3A:B7 |
IPv6 Address |
2001:0db8:85a3::8a2e:0370:7334 |
Assembly Instruction |
MOV AX, 0xFF |
File Signature (Hex Dump) |
89 50 4E 47 (PNG File Header) |
Ans: So, the hex value for 20 is 14 (and you say it as ONE–FOUR). Don't worry if that's a bit confusing – let's try another example with a larger number.
Ans: For example: 7B316, 6F16, 4B2A16, 7 B 3 16, 6 F 16, 4 B 2 A 16 are hexadecimal numbers. A hexadecimal number system is also known as a positional number system, as each digit weighs 16. Each digit is 16 times more significant than the previous digit.
Ans: A Media Access Control (MAC) address is a 12-digit hexadecimal number that uniquely identifies every device connected to a network. The MAC address is attached to the Network Interface Controller (NIC), which is a network adapter that allows your device to connect to a network.
Ans: 0001 is the binary representation of 1 (which is the same in decimal and hexadecimal). 1010 is the binary representation of the decimal number 10, which is represented in hexadecimal as A.
Ans: On dividing the decimal number 50 by 16, we get the remainder as 2 and the quotient as 3. In the next step, we will divide 3/16, where the obtained quotient is 0 and the remainder is 3. On combining the digits in reverse order, we get the hexadecimal value of 50 as 32.
CBSE Schools In Popular Cities