Part 1: What is Hexadecimal?


From Greek, hexadecimal is a word meaning "sixteen."

16

16

16

16

16

16

16

16

16

16

16

16

16

16

16

16

Hexa=6 (hexagonal, hexagram, etc.)

Decimal=10

Hexadecimal=16

In the hexadecimal system, 6 letters are added to the standard 0-9 Arabic Numerals, to give you a numbering system with base 16, instead of base ten.

Decimal: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Hexadecimal: 0 1 2 3 4 5 6 7 8 9 A B C D E F 10

Counting in Hexadecimal:

Count from 0 to 9, then count A, B, C, D, E, F.

Then you reach 10 (hexadecimal 10, which corresponds to decimal 16).

Count again: 11, 12, 13, 14, 15, 16, 17, 18 , 19, then use 1 and a letter: 1A, 1B, 1C, 1D, 1E, 1F.

Then you reach 20 (hexadecimal 20, which corresponds to decimal 32).

This continues forever. For instance, B0 in hexadecimal corresponds to 176 in decimal: (B[hex] * 16[decimal]) + (0 * 1). Since B is 11 in decimal, this equation becomes (11 * 16) + (0 * 1) = 11 * 16 = 176.

Here are another few examples:

Hex.=Hex. equation=Decimal equation=Decimal
C8=(C * 10) + (8 * 1)=(12 * 16) + (8 * 1)=200
FF=(F * 10) + (F * 1)=(15 * 16) + (15 * 1)=255
100=(1 * 10 * 10) + (0 * 10) + (0 * 1)=(1 * 16 * 16) + (0 * 16) + (0 * 1)=256

To convert from decimal to hexadecimal, reverse this procedure. For instance, 178 in decimal corresponds to B2 in hexadecimal: 178 = (11 * 16) + (2 * 1) = (B * 10[hex.]) + (2 * 1) = B2. Here are another few examples:

Decimal=Decimal equation=Hex. equation=Hex.
48=(3 * 16) + (0 * 1)=(3 * 10) + (0 * 1)=30
513=(2 * 16 * 16) + (0 * 16) + (1 * 1)=(2 * 10 * 10) + (0 * 10) + (1 * 1)=201
1,000=(3 * 16 * 16) + (14 * 16) + (8 * 1)=(3 * 10 * 10) + (E * 10) + (8 * 1)=3E8

Here are some more numbers in hexadecimal and decimal. Try converting one form to the other, and back again, until you are comfortable with the process.

Hex.Dec.. Hex.Dec.. Hex.Dec.
001016C8200
111117F0240
221925FF255
991A26100256
A101B273E81,000
B111F3110004,096
C1220321000065,536
D1332501000001,048,576
E1464100FFFFFF16,777,215
F15A0160100000016,777,216

If you would rather let the computer compute hexadecimal numbers, you can try this automatic converter.

Decimal:

Hex:

For simplicity, the word "hexadecimal" is often shortened to "hex".

Technical Information for the Curious:

There are two advantages of a hexadecimal system for computers:

1. You can store more information in the same space. In a hex code with two digits you can express the numbers 0 through 255. In a decimal code with two digits you can count from 0 to 99.

2. Hexadecimal (base 16) converts easily to binary (base 2), which is used by computers. A two digit hexadecimal number can range from 0 to 255, which can be expressed in eight digits of binary code.

When dealing with computer colors, you will rarely have to deal with hexadecimal numbers larger than FF, since a hexadecimal color code is actually three numbers strung together: 0369CF is 03 and 69 and CF. Don't worry too hard about converting numbers like ABCDEFFEDCBA into decimal.

Back to Table of Contents

Continue to Part Two, The Basics of Color


© Copyright 1997 Los Trancos Systems, LLC. Used with permission. All rights reserved.