Hex Color Code Pick a color or type a code to see what it means

You can enter 3, 4, 6 or 8 hex digits, with or without #. The picker changes the color and keeps any opacity you entered.

Read the code

Each pair is a number from 00 to FF in base 16, which is 0 to 255.

Color values

Hex
RGB
HSL

HSL values and opacity are rounded for display. Hex keeps the exact values.

Text on this color

White text
Black text

Check in the contrast checker

Tints and shades

Tap a step to load it. These steps change lightness while keeping hue, saturation and opacity.

Conversions run in your browser. The current color is included in the page address so you can share it.

What is a hex color code?

A hex color code writes red, green and blue as three base-16 numbers. In the six-digit form, a # is followed by two digits for red, two for green and two for blue. The digits run from 0 to 9, then A to F. Uppercase and lowercase letters have the same meaning.

The color picker lets you choose a color visually, while the field lets you enter a code you already have. The swatch and channel rows show what the code means. Copy the page address to reopen or share that color. For a display filled with one color, use the White screen tool.

How to read a hex color code

A three-digit code doubles each digit: #F80 becomes #FF8800. Four digits work the same way and include opacity. Eight digits put opacity after the red, green and blue pairs: 00 means fully transparent, and FF means fully opaque. The checkerboard behind the swatch makes transparency visible.

RGB uses the same channel values written in base 10. HSL describes hue, saturation and lightness. Hue is an angle, saturation describes how colorful the shade is, and lightness runs from black to white. A gray has no distinct hue, so this page shows zero for that angle. The CSS Color specification defines the short and full hexadecimal forms.

Hex color codes for common colors

Choose a row to load its color into the converter. These values follow the CSS named colors, including green as #008000 and purple as #800080.

Color nameHex code

These are the standard web color names. Other tools may use different shades for the same name.

Hex color code questions

How many hex colors are there?

A six-digit code has 256 possible values for each of red, green and blue. Multiplying 256 × 256 × 256 gives 16,777,216 colors. Adding an opacity pair gives 256⁴, or 4,294,967,296 combinations, including combinations that look identical when fully transparent.

What is the hex code for transparent?

CSS transparent is #00000000: black with zero opacity. The last two digits control opacity. A different red, green and blue value with 00 opacity is also fully transparent, but it is a different encoded combination.

Hex vs RGB: what is the difference?

They write the same red, green and blue values in different number bases. Hex uses base 16 and RGB usually shows base-10 numbers. This page uses comma-separated rgb() and hsl() values, or rgba() and hsla() when the input includes opacity.

Why does my color look different on another screen or in print?

Screens differ in brightness, settings and the colors they can show. Printed color uses inks and paper instead of light. The same code can therefore look different. This tool does not predict a printed match.

How do I find the hex code of a color in an image?

Most image editors offer an eyedropper that samples a point in an image and shows its color value. Sample the part you want and paste the hex value here. This page does not open images.