Nepedia
Back to Discover
Fluent Reader
🔢

Hexadecimal

math Maturity 7-9 Next article →

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
Hexadecimal multiplication table

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
Hexadecimal-counting

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
Bruce Martin hexadecimal notation proposal

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
Base-16 digits

It helps keep the complex language of computers organized and readable for us.

440 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ 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
More to explore

🔬 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.