Binary & Hex Conversion Tool
Enter a decimal, hex or binary number into the following calculator and it will automatically convert the number into both of the remaining formats. Click reset to clear the tool if you want to use it again to convert another number.
Number Conversion Calculator
Number Conversion Table
Decimal, Binary and Hex: Definition, Uses and Importance of Numeral Systems
- Guide Authored by Corin B. Arenas, published on October 30, 2019
Ever notice how we usually count based on 10? For instance, it’s no coincidence we use $20, $50 and $100 bills. These values make it a lot easier to compute money.
If you’ve worked with computer programming systems, you’re likely to know numeral notations with binary and hex codes. Maybe you’ve also noticed when a type of numeral system is better to use.
In this section, we’ll learn more about the decimal, binary and hexadecimal numeral systems, including their origins and real-world applications.
What is the Decimal System?
The decimal numeral system, also known as the base-10 system, is commonly used for reading and denoting numbers. It represents a fraction or other real numbers using digits 0 to 9. Decimals refer to numbers with a point, or numbers after the decimal point which represent decimal fractions.
The Origin of Decimals
In the book Number: The Language of Science, mathematician Tobias Danzig said many early civilizations read and calculated numbers based on 10, which is possibly derived from counting all ten fingers in both hands.
Mathematics historian Georges Ifrah says that Egyptian hieroglyphs from 3000 BCE are proof that early Egyptians used an exclusive decimal system.
Around 500 B.C., the Indian civilization developed a number writing system called brahmi that consisted of 9 numerical symbols and a zero. A noteworthy Indian mathematician from the 12th century is Bhāskara II, who created the first full systematic text on the decimal numeral system.
Towards the end of 4th century B.C., decimal fractions were first formulated by Chinese mathematicians. In the 18th century B.C. to 1450 B.C., the numeral system of Greece was also based on 10, which contained Roman numerals with an intermediary base of 5.
Today, the decimal system is called base-10 because it’s based on multiples of 10. While there is no individual symbol for ’10,’ we place 1 and 0 together to represent the value of 10.
Notice that after counting from zero to 9, you go back to zero and add 1 to the left of the digit to build the next set of numbers.
Example: 8, 9, 10, 11, 12, 13, 14, 15 … 19, 20, 21, 22, 23, 24, 25 …
Decimals are also referred to as a positional notation, which is a method of expressing numbers with digits arranged in succession. The position of a number has a corresponding value, and the number is equal to the sum of the products of each digit by its place value. See the image below.
The position to the left of the decimal point is called ‘ones,’ and the position to the right is called ‘tenths.’ Each place value is a multiple of its base. This means every decimal place toward the left is 10 times greater, while every decimal place to the right is 10 times smaller.
Apart from base-10, there are other number systems you can use. Notable bases include the Hexadecimal (hex) system that uses base-16 and the Binary system that uses base-2.
Below is a table from Tyler’s Guides with multiples of 10 corresponding to different bases:
To convert decimal numbers to binary and hex digits, simply use the calculator on top of this page.
The basic principles are essentially similar for all number systems, but they are easier to learn if you’re familiar with the decimal system.
You’ll notice a place value is twice the value of the number on the left. Again, this occurs because each place value is a multiple of its base. Below shows how each numbers increases by multiples of 10, 2 and 16.
- Decimal – 1 x 10 = 10, 10 x 10 = 100, 100 x 10 = 1,000
- Binary – 1 x 2 = 2, 2 x 2 = 4, 4 x 2 = 8
- Hex – 1 x 16 = 16, 16 x 16 = 256, 256 x 16 = 4,096
Each digit has a place value that’s dictated by its base and relative position. 1 (ones place value) in decimal is the same in binary and hex. But when we move to 10 (tens place value), 10 in binary is 2, 16 in hex, and so on.
We’ll discuss how other number systems work in the latter sections of this article.
The Significance of the Decimal System
Calculating huge sums based on 10 is a lot easier than other numbers like, for example, 6, 9 or 16.
Multiples of 10 don’t take that long to divide, multiply, add and subtract. It’s also useful for large sums and decimal fractions, making it simpler to round off numbers closest to the next place value.
But apart from commerce, one of the most valuable uses of the base-10 numeral system is best shown in metric conversion.
Scientists intentionally assigned a base-10 notation to the metric system. This allowed direct conversion of smaller or larger units just by moving decimal places. See the example below.
For instance, 1 m is equal to 100 cm, and 1 m is equal to 1000 mm. If you move decimal places to the right, you can convert to smaller units, from meter to centimeter and millimeter easily. This conversion technique is consistent even with different values.
It eliminates the tedious task of manually computing data for conversion. The metric system assigned international standards which help schools, research facilities and scientific communities present data consistently.
Decimal Calculations for Computer Systems
According to Werner Buchholz’s Finger’s or Fists? The Choice of Decimal or Binary Representation, majority of modern computer software and hardware internally use binary codes, while earlier systems like the ENIAC (Electronic Numerical Integrator And Calculator) employed decimal codes.
However, generally, most binary representations are still converted from or to its corresponding decimal values. Computer programs express literals, or notations that denote fixed values in a source code, in decimal form.
Furthermore, both software and hardware applications employ decimals for performing arithmetic and storage of decimal values.
This is necessary for financial computations such as getting integer multiples with the smallest unit for accounting purposes. The operation can only be done in a decimal numeral system, which is impossible with the limitations of binary numbers.
Since we are used to this system, it’s no wonder decimals are used in currencies and global trade.
What is the Binary Number System?
A binary system is a positional numeral system which employs 2 as its base value. Unlike decimals that use 0 to 9 to represent numbers, it only uses digits 0 and 1. This means numbers denoting 0 to 10 have their corresponding binary form.
In digital communications and computing, each binary digit is called a bit. It is considered the smallest unit of data in a computer. A byte, on the other hand, consists of 8 bits in sequence.
The binary numeral system is practically used in most computers and digital devices.
A Brief History of Binary Numbers
Around the 16th and 17th century, modern binary system was developed in Europe. But prior to that, ancient cultures including India, China and Egypt have used associated binary numeral concepts.
The American Journal of Physics notes that English astronomer Thomas Harriot studied different positional number systems together along with the binary system, which were later found in his unpublished papers.
In 1703, German polymath and philosopher Gottfried Leibniz analyzed binary numbers and published Explication de l’Arithmétique Binaire. Leibniz studied hexagrams of the I Ching, an ancient Chinese divination text, as proof of binary calculus.
Towards 1854, English mathematician George Boole developed Boolean algebra, where algebraic variables were valued as true or false. This later became fundamental in the development of digital electronic circuitry.
By around 1935, German computer scientist Konrad Zuse started designing the Z1 computer, employing the use of binary floating-point arithmetic and Boolean algebra. It was the first freely programmable computer in the world, which was an electrically driven mechanical calculator.
The Importance of the Binary System
Binary numbers are used in place of decimals to simplify codes in computer design. Because it only uses two symbols, computers and most digital systems work more efficiently with this system.
Since electricity flows in an on or off current, the binary nature of the digits allows programmers to easily replicate an on or off system. Computers and practically any digital device use this ON (1) or OFF (2) switch to process binary commands in electric circuits.
What does it do, exactly? Every key in your computer or digital device corresponds to an 8-bit binary digit. This makes it possible to type in computers and enter all sorts of commands. It’s the chief component which allows us to operate smartphones, digital video recorders, music players, video games and more.
For instance, capital C is actually 01000011 in binary code, while the lowercase C is 01100011. Check out the table below for the full alphabet in binary code representation.
|Alphabet in Binary, Capital Letters||Alphabet in Binary, Lowercase Letters|
|A – 01000001||a – 01100001|
|B – 01000010||b – 01100010|
|C -01000011||c – 01100011|
|D – 01000100||d – 01100100|
|E – 01000101||e – 01100101|
|F – 01000110||f – 01100110|
|G – 01000111||g – 01100111|
|H – 01001000||h – 01101000|
|I – 01001001||i – 01101001|
|J – 01001010||j – 01101010|
|K – 01001011||k – 01101011|
|L – 01001100||l – 01101100|
|M – 01001101||m – 01101101|
|N – 01001110||n – 01101110|
|O – 01001111||o – 01101111|
|P – 01010000||p – 01110000|
|Q – 01010001||q – 01110001|
|R – 01010010||r – 01110010|
|S – 01010011||s – 01110011|
|T – 01010100||t – 01110100|
|U – 01010101||u – 01110101|
|V – 01010110||v – 01110110|
|W – 01010111||w – 01110111|
|X – 01011000||x – 01111000|
|Y – 01011001||y – 01111001|
|Z – 01011010||z – 01111010|
Computer Networking and Image Colors
If you notice, networking speeds are referred to in bits per second. If you the speed is 100 megabits or 100 Mbps, that means the data transfer rate is 100 million bits per second.
Bits are transferred using light pulses and electrical signals to a computer network. Bit-oriented protocols, like point-to-point protocols, receive and send data in bit sequences.
Moreover, IP and MAC addresses that allow you to communicate with other networks are usually represented as bits that look like these:
When it comes to digital graphics, color depth is commonly measured in bits. True color graphics possess 24-bits or 32-bits and up for higher picture quality. Monochrome images have 1 bit, while 8-bit images have 256 colors or gradients in gray scale.
Binary numbers are also used to encrypt data and protect information in computer networks. These special numbers called keys are expressed in bits.
The more bits in the sequence, the more protection the key provides in safeguarding data. For instance, in wireless network security, a 40-bit WEP key is not as secure as a 128-bit WEP key.
What are Hexadecimals?
According to Wolfram Mathworld, the hexadecimal, is the base-16 notation for representing real numbers.
It uses 16 symbols to signify different values, including numbers 0 to 9 and the letters A to F to represent numbers 10 to 15.
Counting in hex might seem confusing, but you just have to remember that 16 symbols make up each number. Similar to how we add 1 to the left of a number after completing a base-10 sequence, we do the same thing when we count in hex.
To give you an idea, here’s how to count from 0 to 20 in hex.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10—after F which is 15, your next digit should be 10 which is equivalent to 16, and 11 which is equal to 17, and so on. Continue counting until 19, after which you use a letter and add 1 to the left of the letter.
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20—Here, hex 19 is equal to 25, which makes 1A equal to 26, and 1B equal to 27. Once you get to hex 20, it’s equal to 32.
There are also various classifications for different types of hex numbers, these include:
- Metadromes – numbers with increasing digits
- Plaindromes – numbers with nondecreasing digits
- Nialpdromes – numbers with nonincreasing digits
- Katadromes – numbers with decreasing digits
A Brief History of Hex
Back then, the letters A to F weren’t used to denote values above 9 in early versions of the computer.
In 1952, the ILLIAC computer used uppercase letters K, S, N, J, F, and L to represent numbers 10 to 15. By 1964, a computer called Pacific Data System 1020 used letters L, C, A, S, M, and D.
As you can see, there were no traditional numerals that stood for values between 10 to 15. Many proposals have been suggested over the decades, but letters A to F are now being used today.
The Importance of Hex in Computer Programming
Apart from binary codes, computers and digital devices also use hexadecimal numbers. For instance, error codes such as the infamous Microsoft Window’s blue screen of death is expressed in hex.
Writing numbers in hexadecimals provide a more accessible representation of binary codes.
Compared to the binary system, hex numbers use digits that are closer to the format of base-10 numbers. This makes it easier to read and analyze how large or small a value is.
Moreover, it has greater information density. Here, 1 byte is represented by 2 hex numbers equivalent to 2 4-bit values. Hex can easily express any value between 0 to 255. To write the same values in binary within this range requires at least 8 digits. Larger values require more numbers in binary, which make it harder to read.
For instance, 11111111 is a binary form that can easily be converted to 1FF in hexadecimal form.
Hexadecimal Colors in HTML
|Color||HTML / CSS
Example hexadecimal color palette. You can generate a palette using our web safe color calculator.
The development of computers inevitably paved the way for the Internet. HTML or hyper-text markup language is still used to code websites. It works by transmitting data from servers to terminals, making the web a savvy research tool.
HTML soon integrated a way to replicate text and background images with a total of 16,777,216 different colors. This wide color range was made possible through hexadecimal notation.
A hex color is expressed as a 6-digit combination of digits and letters which correspond to a mix of red, green and blue. The amount of each color dictates the resulting hue. Today, graphics technology has developed way above the previous color limit.
For simple colors, here’s how hexadecimal codes are used in HTML:
- <font color=”#FF0000″> RED </font> (RED), where FF is equal to 255 for pure red, 00 for zero green, and 00 for zero blue.
- <font color=”#00FF00″> GREEN </font> (GREEN)
- <font color=”#0000FF”> BLUE </font> (BLUE)
- <body bgcolor=”#FFFFFF”> produces an all-white background </body>
- <body bgcolor=”#CCCCCC”> produces a light-gray background </body>
The Bottom Line
There are different numeral systems which help us perform calculations easier. The most frequently used of all is the base-10 decimal system, which is also the basis for the metric system.
On the other hand, other numerical notations like the binary and hexadecimal systems are used mostly for engineering digital devices and programming computers.
Binary notations are used for digital circuitry in keypads, IP addresses for computer networks and WEP keys for protecting data. Meanwhile, hex is used in most computer systems as a substitute for binary codes. It simplifies notations that are otherwise too long and inaccessible for the system.
Both binary and hex notations can be converted to decimal numbers.
About the Author
Corin has worked as a health and fitness writer and researcher since 2016. She is interested in longevity research and how to improve the quality of human life. Her other feature articles can be read at Inquirer.net and Manileno.com.