Category: 

What is a Hexadecimal?

Article Details
  • Written By: Brendan McGuigan
  • Edited By: Andrew Jones
  • Last Modified Date: 08 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
Roughly one-fifth of the world's stock of gold - worth over $200 billion USD - is stored under the streets of London.  more...

September 30 ,  1949 :  The Berlin Air Lift ended.  more...

Hexadecimal is a base-16 counting system, meaning that each digit represents sixteen different numbers, as opposed to the ten numbers in our base-10 system. The system is generally represented using the numbers 0-9 for the first ten digits, and then the letters A-F for the next six digits. It is not a historical counting system, but has its origins in the electronic age, as it is a fairly user-friendly way to expand on a binary system.

Computers operate using a simple base-2 counting system, called binary. This, however, can get fairly cumbersome for humans to interact with. Hexadecimal offers a more efficient way to relate to binary values. This is because sixteen is two to the fourth power, so that a single digit can be looked on as four binary digits. To put it another way, any four digit value in binary can be expressed in a single digit of "hex," and eight digit value in binary can be expressed in two digits of hex, and so on. This is in contrast to the base-10 system we commonly use, which would not evenly match binary digits in any consistent multiple.

Ad

While there are larger base systems used in computing, such as the base-32 system, and the base-64 system, hex is substantially easier for most people to interact with, so it remains the most pervasive. Base-32 and base-64 both have applications in computing, but they are rarely used in anything, but the deepest levels of coding. Although it takes some getting used to, even non-programmers often find themselves using hexadecimal regularly, and quickly getting an aptitude for it.

For example, many designers who use graphic design programs become accustomed to the use of hexadecimal codes to represent the colors used. Hex is an ideal shorthand, because the color codes on most computers are made up of three values from 0 to 256, one for red, one green, and one for blue. The RGB, or red-green-blue, number 256 is simply 16 to the second power, and so can be expressed with two digits. So, for example, the color cobalt green can be represented with an RGB value of 61,145,64, or simply the hexadecimal value of #3D9140.

Counting in hexadecimal, as with any base system, is rather straight-forward, although it can look complex at first glance. Counting to fifty, for example, would look like: 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 2B, 2C, 2D, 2E, 2F, 30, 31, 32. Note that it looks like the count finished on the number 32, but actually that is how the number 50 is represented in hexadecimal. Because hexadecimal is fundamentally based on the binary system, there are interesting simplicities that appear when we work with powers of two. For example, 24 is simply 10, 25 is 20, 26 is 40, 27 is 80, 28 is 100, 29 is 200, and so on.

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}