Computers use a special way to count. 
Most people count with ten numbers. But computers use a system with sixteen. 
Most people count using ten numbers. This is called the decimal system. But computers often use a different way. They use a system with sixteen numbers. This is called hexadecimal, or "hex" for short. 
To show sixteen values, hex uses digits 0 through 9. It also uses letters A through F. These letters stand for values like ten or fifteen. For example, the letter A means ten. The letter F means fifteen.
Computers use hex to make tasks easier. They often work with binary code. Binary is a system of bits. A single hex digit can represent four bits. This is called a nibble. Two hex digits make an 8-bit byte.
Programmers use different marks to show hex. Some use "0x" before the number. Others use a small number 16 at the bottom. Hex can even describe colors on a screen. It uses pairs of digits for red, green, and blue. This helps computers show many colors clearly.
Most people count using ten digits, from zero to nine. This is the decimal system we use every day. However, computers often use a different way to represent numbers. This system is called hexadecimal, or "hex" for short. Hex is a positional numeral system with a base of 16.
To make a base-16 system work, we need sixteen different symbols. We use the numbers 0 through 9 just like in decimal. For the values from ten to fifteen, we use letters. The letter A stands for ten, and B stands for eleven. C is twelve, D is thirteen, E is fourteen, and F is fifteen. 
Because hex is special, people use different marks to identify it. In math, you might see a small number 16 at the bottom. This is called a subscript. In the C programming language, you often see the prefix 0x. For example, 0x42 is a hex number. Other languages use different symbols like a dollar sign. For instance, the language Pascal uses $5A3. There are many ways to write it depending on the computer system.
Different computers in history used different ways to show these sixteen values. In the 1950s, some machines used numbers with lines over them. The SWAC and Bendix G-15 computers used lowercase letters like u, v, w, x, y, and z. The ORDVAC computer used uppercase letters like K, S, N, J, F, and L. Even the PERM computer from 1956 used the letter O for zero. 
Today, you can see hex working in many digital places. It is used to show colors on a screen in HTML and CSS. You might see six hex digits used to name a color. These digits represent the amounts of red, green, and blue. Hex is also used in web addresses called URIs. It is even used to write long ID numbers called GUIDs.
Hexadecimal, often called "hex" for short, is a positional numeral system using base 16. In our everyday decimal system, we use ten digits from 0 to 9. Hexadecimal expands this set to include sixteen distinct symbols. The first ten symbols are the standard numbers 0 through 9. To represent the values from 10 to 15, the system uses the letters A through F. These letters can be written in either uppercase or lowercase without changing their value.
This system is particularly important in the world of computing. Most computer hardware operates using binary, which is a base-2 system. Because 16 is a power of 2, hexadecimal provides a dense way to represent binary data. A single hex digit represents exactly four contiguous bits, a unit known as a nibble. When you group two hex digits together, they represent an 8-bit byte. This relationship makes it much easier for humans to read and manage long strings of binary code. 
Because hexadecimal looks similar to decimal, programmers use specific notations to identify it. In mathematics, a subscript is often used to show the base. For example, writing 159₁₆ tells the reader the number is in hex, while 159₁₀ indicates decimal. In the C programming language and many related languages, the prefix "0x" is used to denote a hex literal. For instance, 0x42 is a hexadecimal number. Other environments use different prefixes, such as the dollar sign ($) in Pascal or Delphi.
History shows that different computer architectures used various methods to represent these sixteen values. During the 1950s, some machines like the Bendix-14 used numbers 0 through 5 with an overline. The SWAC and Bendix G-15 computers used lowercase letters u, v, w, x, y, and z. Other machines, like the ORDVAC and ILLIAC I, used uppercase letters K, S, N, J, F, and L. The PERM computer in 1956 even used the letter O to represent zero. These variations show how early computing was still finding its standard ways of communicating numbers.
Some experts even questioned the standard A through F convention. In 1968, Bruce Alan Martin of Brookhaven National Laboratory suggested that the A–F choice was "ridiculous." He proposed a new set of symbols based on bit locations. 
Hexadecimal is used in many modern digital systems you might encounter. In web design, HTML and CSS use hex codes to define colors. A color can be expressed using six hex digits, representing the red, green, and blue components in order. For example, #FF0000 represents pure red. Hex is also used in URIs and character references in XML. In the Unicode standard, character values are shown as a hex number. Even IPv6 addresses use groups of four hex digits, known as hextets, separated by colons.
Beyond simple counting, hex can represent complex data types. It can express bit patterns in a processor, including signed numbers or floating-point values. For example, the negative decimal number −4210 can be written as FFFFFFD6 in a 32-bit CPU register using two's complement. Hex can even be used in exponential notation, called P notation, to represent very large or small numbers. This is required by the IEEE 754-2008 standard for binary floating-point numbers. By providing a compact way to view binary, hexadecimal remains a vital bridge between human logic and machine code.
🖼️ Images & Media (5)
More to explore
✨ What else?
Related topics you might enjoy
🔬 Go deeper
More advanced topics to explore
🪜 Step back
Simpler topics to build understanding
What is Nepedia?
A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.