# How to Convert a Binary Number Into Hexadecimal | Number System

So, hey guys today we are going to learn โHow to convert a binary number into a hexadecimal numberโ.

Before starting this blog letโs take a recap about what are binary decimal and a hexadecimal numbers. So, letโs startedโฆ

Binary Number

Binary numbers are those number who uses only two-digit of a number system 0(Zero) and 1(One) and their base isย โ2โ.ย Example is 101, 010, 1001, 01100111, etc. These types of numbers are known as Binary Numbers.

A Hexadecimal Number is a number that uses 16-digits of a number system. In which the range of a hexadecimal number between 0 to 9 (0,1,2,3,4,5,6,7,8,9) and A to F (A,B,C,D,E,F). A to F is equivalent to the number 10 to 16 (10, 11, 12, 13, 14, 15, and last 16). This number system is known as Hexa-Decimal Number. Example: 9, 12, 27, 2BC, 9DF, 6EA, 5AFE etc.,

For better understanding let start directly with the exampleโฆ

Example 1: Convert a binary number (101)2 into a Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (101)2

= 1x22 + 0x21 + 1x20

= 1x4 + 0x2 + 1x1

= 4 + 0 + 1

= 5

Hence, the decimal value
is (5)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Hence, our final answer is (5)16.

Example 2: Convert the binary number (10110)2 into a Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (10110)2

= 1x24 + 0x23 + 1x22 + 1x21
+ 0x20

= 1x16 + 0x8 + 1x4 + 1x2
+ 0x1

= 16 + 0 + 4 + 2 + 0

= 22

Hence, the decimal value
is (22)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Now, write all the remainder from downward to the upward manner like this = 16

Hence, our final answer is (16)16.

Example 3: Convert the binary number (11101101)2 into a Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (11101101)2

= 1x27 + 1x26 + 1x25 + 0x24
+ 1x23 + 1x22 + 0x21 + 1x20

= 1x128 + 1x64 + 1x32
+ 0x16 + 1x8 + 1x4
+ 0x2 + 1x1

= 128 + 64 + 32 + 0 + 8
+ 4 + 0 + 1

= 237

Hence, the decimal value
is (237)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Now, write the hexadecimal remainder from downward to the upward manner like this = ED

Hence, our final answer is (ED)16.

Example 4: Convert the binary number (1011001111)2 into a Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (1011001111)2

= 1x29 + 0x28 + 1x27 + 1x26
+ 0x25 + 0x24 + 1x23
+ 1x22 +1x21 + 1x20

= 1x512 + 0x256 + 1x128
+ 1x64 + 0x32 + 0x16
+ 1x8 + 1x4 + 1x2 + 1x1

= 512 + 0 + 128 + 64
+ 0 + 0 + 8 + 4 + 2 + 1

= 719

Hence, the decimal value is
(719)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Now, write the hexadecimal remainder from downward to the upward manner like this = 2CF

Hence, our final answer is (2CF)16.

Example 5: Convert the binary number (10000000001)2 into Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (1000000001)2

= 1x210 + 0x29 + 0x28 + 0x27
+ 0x26 + 0x25 + 0x24 + 0x23
+0x22 + 0x21 + 1x20

= 1x1024 + 0x512 + 1x256
+ 1x128 + 0x64 + 0x32
+ 1x16 + 1x8 + 1x4
+ 1x2 + 1x1

= 1024 + 0 + 0 + 0 + 0
+ 0 + 0 + 0 + 0 + 1

= 1025

Hence, the decimal value
is (1025)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Now, write the hexadecimal remainder from downward to the upward manner like this = 401

Hence, our final answer is (401)16.

Example 6: Convert the binary number (11110000)2 into a Hexadecimal number?

Sol:

Step 1: Firstly we have to convert the given number into a decimal number. Letโs convert itโฆ

```= (11110000)2

= 1x27 + 1x26 + 1x25 + 0x24
+ 0x23 + 0x22 + 0x21 + 0x20

= 1x128 + 1x64 + 1x32 + 1x16
+ 0x8 + 0x4 + 0x2 + 0x1

= 128 + 64 + 32 + 16 + 0
+ 0 + 0 + 0

= 240

Hence, the decimal value
is (240)10
```

Step 2: Now, we have to divide the given number by 16 until the quotients come to 0.

Now, write the hexadecimal remainder from a downward to an upward manner like this = F0

Hence, our final answer is (F0)16.

Top 13 Must have soft skills to Add in your resumeย  10 Best computer science skills to add in your resume 8 object oriented programming languages to learn in 2024 Top 9 Programming Projects to enhance your resume Top 6 Computer science project for beginners in 2024
Top 13 Must have soft skills to Add in your resumeย  10 Best computer science skills to add in your resume 8 object oriented programming languages to learn in 2024 Top 9 Programming Projects to enhance your resume