## Hexadecimal number system | Applying mathematical reasoning | Pre-Algebra | Khan Academy

– [Voiceover] We’re all
familiar with the base 10 number system, were
often called the decimal number system, where we have 10 digits Zero, one, two, three, four,
five, six, seven, eight, nine. Now, we started to see that we can have alternate number system. We can have a base two number system, or it’s the binary number system, where instead of 10 digits
you only have two digits. Each place, instead of being a power of ten is going to be a power of two. Now you can imagine that
we can keep extending this. We can extend to base three,
four, five, six, seven, eight, nine, or we could even go above 10. What I want to show you
in this video is a fairly, heavily used number system
that is larger than, or that has more digits than
base 10, and that base is 16. Base 16, often called the hexadecimal. Hexadecimal number system. As you can imagine, instead of only having 10 digits, it is going to have 16. What are those digits going to be? As we’ll see, instead of
the place is being powers of two or powers of ten,
there will be powers of 16. Let’s see, we can reuse
the existing 10 digits from the decimal number system. We can reuse zero, one, two, three, four, five, six, seven, eight, nine, but then we’re going to need
to have six more digits. The convention is to use
the first six letters. A, B, C, D, E, and F. You might say this is crazy. These are letters, not numbers,
but remember these are just arbitrary squiggles of
ink on a piece of paper. These are just arbitrary symbols that we’re grown to associate with things. You’re grown to associate
this symbol right over here with eight thing, with
the word eight which you associate with when you
see that many objects. If you’re thinking in hexadecimal,
this isn’t the letter A that makes you want to
say “ah”, or the letter B that makes you want to say “bababababa”. This is, literally, this represents if you had 10 things laying around. You would say, “I have
A things over there.” If you have 11, you’d say,
“I have B things over there.” 12, C things. 13, instead of saying,
“I have 13 things there”, “I have D things there.” Instead of saying, “I have 14”, you could say, “I can
have E things there.” Instead of saying, “I have 15”, you could say, “I have F things there.” Now, how does that help? Well, let’s see if we can represent the same number 231, or 231 in decimal. If we can represent that
same number in hexadecimal. What I’ll do is I’ll give
you what the number is, and then I’ll show you how we convert it. I’ll show you the place value, and I’ll show you how we convert it. 231 in hexadecimal. 231 in hexadecimal is the number E seven. E seven. Once again, you’re
like, “This looks crazy. “This is like I’m playing
like battleship or something.” What’s E seven? This is a number and I would say yes. This is a number. Now remember, base 16. What are these place values represent? This first place represents
16 to the zero power or still represents the ones place. This is the ones place. This is seven ones. Now, what is this place here represents? Well, in base 10, that
was 10 to the first power. In base two, that was
two to the first power. On base 16, this is going to be, I’ll leave those there, in base 16, this is going
to be 16 to the first power. This is literally, well let me write out the word, this is literally sixteens. This is E sixteens plus seven ones. Let me write that down. This is E sixteens plus seven ones. That’s what this number represents. Now, if we want to start rewriting this or re-conceptualizing it in our decimal number system, what is E sixteens? Well, the E if we think
in decimal, E is 14. E is 14. This is really, we can
really think of this if you want to think them decimals. This is 14 sixteens. It’s 14 sixteens. Well, that’s just the
same thing as 14 times 16. 14 times 16 is equal to 224. Maybe I should do that in same color. This thing right over
here is going to be 224. 14 sixteens, 14 times 16
is 224 plus seven ones. Well, 224 plus 7 is
going to be give you 231. Hopefully, you can appreciate it. You can represent the same quantity in any of these different number systems. In any number that you
can represent in decimal, you can also represent
that number in binary, or in hexadecimal, or in
base three, or in base 60, or in base 31, whatever you want to do. You might have noticed the pattern. The more symbols that we have, so in base 16, you have 16 symbols, the less place values we need to represent the same quantity. One way to think about it is each of the places are
containing more information. This is one of 16 characters. While this over here is
only one of two characters. This is one of ten characters. The more symbols that
you have, the more digits that you could put in each
place, the less places that you need to represent
a given quantity. Another way to think about it
is when you have a high base, like base 16, as you take
powers of 16, the next place right over here would be 16 squared, which, of course, is two
hundred and, wait a minute, 256. You’re clearly going to be able
to represent bigger numbers faster, I guess you could
say, or with less digits. It’s just an interesting thing to observe. But hopefully, you’re
going to kick out of, as much of a kick out of base 16 as I do, and it’s actually useful. This actually is used if
you look at most web pages. If you look at the actual code for there, or I guess you could say the
formatting line, the HTML for the webpage, when they specify colors, they tend to specify in hexadecimal. That’s because they’re specifying
the colors, the intensity of the red, the green, or the
blue, between zero and 255. Two digits of hexadecimal
are perfect for that, because if you think
about it, what is F F? What would this be if you
rewrite it in the decimal number system, and I encourage you
after this video is done, I encourage you to do that to
figure that out on your own. If you really want to do something fun, let me give you another one. Try to figure out what A F three is. Again, this isn’t very specialized. I just wanted to give you another interesting thing to work on.

## 100 thoughts on “Hexadecimal number system | Applying mathematical reasoning | Pre-Algebra | Khan Academy”

1. O0oOo8oOo0O says:

And why did they use 0-F instead of A-P?

2. O0oOo8oOo0O says:

I was about to ask if F shouldn't be 16? But not no, it starts with 0.
So does binary etc. So not "computers start counting with 0", every number system does.
Now I even figured out why. Because number sign are just placeholders. And the lowest value you have to represent "nothing" in order to express "no times this power of base jump".
Only humans start counting with 1.
Seems super logic but who's really aware of it? Mindblowing!

3. Cloud Cop says:

FF is 255 and AF3 is 2803

4. Alexis Birakos says:

Is AF3 2803 and FF 255???

Thanks, helped with my computing class.

6. Mc Doober says:

FF=480 AF3=403 high school rules!

7. Sk8erGoat says:

What kind of input device do you use? Looks too smooth to be a regular mouse 🙂

8. Rokas S says:

so what if you wanted the number 17, how would you show it in hexadecimal?

9. plrokster309 says:

How about a base e system? That would be useful for natural log sort calculations. Anybody with me?

10. XxCBXxX says:

FF is 255 because F first F is 15*16=240 then plus 15(F)=225

11. Anukesh Singh says:

thanku so much

12. Iamjenjen 101 says:

in our number system FF is 255 (15*16 + 15*1) and AF3 is 2803 (10*256 + 15*16 + 3*1)

13. this is my shitposting account says:

I like math.

Thug lyfe

14. thedigitalberrybot says:

Great video! Helped a lot thank you!

15. Shannon S says:

So what would the number 10 be?

16. PatDoesCubes says:

I am c years old 😀

17. Eric M says:

Yes! Yes! I finally get it. Thank you!!!!

18. Sanyu says:

231/16=14.4375
14=E (in hex)
14*16=224
231-244= 7
7=7( in hex)

231=E7(in hex)

19. Sanyu says:

FF
we know F=15
15*16=240
240+15=255   😀

AF3
A=10
F=15
10*256=2560
15*16=240
2560+240+3=2803

20. Mathias Figenschau says:

21. Victor Voermans says:

Worked out a formula to go from B-10 to B-x, with n being the number you want to transfer:

n : x = y,~

y * x = z

n – z = a

y[B-x] + a[B-x] = n[B-x]

22. oliver fortin says:

im only D years old and I understand this! Mind Blown!

23. Trees in Minecart says:

Daniel Rosenfeld = 12 418

24. pezpeculiar says:

Sometimes I wonder how you write so good with a mouse

25. Dennis says:

I do have a question that E comes on 15th number and should be given a value of 15 and F should become 16.

26. Lilsamofro says:

Soooo with RGB being measured between 0 -255, im assuming that we use 255 shades of each colour to match the Hexadecimal limit. ie we chose to use hexadecimal first and then decided 255 was adequate rather than a happy coincidence??

27. J Beason says:

I'm here because of Subete ga F ni Naru: The Perfect Insider

28. Constant says:

I'm E years old and I already know how to use hexadecimal.

29. Hampurilias says:

So what is the decimal number 17? 01?

30. Passions says:

Super clear explanation and video quality. A+!

31. Fido Dido says:

I understood the E= 14 but how it became 14sixteens !!?

32. Naval Porcupine says:

Thanks, I've got my exam tomorrow and this is somewhere which caught me out in my last mock exam.

33. Joshua Liu says:

Thank you 😉

34. Ba dum tiss says:

We use your website in math class at school. At first I thought is was just another stupid ass math site, but after watching this, I feel different. I'm aiming for a career in computer science in the future, and knowing this is pretty important. You illustrated the way hexadecimal works very well, and I now understand it.

35. monsterjazzlicks says:

Way too complex for such a short duration!

what do u use

5he software meaning what do use to write stuff

38. Desiigner GRRRAAh says:

why did you use E7 …?

39. Con Andrews says:

Why is 7 (16^0) …. i have spend loaddsss of time trying to understand why, Hexidecimal only goes up to 9, and the 10 is A?
up to 9, its just counting and adding up the base powers! But the i dont understand why 10, 11 ect. cant be "0 1 0 1 0" as in 8 + 2 = 10??

40. Nikhil kumar says:

what is the application or software or any external device used in this video for writing?

41. Nathan Herder says:

Thanks Hal

42. dave4248 says:

Brought here via "The Martian"

43. Fatal Ritte says:

that hexadecimal system is way more complicated than it has to be. I got interested in it from watching the Martian. all you have to do is take the letter F, put the number 10 beside it, and there's your entire alphabet. There would be no need for punctuation or spaces in the message. But I guess it's not unusual for people take something simple and confused themselves with it. I'm still trying to figure how you took "FF" and got the color white.

44. Fatal Ritte says:

that hexadecimal system is way more complicated than it has to be. I got interested in it from watching the Martian. all you have to do is take the letter F, put the number 10 beside it, and there's your entire alphabet. There would be no need for punctuation or spaces in the message. But I guess it's not unusual for people take something simple and confused themselves with it. I'm still trying to figure how you took "FF" and got the color white.

So basicly you mean 16 = 10 ? you crazy or what ??? 😀

46. GyroThesia says:

I am ABF14 years old.

47. Tsundori says:

some people here are saying their ages in hexadecimal as in A,B and C and stuff. I'm 16. nothing special about that..

48. sal villalon says:

THANK YOU!

49. Flute Løøps says:

I started texting my friend in hexadecimals just to confuse her. I said, "48 49. 49 55 53 45 48 45 58 41 44 45 43 49 4d 41 4c 53 4e 4f 57 !" which means, "HI. I USE HEXADECIMALS NOW!" It's in all caps because if it weren't, things would get a LOT more complicated.

50. Zuhair Alshobaki says:

thanks for the tutorial

51. Ilja says:

AF3 = 2803, right?

52. David 0221 says:

okay I grasp the concept but somehow my programming lab is giving me a problem of hexadeceimals and I keep getting it wrong >:(

Write a hexadecimal integer literal representing the value fifteen.
_________________________________

I don't need the answer but I would like some explanation as to why all of my 47 responses are incorrect, I tried everything lol

53. mohammed islam says:

I am B years old and i know how to use hexadecimal

54. Peter N says:

Foe the longest time, I wanted to know how base-37 works. This because I figured out that once bases go over 10, it goes into the Latin alphabet, but the Latin alphabet only goes up to 26 digits, so how would base-37 work?

55. need some help says:

Only if my Computer Science didn't suck and have such a strong accent, I would understand her but Khan Academy makes everything more understandable. Thank you for saving me, always able to teach well unlike a teacher at my school.

56. Izumi says:

i'm 10 years old and i finally understand this

57. Peter Mullan says:

Hey, I made quite a good binary, octal, hexadecimal & decimal conversion page.

http://numeralconversion.co.uk/

Click on "Click here to see how these add together to get the total" to see how the numbers all add together to get to the total.

The way bits group together to make hexadecimal and octal numbers is also shown.

58. Tim Mackie says:

FF=255

59. DJ Programer says:

60. Sidney says:

Go on double speed to 2:15. Still laughing! But a great video!

61. Tannerlini says:

In base16 I'm 10 years old and in base2 I'm 00010000.

62. Ze Pooty says:

Im sorry but…. 3499 is DAB

63. Bart Cywinski says:

Repetition works repetition works.

64. Richard Smith says:

AF3 = (16^2 * A) + (16 * F) + 3 = (16^2 * 10) + (16 * 15) + 3 = 2803

65. Bruno Daniel Rodrigues says:

The number 26, for example, in hexadecimal is 1A right?

66. Creative Claude says:

Thanks so much was much more clear when you explained it!

67. Rogano says:

Base 1

68. BENZDIK 3.0 says:

E

69. Lee Fire says:

So why is Hexidecimal code sometimes written like this example –> 0x64

70. John Salisbury says:

Great explanation! Really helped me out! Up until this point I've been using RGB decimal for defining colors when coding in HTML/CSS, but now I can actually understand what I am doing when I use hexadecimals!

71. Kazz Kaz says:

very valuable. thank you!

72. Shokhmurod Kodirjonov says:

I didn't get anything ;(
Help me someone please in this area !!!

73. Floyte says:

how do I represent 1 in hexadecimal?

74. the dagger says:

62 69 74 2E 64 6F 2F 54 68 65 5F 43 61 76 65

75. Mitch Mojica says:

If get a F in school my grade is 15x 16 =240

76. Technoultimategaming says:

AF3
A=10
We have 16^2=256
256×10= 2560
F=15
16^1=16
16×15= 240
3=3
So
AF3 = 2560+240+3=2803?

77. Potato3399 says:

Great video

78. Jameson D'Amico says:

Great explanation, had trouble with this on practice exams

79. Alfonso Báez Rosas says:

At the start of this video I was 18 years old, now I am 12

80. The Insomniac Scientist says:

All that is needed from me is a big 👍

81. Justin H. says:

FF= 16×15 + 16×15 = 480 right?

82. Landon S says:

Yeah Hexadecimals are killing my test scores man -_-. fine with binary and changing to decimals. Yet, hexadecimals really i don`t get, mostly when i`m working with multiple place holders.

If i`m changing 17 to HEX, i understand its (1*16)+(1*7)=23…. Yet why am i not doing (1*16)+(1*17) to get 33?

what would happen if i worked with 349 or something crazy, how would i solve?

P.S. i am self studying all this and learning from the bottom to hopefully self-learn programming with a solid base. Don`t be to harsh.

83. THE MACHINE says:

But remember it is just ink on a pease of paper…LOL

84. Dragos Makovei says:

very interesting thank you

85. Trinex says:

The thing that really impresses me is… how somebody can write beatifuly with a MOUSE

86. Ave atque vale says:

Press 15 for respect.

87. Immortal Jas says:

88. Michael Rogers says:

I understand how you converted the E7 to 231, I just wish you showed us how you converted the 231 to E7 in the first place.

89. Evans Ejams says:

nimrod empayar Babylonians era create hexdacimal systems….

90. Michael Greenwood says:

What is 33.60º?
What is 30.82º? Converted to layman sixty degrees mathematics please? Is the 'º' denoting hexadecimal rather than degrees? And if yes. Is reality that 45º is the same in hexadecimal as well as in a sexegisimal degree language system? IE is that just a mathematical coincident? TY.

91. Marty Dom says:

Thank you! No one really explained this in my earlier CS classes.

92. Wolfking 99 says:

I'm 13 and now I can tell anyone e who knows hexadecimal anything without anyone else knowing what's going on and I now feel like some kind of super spy

93. Sammy says:

Pay \$15 to pay respects

94. emir said haliloğlu says:

There is georgian, arabic etc translates but not Turkish ?

95. AGS-TECH Inc. - Custom Manufacturing says:

Great explanation of the hexadecimal numbering system. Thank you !

96. vishnuvardhan reddy says:

AF3 = 563

97. Sam Roberts says:

The only thing that stresses me out is how good you can type with a mouse you monster

98. Travis Dinham says:

still better than my math teacher

99. Minh Võ Trần says:

If the letter exceeds the letter F , we just simply ignore it ? How can we deal with it , e.g. 0x43x

100. Shayy Renee says:

I was super confused til I came here. You never let me down , Sal. Appreciate you!