# Converting directly from binary to hexadecimal | Pre-Algebra | Khan Academy

– [Voiceover] What I would
like to do in this video is explore the connection between
system, which is base 16. The reason why this is interesting is because 16 is a power of two. What we’ll see is you could always view the hexadecimal number system. It’s almost condensed representation of the binary number system. This is actually why you will actually, we’ve already talked
about the binary system is used extensively in computer science and in even computer engineering. It’s the underlying
things that are happening or it’s the representation
used when we talk about logic gates and
transistors and things like that. But hexadecimal also shows up a lot because it’s kind of a condensed
representation of base two. What do I mean by that? Let’s write out a arbitrary
number in base two. Let’s say I have one, zero, one, one, zero, one, one, one, zero. This right over here is in binary and I can even write in parenthesis . This is a binary representation. I want to convert this to
hexadecimal representation. I encourage you to pause the
video and try out in your own. I’ll give you a clue
on how you could think about converting directly
from base two to base 16. Think about which one over
here is in the 16s place and what is the 256 place over here. Then that might help you convert directly. Assuming you had a go at it. The really fun thing about
between base two and base 16 is you don’t have to, well for any
bases, you really don’t have to go through base 10
but these in particular, it’s especially easy to go
convert between these two bases. The realization that you have to make is, what are the powers, which
places here are powers of 16? This right over here,
that is the ones place. One way to think about it
is all of these is going to tell you how many ones we have. Ones, twos, fours, and eights, but another way to think
about it is this is a count of ones, all the way up
to a potential of 15 ones. This could count, this is
going to be between zero, and I’m going to write it down. Actually, let me write it down in base 16. It’s going to be between zero and F. It’s going to be between zero and 15. It’s kind of a count between the number of ones, I guess you could say. Then this is the 16s place. I’m going to do that in different color. This right over here is the 16s place. You could have between zero and 15s, 16s. This is also going to
be between zero and F, when you look at this
four digit binary numbers. Once again, this whole
thing right over here is essentially going to tell
you how many 16s you have. This whole thing is going to tell you how many ones you have. Then the next four, we could keep going, although there is only one place here. We could go, this right
over here is the 256s place. This is going to be the next four digits. They really have one right over here, but one, two, three,
and then the fourth one. This is also going to be
between zero and 15, 256s. Hopefully, that helps you a little bit. Actually, if this was
a clue, I encourage you to pause the video again (laughs) and see if you can represent this in hexadecimal. Let’s try to work this thing together. How many ones do we have? What number is this? These four digits right over here. This is eight plus four plus two. So eight plus four is 12, plus two is 14. This right over here is 14. How do we represent that in hexadecimal? Well, 14 is one less than
15 so it’s going to be E. This is going to be E. This is E. E is our hexadecimal
representation of the number 14 comes right before our
representation of the number 15 F. Alright, now, how many 16s do we have? Let’s see, I have no eights. I have a four, and I have a two. We’re going to have six 16s. So we’re going to have six 16s. Then, how many 256s do I have? I only have one 256. One 256. This number in hexadecimal,
and I could write that. This is in hexadecimal right
over here, is one, six, E. One, six, E. I guess you could call this 256 E, 16 E. I guess 14. I (laughs) finally have to
come up with a better way of reading this hexadecimal number. If you’re not curious what
number is this, because you don’t have to go through decimal
just so you could comprehend it in the number system that
you’re used to operating in. One that’s based off from the
number of fingers you have. Feel free to do so.

## 44 thoughts to “Converting directly from binary to hexadecimal | Pre-Algebra | Khan Academy”

1. Marziyeh M says:

LONG LIVE PALESTINE!! LONG LIVE GAZA!! <3

2. Unstopapple says:

16(0)Echo

3. huh? says:

I can't believe my gay teacher Mrs Van Dickhead makes me watch this crap this sucks ass…. pure assholes

4. Craig Ryba says:

16E = 367

…I think.

5. to0PRETTY says:

When you were trying to say the hex final number, I giggled.. never thought Id laugh at a math joke. First for everything.

6. Gran Nica says:

thank you !!!

7. Marius Du Pont says:

What if there are decimal points?

8. Jewel Mahmud says:

For for than 5 months I was interested in learning number system. I missed the class of number system at our department. And finally your video made my day. Thanks #Salkhan And #Khanacademy

9. tyler black says:

very helpful video! Thanks a bunch.

10. Ash Chez says:

So damn helpful, thank you buddy!

11. Mann says:

thnx
!!!!

12. Kleando Jaupaj says:

Thank you so much!!!!!

13. Soumya Roy says:

Mr.khan how is it that you know everything!!!!Please tell us your secret!!!

14. wePASS says:

Thank you π

15. Mo Vlogs official says:

It 's a easy simple question but he make it so difficult and confusing…

Repetition when teaching can be good, but he verbally repeats every single thing more than three times-what he's about to do, ask he's writing it, after he's written it and sometimes messes up and writes/says it again- it's distracting to hell against what's actually going on. Just do it. Not a very creative teaching method and says the same exact phrases throughout many of the videos in this series as if he just barely read a manual on teaching. Luckily I've taken enough college math classes I could figure them out on my own.

17. Rupanshu jha says:

sherkhan ? is it you ? π

18. Sukrit Chaudhary says:

do your homework buddy before you make a video

19. monsterjazzlicks says:

This needs to be at least 20 x minutes LONGER! It is useless for the BEGINNER!

20. Aiden Moore says:

how did you know that 1110 is 8 + 4 + 2.

21. knowmehuh says:

Instead of trying to explain it your way (genius) why not try to give the info for beginners easily? oh my gosh i can't stand this man i'm sorry but you have to come with easier explanation. Telling lotta tricks on the first step? come on now

22. RequiemUK says:

This was awesome I finally understand

23. Noodles ForLyfe says:

you have no idea how much your vids helped me THANKS A LOTTTTTT

24. Mac Hilton says:

I just wanted to say that I loved this video, very informative! Keep up the good work.

25. Mark Coleman says:

I understand binary and hexadecimal, yet I don't understand his explanation.

26. Kd D says:

This is excellent!! Great work. I now completely understand Hex. It seemed difficult so I just ignored it and used it without deeper understanding. Now I can actually help someone else to learn it and it will help me immensely in my job. Thanks a million

27. ecostar2011 says:

He makes it very difficult to understand and makes people to get confused.

28. JAKE JAWILI says:

Your explanation is very vague no one can understand this kind of tutorial.

29. Brent Griffin says:

your voice is way too loud. thanks for the video though.

30. D7oo says:

ok, I'm a software eng student at the first year
in the ram "8Bit" can hold 8 value? and this is 9
can anyone tell me what happens

31. Ias Howle says:

I didn't know Markiplier is so smart.

I'm sorry for all those who disliked this video.

33. Bumblebee 003 says:

WHO'S WATCHING FROM USKUDAR UNIVERSITY π

34. kennymysteriion says:

I'm sorry for the people hating on you, Khan. People just don't realize there's videos before this explaining binary and hexadecimal each lol but great videos though! I'm a complete beginner and had to learn this for a programming class, so thank you!

35. Tina says:

m i the only one who watches khan academy videos just to listen to his sexy voice?

36. Michael Kaufman says:

Someone remix 5:01

37. Justoboy13 says:

He doesn't go straight from binary to hexadecimal like the title says which annoys me. He went from binary to decimal to hexadecimal, which I could have already done my homework then instead of wasting my time here watching a video about something I already know how to do.

38. Brittney harris-holloway says:

lol why that 256 look like a 28, i sat for 5 mins tryna figure out how 28 came about after a 256

39. WIZARD Z says:

I never learned anything from KHAN ACADEMY EVER!!!!!!!

40. Onyimbi David says: