Log in Sign up
Back to Discover
🔢

Hexadecimal

math Maturity 7-9

Computers use a special way to count.

Hexadecimal-counting.jpg
Hexadecimal-counting.jpg
They use numbers and letters. This helps them work fast. It makes big tasks easy. We use it to help computers talk. Can you find numbers in a computer?

37 words

Most people count with ten numbers. But computers use a system with sixteen.

Hexadecimal-counting.jpg
Hexadecimal-counting.jpg
This system uses numbers from zero to nine. It also uses letters from A to F.
Hexadecimal multiplication table.svg
Hexadecimal multiplication table.svg
These letters stand for values like ten or fifteen. Computers like this way of counting. It helps them show bits of data. It can even show colors on a screen. This system makes big tasks much easier.

70 words

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.

Hexadecimal-counting.jpg
Hexadecimal-counting.jpg

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.

Hexadecimal multiplication table.svg
Hexadecimal multiplication table.svg

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.

182 words

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.

Hexadecimal multiplication table.svg
Hexadecimal multiplication table.svg
It is very useful for computer hardware. Most computer hardware is built using binary code. Because hex is a power of 2, it helps humans read binary more easily. It acts as a dense way to show binary information.

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.

Hexadecimal-counting.jpg
Hexadecimal-counting.jpg
You can use either upper or lower case letters. A single hex digit represents four bits, which is called a nibble. Two hex digits together make an 8-bit byte. This makes it easier to see how much memory a computer is using.

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.

Bruce Martin hexadecimal notation proposal.png
Bruce Martin hexadecimal notation proposal.png
Some people even thought the standard A through F was silly. Bruce Alan Martin of Brookhaven National Laboratory proposed new symbols in 1968. Ronald O. Whitaker also proposed a special triangular font in 1972.

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.

Base-16 digits.svg
Base-16 digits.svg
It helps keep the complex language of computers organized and readable for us.

468 words

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.

Hexadecimal multiplication table.svg
Hexadecimal multiplication table.svg

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.

Hexadecimal-counting.jpg
Hexadecimal-counting.jpg

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.

Bruce Martin hexadecimal notation proposal.png
Bruce Martin hexadecimal notation proposal.png
Later, in 1972, Ronald O. Whitaker proposed a triangular font designed for "direct binary reading." This font aimed to allow computers to read input and output without needing complex encoding matrices.
Base-16 digits.svg
Base-16 digits.svg

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.

604 words
🖼️ Images & Media (5)
File:Bruce Martin hexadecimal notation proposal.png
Bruce Martin hexadecimal notation proposal.png
File:Base-16 digits.svg
Base-16 digits.svg
File:Hexadecimal-counting.jpg
Hexadecimal-counting.jpg
File:Hewlett-Packard Model HP-16C Programmable RPN Calculator, HP's First and Only Calculator esp. for Programmers, built 1982-1989 (edited to rectangular, V2).jpg
Hewlett-Packard Model HP-16C Programmable...
File:Hexadecimal multiplication table.svg
Hexadecimal multiplication table.svg
Up Next
🔢
Numerical digit
Math
More to explore

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.