• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Tech Spirited

Tech Spirited

  • Home
  • About
  • Contact
  • Articles

How to Convert Binary to Hexadecimal and Vice Versa

The binary and hexadecimal system are two major numbering systems used by computers. While it's easy to deal with small numbers in the binary format, the same cannot be said about large number manipulations. For simplification, binary digits are converted into hexadecimal numbers, and the reverse is also possible.

You are here: Home / IT Jobs / How to Convert Binary to Hexadecimal and Vice Versa

Like it? Share it!

  • Share
  • Tweet
  • LinkedIn
  • Email
How to Convert Binary to Hexadecimal and Vice Versa

The binary and hexadecimal system are two major numbering systems used by computers. While it’s easy to deal with small numbers in the binary format, the same cannot be said about large number manipulations. For simplification, binary digits are converted into hexadecimal numbers, and the reverse is also possible.

Fast Fact

18,446,744,073,709,551,61516 is the largest hexadecimal number a Windows calculator can handle, and it is made of 64 bits.

Would you like to write for us? Well, we're looking for good writers who want to spread the word. Get in touch with us and we'll talk...

Let's Work Together!

Any computer programming language is converted into a machine-understandable binary language comprising bits represented by ‘0’ and ‘1’ only. A binary string is therefore known as a base-2 number. Eight bits together make one ‘byte’, whereas, a set of four bits make a ‘nibble’.

A major disadvantage of the binary system was that large binary strings consisting of 16 or 32 bits would be difficult to read or write, without introducing any errors. To address this problem, the hexadecimal numbering system was introduced. The hexadecimal system is represented by 16 different symbols, and is therefore known as the base-16 system. The 16 symbols that belong to the hexadecimal system are 0 – 9 and A – F, where A = ’10’, B = ’11’, C = ’12’, D = ’13’, E = ’14’, F = ’15’. Using this system, a long binary string could be easily represented in a short compact form. This could be accomplished by grouping 4-bits together (nibble) to represent a single hexadecimal symbol. This means that a nibble is equivalent to a hexadecimal number. Similarly, a byte (2 nibbles) can be represented by 2 hexadecimal numbers.

This converter will enable you to convert binary to hexadecimal digits, and vice versa.

Converter
Binary

Hexadecimal


In order to convert binary numbers into hexadecimal ones, and vice versa, it is crucial to understand a few basics regarding the methodology. Thus, in the following sections, the conversion methods have been explained with the help of examples. Have a look at the reference conversion chart given below before proceeding.

Correlation Charts for Binary and Hexadecimal Conversions

Binary numbers represent any number (decimal or hexadecimal) using digits 0 and 1 only. Each digit ‘1’ in a binary number represents a power of two, and each ‘0’ represents zero. The method used to form the conversion table is explained below:

0001 = 20 = 116
0010 = 21 = 216
0100 = 22 = 416
1000 = 23 = 816

Would you like to write for us? Well, we're looking for good writers who want to spread the word. Get in touch with us and we'll talk...

Let's Work Together!

If the digit ‘1’ occurs more than once, then you need to add the powers of 2:

0101 = 0 + 22 + 0 + 20 = 4 + 1 = 510 = 516
1010 = 23 + 0 + 21 + 0 = 8 + 2 = 1010 = 1016
0111 = 0 + 22 + 21 + 20 = 4 + 2 + 1 = 710 = 716
1111 = 23 + 22 + 21 + 20 = 8 + 4 + 2 + 1 = 1510 = F16

Number Chart

Binary Hexadecimal
0000 0
0001 1
0010 2
0011 3
0100 4
0101 5
0110 6
0111 7
1000 8
1001 9
Alphabet Chart

Binary Hexadecimal
1010 A
1011 B
1100 C
1101 D
1110 E
1111 F

How to Convert Binary to Hexadecimal

Step 1

Divide the binary number into sets of 4 digits starting from right to left. For example, the binary number ‘1001101100100101’ should be partitioned as follows,
1001|1011|0010|0101➩1001 1011 0010 0101

Add leading zeroes wherever required. For example, the binary number ‘111011001’ should be noted down as,
000111011001

Follow the same aforementioned partitioning step,
0001|1101|1001➩0001 1101 1001

Step 2

Refer to the aforementioned chart, and write down the hexadecimal equivalent of every 4 digit binary number from left to right.

Step 3

Remove all spaces between the final output.

Example #1

Question: The given binary number is 11101010100011012. Find out its hexadecimal form.

Answer:
The number on partitioning will be written as,
1110 1010 1000 1101

The binary to hexadecimal conversion using the table is as follows,
11102 = E16

10102 = A16

10002 = 816

11012 = D16

The final output (after removing the spaces) is,
11101010100011012 = EA8D16

Example #2

Question: The given binary number is 10111011111001010111112. Find out its hexadecimal form.

Answer:
The number on partitioning and addition of zeroes will be written as,
0010 1110 1111 1001 0101 1111

The binary to hexadecimal conversion is as follows,
00102 = 216

11102 = E16

11112 = F16

10012 = 916

01012 = 516

11112 = F16

The final output (after removing the spaces) is,
10111011111001010111112 = 2EF95F16

How to Convert Hexadecimal to Binary

To convert a hexadecimal value to binary, you simply need to translate each hexadecimal digit into its 4-bit binary equivalent.

Example #1

Question: The given hexadecimal number is 6FD16. Find out its binary form.

Answer:
616 = 01102

F16 = 11112

D16 = 11012

The final output (with spaces) is,
6FD16 = 0110 1111 11012

Example #2

Question: The given hexadecimal number is 8F4E9A16. Find out its binary form.

Answer:
816 = 10002

F16 = 11112

416 = 01002

E16 = 11102

916 = 10012

A16 = 10102

The final output (with spaces) is,
8F4E9A16 = 1000 1111 0100 1110 1001 10102

Hexadecimal Prefixes Explained

Prefix Use Example
0x used in programming languages 0x47DE
% used in URLs to express characters like ‘Space’ %20
\x used to express character control codes ‘Backspace’ (\x08), ‘Escape’ (\x1B), and ‘Line Feed’ (\x0A)
# used to refer colors in HTML and other image editing programs #FF7734
0h used by many programmable graphic calculators 0h7E
used to represent unicode characters in HTML, XML, and XHTML prefixed to 3A9 prints an Ω.

Always prepare and refer to the conversion chart while performing conversion between binary and hexadecimal numbers. This will simplify your task and ensure that no errors are introduced in your code.

Related Posts

  • How to Convert Hexadecimal to Decimal and Vice Versa

    The hexadecimal system of numbering is used in computing systems and other fields like mathematics and language coding. For simplification, these numbers are converted into decimal digits, and the opposite…

  • How to Convert AVI to MP4

    Converting AVI files to MP4 format is a simple task that can be accomplished by downloading the appropriate converter. The following article has all the details.

  • How to Convert AVI to DVD

    If you want to watch an AVI file format movie on a DVD player, then you will need to convert the format of the file. In this article, we give…

« Previous Post
Next Post »

Category iconIT Jobs

Get Updates Right to Your Inbox

Sign up to receive the latest and greatest articles from our site automatically each week (give or take)...right to your inbox.
Blog Updates

Exploring the website?

Our site includes quite a bit of content, so if you're having an issue finding what you're looking for, go on ahead and use that search feature there!

Footer

We hope you are enjoying TechSpirited! We provide informative and helpful articles about the outlook for IT jobs throughout the U.S. Learn more about the career in IT you’ve always wanted, or find new tips to further your technology career.
  • Facebook
  • RSS

Copyright © Tech Spirited & Buzzle.com, Inc. All rights reserved.
6789 Quail Hill Pkwy, Suite 211 Irvine CA 92603

  • Privacy Policy
  • Terms of Use
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsAccept
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.

Non-necessary

Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.