Converting Between Binary, Decimal, Octal & Hexadecimal Numbers

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Gray Code as a Non-Arithmetic Coding System

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
 Replay
Your next lesson will play in 10 seconds
  • 0:04 Number Systems
  • 1:57 Conversions: Decimals…
  • 4:15 Conversions: Binary to Others
  • 6:19 Conversions: Octal to Others
  • 8:01 Conversions:…
  • 9:52 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Timeline
Autoplay
Autoplay
Speed

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Stan Goodman
In this lesson you will learn about various systems of numerical notation, like decimal, binary, octal, and hexadecimal, that are used in computing and have different number bases. You'll learn how these number systems are represented, and how to convert between different numeric systems.

Number Systems

The number system that most of us are familiar with is known as the decimal system, which is based on base 10 and the place values are based on the powers of 10. From right to left, we have the ones place, the tens place, the hundreds place, the thousands place, and so on.

Each digit can have the value zero, one, two, three, and so on through nine. The number 768 represents seven hundreds, six tens, and eight ones, giving us the value we recognize as 'seven hundred and sixty-eight.'

In the binary system, there are only two possible values for each digit: zero or one. A binary digit is called a 'bit.' The value of each bit is based on the powers of two. From right to left, the place values are 1, 2, 4, 8, 16, 32, etc. All current electronic computers are based on the base-2, or binary system, because of their internal representation of two states, typically on and off, or high and low.

In the octal system, the value of each place is based on the powers of 8. From right to left, the place values are 1, 8, 64, 512, 4096, etc. You can see that since each place represents a larger value than the binary digit, the octal representation of the same number will be shorter.

In the hexadecimal system, the value of each place is based on the powers of 16. From right to left, the place values are 1, 16, 256, 4096, etc. Since each place represents a larger value than in the common decimal system, the hexadecimal representation of a larger number will be shorter. Since digits with a value of more than 9 are needed, the letters A, B, C, D, E, and F are used to represent these values.

Conversions: Decimal to Others

To convert from decimal to other number systems, we use a repeated process of division and dividing remainders.

We begin by taking the largest power of our new base and dividing our original number by the new base. The quotient gives us our digit, and the process is repeated on the remainder. This process has to be repeated until we divide by the final 1 to get the last digit.

Let's convert the number 35 from decimal to binary, octal, and hexadecimal.

In converting to binary, we need to know the powers of 2, which are 1, 2, 4, 8, 16, 32, 64, and so on. We'll start with 32, since 32 is smaller than our initial number of 35, and 64 is larger.

35 ÷ 32 = 1, remainder 3 -> The first digit is 1
3 ÷ 16 = 0, remainder 3 -> the second digit is 0
3 ÷ 8 = 0, remainder 3 -> the third digit is 0
3 ÷ 4 = 0, remainder 3 -> the third digit is 0
3 ÷ 2 = 1, remainder 1 -> the fourth digit is 1
1 ÷ 1 = 1, remainder 0, the fifth digit is 1.

The answer is that 35 decimal = 100011 binary.

In converting to octal, we need to know the powers of 8, which are 1, 8, 64, 512, and so on. We'll start with 8, since 8 is smaller than our initial number of 35, and 64 is larger.

35 ÷ 8 = 4, remainder 3 -> The first digit is 4
3 ÷ 1 = 3, remainder 0 -> The second digit is 3.

The answer is that 35 decimal = 43 octal.

In converting to hexadecimal, we'll use the powers of 16: 1, 16, 256, and so on. We start with 16, since 16 is smaller than our initial number of 35, and 256 is larger.

35 ÷ 16 = 2, remainder 3 -> The first digit is 2.
3 ÷ 1 = 3, remainder 0 -> The second digit is 3.

The answer is that 35 decimal = 23 hexadecimal.

Conversions: Binary to Others

To convert from binary to decimal, we use a process of multiplication and addition.

To convert the binary number 0110 1010 to decimal, we take each digit, from right to left, multiply it by the place value, and add to our running total.

0 × 1 = 0, add 0
1 × 2 = 2, add 2, get 2
0 × 4 = 0, add 0, get 2
1 × 8 = 8, add 8, get 10
0 × 16 = 0, add 0, get 10
1 × 32 = 32, add 32, get 42
1 × 64 = 64, add 64, get 106
0 × 128 = 0, add 0, get 106.

The answer is that 0110 1010 binary = 106 decimal.

To convert from binary to octal, we can take a shortcut. Each octal digit represents 3 bits, and we can make groups of 3 bits, from right to left, and convert to octal digits directly.

0110 1001 regroups as 01 101 010.

010 -> 2
101 -> 5
01 -> 1

The answer then is 0110 1010 binary = 152 octal.

To convert from binary to hexadecimal, we take a similar shortcut to the one in octal. Each hexadecimal digit represents 4 bits, so we can take groups of 4 bits, from right to left, and convert to hexadecimal digits directly. Remember that if the number is more than 10, we use the letters A, B, C, D, E, and F.

0110 1010 is already grouped into sets of four bits.

1010 -> A
0110 -> 6

The answer then is 0110 1010 binary = 6A hexadecimal.

Conversions: Octal to Others

To convert from octal to decimal, we use a process of multiplication and addition.

To convert the octal number 123 to decimal, we take each digit, from right to left, multiply it by the place value, and add to our running total.

3 × 1 = 3, add 3
2 × 8 = 16, add 16, get 19
1 × 64 = 64, add 64, get 83.

The answer then is 123 octal = 83 decimal.

To convert from octal to binary, we can take a shortcut. Because each octal digit represents 3 bits, we simply expand each octal digit into the 3 bits it represents. This process can be done from left to right.

1 -> 001
2 -> 010
3 -> 011

To unlock this lesson you must be a Study.com Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use Study.com

Become a Study.com member and start learning now.
Become a Member  Back
What teachers are saying about Study.com
Try it risk-free for 30 days

Earning College Credit

Did you know… We have over 200 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account
Support