The hexadecimal number system, also calledBasis-16or sometimes justhexadecimal, is a numeric system that uses 16 unique symbols to represent a specific value. These symbols are 0-9 and A-F.
The number system we use in everyday life is calledDecimal, or base-10 system, and uses the 10 symbols from 0 to 9 to represent a value.
Where and why is hex used?
Most error codes and other values used on a computer are presented in hexadecimal format. For example, error codes are mentionedStoppcodes, which are shown in aTodes Bluescreen, are always in hexadecimal format.
Programmers use hexadecimal numbers because their values are shorter than if they were decimal and displayedA lot ofshorter than binary, which only uses 0 and 1.
For example, the following values are equivalent:
- Hex: F4240
- Decimal: 1.000.000
- Sense: 1111 0100 0010 0100 0000
Another place where hexadecimal is used is likeHTML color codeto express a specific color. For example, a web designer would use the hexadecimal value FF0000 to define the color red. This breaks down asFF,00,00,which defines the set of red, green, and blue colors to use (RRGBBB); 255 Red, 0 Green, and 0 Blue in this example.
The fact that hexadecimal values up to 255 can be expressed as two digits, and HTML color codes use three sets of two digits, means that there are over 16 million (255 x 255 x 255) possible colors that can be expressed in hexadecimal. save a lot of space instead of expressing them in a different format like decimals.
Yes, binary is a lot easier in some ways, but it's harderread binary valuesas hexadecimal values.
How to count in hex
Counting in hexadecimal is easy as long as you remember that each set of numbers has 16 characters.
In decimal format, we all know that we count like this:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,... Adding a 1 before the set of 10 numbers begins again (i.e. the number 10 ).
But in hexadecimal format, we count like this, including all 16 digits:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,10,11,12,13 ... again add a 1 before the start 16 Numbers redefined.
Here are some examples of tricky hex "transitions" that you might find useful:
How to convert hex values manually
Adding hexadecimal values is very simple and actually very similar to counting numbers in decimal.
A standard math problem like 14+12 can usually be solved without writing anything down. Most of us can do that in our heads—that's 26. Here's a helpful perspective:
14 breaks down into 10 and 4 (10+4=14), while 12 breaks down into 10 and 2 (10+2=12). Adding 10, 4, 10 and 2 makes 26.
When three digits are entered, like 123, we know we need to look at all three digits to understand what they really mean.
3 only exists because it is the last number. If the first two are removed, 3 is still 3. The 2 is multiplied by 10 because, like in the first example, it is the second digit of the number. Again, take the 1 out of that 123 and you're left with 23, which is 20 + 3. The third number from the right (1) is considered 10 twice (for 100). This means that 123 becomes 100+20+3 or 123.
Here are two other ways to look at it:
... (NorteX102) + (NorteX101)+ (NorteX100)
... (Nortex 10 x 10) + (NorteX10) +Norte
Substitute each digit in the appropriate place in the formula above to convert 123 to: 100 (1x 10 x 10) + 20 (2X10) +3, or 100 + 20 + 3, so 123.
The same is true when the number is in thousands, like 1234. The 1 is really 1 x 10 x 10 x 10, making it to the thousandths place, 2 to the hundredths place, and so on.
Hexadecimal is done the same way, but uses 16 instead of 10 because it's a base-16 system instead of base-10:
... (NorteX163) + (NorteX162) + (NorteX161)+ (NorteX160)
For example, suppose we have the problem 2F7+C2C and want to know the decimal value of the answer. You must first convert the hexadecimal digits to decimal and then simply add the numbers together like you would in the previous two examples.
As we explained earlier, zero through nine are exactly the same in decimal and hexadecimal, while numbers 10 through 15 are represented by the letters A through F.
The first number to the right of the hex value 2F7 stands alone, as in decimal, resulting in 7. The next number to the left of that needs to be multiplied by 16, just like the second number of 123. (the 2 ) above needs to be multiplied by 10 (2 x 10) to get the number 20. Finally, the third number from the right needs to be multiplied twice by 16 (yielding 256), since a decimal number needs to be multiplied twice by 10 (or 100) if it has three digits.
then they break2F7in our problem it makes 512 (2X 16 X 16) + 240 (FX16) +7, resulting in 759. As you can see, F is 15 because of its position in the hex string (seeHow to count in hexabove): it is the last number of the possible 16.
C2Cis converted to decimal as follows: 3.072 (C X 16 X 16) + 32 (216) +C = 3116
Again, C equals 12 because it has the value 12 if you count from zero.
This means that 2F7+C2C is really 759+3116, which equals 3875.
While it's good to know how to do this manually, it's much easier to work with hex values using a calculator or converter.
Calculator and hexadecimal converter
A hex converter is useful when you want to convert hex to decimal or decimal to hex but don't want to do it manually. For example, if you enter the hexadecimal value 7FF into a converter, you will immediately know that the corresponding decimal value is 2047.
There are many hex converters online that are really easy to use,Hex to Binary Converter,SubnetOnline.com,RapidTables, SheJP-Toolsare just some of them. Some of these sites not only allow you to convert hex to decimal (and vice versa), but also convert hex to binary, octal, ASCII and more.
Hexadecimal calculators can be just as useful as decimal system calculators, but for use with hexadecimal values. For example, 7FF plus 7FF is FFE.
math campThe hexadecimal calculator supports the combination of number systems. An example would be adding a hexadecimal value and a binary value and then displaying the result in decimal format. It is also compatible with octal.
EasyCalculation.comis an even easier-to-use calculator. It subtracts, divides, adds and multiplies any two hex values you give it and instantly displays all the answers on the same page. It also shows the decimal equivalents next to the hex answers.
Learn more about hexadecimal numbers
Worthexadecimalis a combination ofhexa(which means 6) andDecimal(10). Binary is base-2, octal is base-8 and of course decimal is base-10.
Hexadecimal values are sometimes written with the prefix0x(0x2F7) or subscript (2F7sixteen), but does not change the value. In both examples, you can keep or remove the prefix or subscript, and the decimal value is still 759.
HimWindows registryis a place where you can find hex values on a computer. Especially when it comes to DWORD and QWORDregistry values.
frequently asked Questions
Is hexadecimal a programming language?
Hex code is technically a low-level programming language since programmers use it to translate binary code. The processor cannot understand the hexadecimal code. It's just a shortcut for programmers.
Who Invented Hex Notation?
The Swedish-American engineer John Williams Nystrom developed the hexadecimal notation system in 1859. Also known as the tonal system, Nystrom's original proposal found applications in many fields, including mathematics and metrology.
What is a steam hexagon?
If you use theSteam-Gaming-Service, your steam hex is the same as your steam id represented in hex.