How to Read Hex Color Codes - Hexadecimal Color (2024)

Whether you are a digital artist who works with Adobe Creative Suite, in a 3D application, or through UX design, you’ve probably used hex colors. But even if you use hex every day, there is a good chance you might not really understand what’s going on with those letter/number combinations.That’s where this handy guide to reading hex color codes comes in.

What is a hex code?

Hex color codes are one type of HTML color code that you’ll often hear referred to as hexadecimal color or hex. The reason to use hexadecimal numbers is it’s a human-friendly representation of values in binary code.

How to Read Hex Color Codes - Hexadecimal Color (1)

What do the numbers and letters in a hex code mean?

Hex color codes start with a pound sign or hashtag (#) and are followed by six letters and/or numbers. The first two letters/numbers refer to red, the next two refer to green, and the last two refer to blue. The color values are defined in values between 00 and FF (instead of from 0 to 255 in RGB).

Numbers are used when the value is 1-9. Letters are used when the value is higher than 9. For example:

  • A=10

  • B=11

  • C=12

  • D=13

  • E=14

  • F=15

To get a hexadecimal color, follow these three steps:

  1. Multiply the first number by 16.

  2. Multiply the second number by 1.

  3. Add the two totals together.

Understanding Hex to RGB for Context

A good place to start before moving on to reading hex color codes is learning how to understand RGB colors. RGB numbers are based upon monitor settings of red, green, and blue light. By changing the RGB numbers, you’re telling your monitor how much of that particular light color you want to shine.

What are RGB color codes?

In the RGB color system, colors are presented like this:

RGB(255, 0, 0)

RGB defines the values of red (the first number), green (the second number), or blue (the third number). The number 0 signifies no representation of the color and 255 signifies the highest possible concentration of the color.

So, in the above example, you get the brightest red possible without any green or blue presented. If you wanted only green, you’d use RGB(0, 255, 0) and for blue, RGB(0, 0, 255). For other colors, you’ll use a combination of color values to achieve the look you want.

Difference between Hex color codes and RGB codes

By understanding what the numbers stand for in hex color codes, you'll be able to better predict what color you might see. There's not too much of a difference between using a hexadecimal or RGB color, except that in CSS, it's possible to also add an alpha value, so you'll really have a RGBA color.

This can be super helpful if you want to control the opacity of a color. Adding an alpha value to your RGB is certainly one of the easiest ways to change opacity.

How to read hex color codes

Once you really understand RGB you can move on and learn how to read hex codes. It’s really quite simple once you know the formula. As mentioned above, values 1-9 are stated numerically. However, for values that are 10 and higher, letters replace the numbers. So, A=10, B=11, C=12, and so on.

Now, to calculate the hexadecimal number, there are three quick steps (as also stated above):

  1. Multiply the first number (or converted number from the letter) by 16.

  2. Multiply the second number (or converted number from the letter) by 1.

  3. Add those two totals together to get a single value.

Example hex color code calculation

For example, the hexadecimal number for the number 83 is actually 131. We come to this conclusion by:

  1. Multiplying the 8 in 83 by 16 (8x16=128).

  2. Multiplying the 3 in 83 by 1 (3x1=3).

  3. Adding the two totals together (128+3=131).

Another way to think of it is:

(8x16) + (3x1) = 131

Working with letters is the same concept. For example, FF = 255 because you multiply the number that represents F (15) by 16, then multiply the number that represents the second F (15) by 1. Then add the two totals together to equal 255. Recognize that the number 255 is the same as the RGB number 255, which is bright red.

If you would rather not perform mental calculations, use anRGB to HEX conversion tool.

Estimating hex codes in the real world

Once you understand the numbers, you’ll be able to predict what a color will look like based upon the intensity of red, green, and/or blue values. So, if you know that maximum red without green or blue is #FF0000, then you can mentally adjust the values a bit to get an estimate for a different color.

Another example of a hex color code is #7DD0D7, which gives you a greenish-blue.

How to Read Hex Color Codes - Hexadecimal Color (2)

How to Read Hex Color Codes - Hexadecimal Color (3)

Common Hex to RGB conversions

It can be helpful to memorize some of the most common hex color codes, not only for when you want to use those exact colors but to help you better predict what other colors will be when seeing a hex color code.

  • Red = #FF0000 = RGB(255, 0, 0)

  • Green = #008000 = RGB(1, 128, 0)

  • Blue = #0000FF = RGB(0, 0, 255)

  • White = #FFFFFF = RGB(255,255,255)

  • Ivory = #FFFFF0 = RGB(255, 255, 240)

  • Black = #000000 = RGB(0, 0, 0)

  • Gray = #808080 = RGB(128, 128, 128)

  • Silver = #C0C0C0 = RGB(192, 192, 192)

  • Yellow = #FFFF00 = RGB(255, 255, 0)

  • Purple = #800080 = RGB(128, 0, 128)

  • Orange = FFA500 = RGB(255, 165, 0)

  • Maroon = #800000 = RGB(128, 0, 0)

  • Fuchsia = #FF00FF = RGB(255, 0, 255)

  • Lime = #00FF00 = RGB(0, 255, 0)

  • Aqua = #00FFFF = RGB(0, 255, 255)

  • Teal = #008080 = RGB(0, 128, 128)

  • Olive = #808000 = RGB(128, 128, 0)

  • Navy = #000080 = RGB(0, 0, 128)

Find more hex color codes or pick an HTML color and get its coinciding name and codes.

Beyond hex color codes: Choosing a color scheme

The quickest way to choose a color scheme for your project is to use a color palette tool that allows you to search groupings by:

  • Color

  • Style

  • Keyword

  • Hex value

  • Schemes based on what is trending or popular

The same tool allows you to generate your own scheme by randomly picking and locking in colors that you like and that look good together.

Once you have chosen a color scheme, you can:

  • Create a collage

  • Explore and create a gradient

  • Check the contrasts

  • Adjust the hue, saturation, brightness, and temperature

Each color is assigned a hex color code for you to use. In the end, you’ll have a custom color scheme that perfectly personifies your project.

But, before you settle on a palette, remember these color design tips:

  • Consider the context.

  • Refer to the color wheel.

  • Choose a monochromatic, triadic, or split complementary color scheme.

  • Think beyond the presets.

FAQs about hex color codes

We know you have more questions about hex colors, which is why we’ve put together this quick-reference FAQ section.

What does 'hex' mean?

Hex is short for Hexa, which is Greek for the number six.

When should I convert hex to RGB (or vice versa)?

While both systems work, consistency is of utmost importance. When designing for a specific brand, check their brand guide regarding which system to follow and convert colors accordingly.

How do I get the hex color code for a color in an image?

There are many free online color picker tools that make it very easy to get the hex color code for a specific image.

Generally, all you have to do is either paste in an image URL or upload your image into the color picker tool and select a color pixel. You’ll get the hex color code and RGB values.

How do I change the hex color in Adobe Illustrator?

To change the hex color in Adobe Illustrator, follow these steps:

  1. In a new Illustrator document, press F6.

  2. Double-click the stroke or fill box in the Color window.

  3. Double-click inside the box next to the #.

  4. Type the new hex color code into the box.

  5. Click OK.

Hex color tools in this guide

We’ve given you a bunch of useful tools throughout this guide, so here they are again in one place:

Wrapping up hex color codes

To wrap it all up, here are a few reminders:

  • Hex and RGB color types are for onscreen use when designing websites.

  • In CSS, it’s possible to add an alpha value to control the opacity of a color.

  • For a brand, consistency of color is key.

  • Always strive to learn more about your work by reviewing resources and taking courses, both offered by Pluralsight!

How to Read Hex Color Codes - Hexadecimal Color (2024)

FAQs

How to Read Hex Color Codes - Hexadecimal Color? ›

A HEX is a 6 digit sequence. The first 2 digits tell us how much Red is used, the next two digits tell us how much Green there is, and you guessed it, the last 2 digits relate to how much Blue is in the mix.

How do you read hex color codes? ›

Hex color codes start with a pound sign or hashtag (#) and are followed by six letters and/or numbers. The first two letters/numbers refer to red, the next two refer to green, and the last two refer to blue. The color values are defined in values between 00 and FF (instead of from 0 to 255 in RGB).

How do you read hexadecimal easily? ›

The hexadecimal color system is easy to understand, once you know how it works. The first two digits are the red value, the next two are the green value, and the last two are the blue value. Here are some examples: #FFFFFF is white, while #000000 is black.

How do you decode hex color code? ›

Color codes chart
Color nameHex(H,S,L)
White#FFFFFF(0°,0%,100%)
Red#FF0000(0°,100%,50%)
Lime#00FF00(120°,100%,50%)
Blue#0000FF(240°,100%,50%)
12 more rows

How do you analyze hex code? ›

Summary – Reading HEX Color Codes

We always multiply the first number of each pair by 16, then add the two numbers together to get our R, G, or B value. The closer that number is to 255, the brighter and more saturated it is. The closer these values are to 0, the darker and less colorful it is.

What is a 4 digit hex color? ›

The Four Digit Hex Color can be used as the shorthand for the 8 Digit Hex Color. Four Digit Hex color can be used to define the color of your elements with CSS like 8 Digit Hex Color. There are 8 characters in 8-digit hex color that shrinks to 4 in 4-digit hex color but performance is the same as the color.

What is hexadecimal for dummies? ›

Out of many types of number representation techniques, the Hexadecimal number system is one having a value of base 16. So Hexadecimal numbers have 16 symbols or digital values, i.e 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F. A, B, C, D, E, F are single bit representations of 10, 11, 12, 13, 14 and 15 respectively.

How do you work out hexadecimal code? ›

To convert:
  1. If the denary number is bigger than 16, divide it by 16. Take the hex equivalent of this result - this represents the first digit. Take the hex equivalent of the remainder - this represents the second digit.
  2. If the denary number is smaller than 16, take the hex equivalent of the denary number.

What is an example of a hex code? ›

HEX Color Values

For example, #ff0000 is displayed as red, because red is set to its highest value (ff), and the other two (green and blue) are set to 00. Another example, #00ff00 is displayed as green, because green is set to its highest value (ff), and the other two (red and blue) are set to 00.

How to translate hexadecimal? ›

What is the hexadecimal to decimal formula? There's no specific formula for the conversion. To convert a hexadecimal number into decimal, multiply each digit with the corresponding power of 16 (starting from the rightmost digit multiplied by 160). Finally add up the products.

What is the format of a hex color code? ›

A hex color code is a 6‑symbol code made of up to three 2‑symbol elements. Each of the 2‑symbol elements expresses a color value from 0 to 255. The code is written using a formula that turns each value into a unique 2‑digit alphanumeric code. For example, the RGB code (224, 105, 16) is E06910 in hexadecimal code.

How to read hex color code? ›

They are always a six-digit code, which contains three pieces of information:
  1. The first two digits provide information about the amount of Red in a color.
  2. The second two digits provide information about the amount of Green.
  3. The last two digits provide information about the amount of Blue.

How do you read hex digits? ›

The first nine numbers (0 to 9) are the same ones commonly used in the decimal system. The next six two-digit numbers (10 to 15) are represented by the letters A through F. This is how the hex system uses the numbers from 0 to 9 and the capital letters A to F to represent the equivalent decimal number.

How do I convert hexadecimal to readable text? ›

In order to convert a hex string into a normal string, the hex string has to be converted into a byte array, which is indexed and converted into smaller hex strings of two digits. The smaller hex strings are then concatenated into a normal string. For some values, a two digit hex string will start with a zero.

What do hex colour codes mean? ›

Designers and developers use HEX colors in web design. A HEX color is expressed as a six-digit combination of numbers and letters defined by its mix of red, green and blue (RGB). Basically, a HEX color code is shorthand for its RGB values with a little conversion gymnastics in between.

What do the numbers stand for in a hex color? ›

A hex color code is structured as follows: The first two digits represent the red component. The next two digits represent the green component. The last two digits represent the blue component.

How do you describe a color from a hex code? ›

The six digits of a hex code are in fact three two-digit numbers, each representing the level of red, green and blue. So #000100 is zero red, the darkest possible shade of green without being totally black, and zero blue.

What does 8 digit hex color mean? ›

The Eight Digit Hex color is as simple as Six Digit Hex color it contains 8 digits rather than six, it is used to define the color of your elements with the CSS. It has a prefixed hash(#) value before the digits like six-digit hex code.

Top Articles
Latest Posts
Article information

Author: Sen. Emmett Berge

Last Updated:

Views: 6196

Rating: 5 / 5 (60 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Sen. Emmett Berge

Birthday: 1993-06-17

Address: 787 Elvis Divide, Port Brice, OH 24507-6802

Phone: +9779049645255

Job: Senior Healthcare Specialist

Hobby: Cycling, Model building, Kitesurfing, Origami, Lapidary, Dance, Basketball

Introduction: My name is Sen. Emmett Berge, I am a funny, vast, charming, courageous, enthusiastic, jolly, famous person who loves writing and wants to share my knowledge and understanding with you.