Saved

Press the star next to a tool's name to save it.

All my tools

Color Picker

Choose a color with this color picker, or type a HEX or RGB code, and copy the color in HEX, RGB and HSL. Lighter and darker shades are shown below, and a click picks any of them.

Click a code to copy it, or click a shade to pick it. HEX codes can have 3 or 6 digits.

Your color

Pick a color to see its codes.

A color picker lets you choose a color visually and get the code you need to use it in a website, an app, a document or a design tool. Pick a color with the color box, or type a code you already have, and this color picker shows the same color in HEX, RGB and HSL, ready to copy. It also gives a row of lighter and darker shades, handy for buttons, borders and backgrounds.

How to use the color picker

  1. Choose a color. Click the color box and pick from your device's color chooser, or type a HEX or RGB code.
  2. Copy the code. Click HEX, RGB or HSL to copy it.
  3. Try a shade. Click any shade to make it the current color.

HEX color codes

A HEX code writes a color as its red, green and blue parts in hexadecimal, from 00 to ff (0 to 255). In #2E86DE, 2E is the red, 86 the green and DE the blue. A three-digit code is short for six digits, with each digit doubled: #abc means #aabbcc. HEX codes are not case-sensitive, so #2e86de and #2E86DE are the same color. CSS also accepts four- and eight-digit codes that add transparency.

RGB and HSL

  • RGB gives the red, green and blue values as numbers from 0 to 255, such as rgb(46, 134, 222). It is the same color as the HEX code, written in decimal.
  • HSL describes a color by hue (its position on the color wheel, 0 to 360 degrees), saturation (how strong it is) and lightness (from black to white). It is easy to adjust: change only the lightness to get a lighter or darker version.

Shades and tints

The shades row mixes your color with white for lighter tints and with black for darker shades, in steps of 20%. A palette built from one color this way tends to look consistent.

Tips for choosing colors

  • Make sure text has enough contrast with its background so it is easy to read.
  • Use one main color, with lighter and darker shades of it for hover states and borders.
  • Screens show colors slightly differently, so check your colors on more than one device.

Every format the color picker shows

Besides HEX, RGB and HSL, the result lists six more ways to write the same color. Each row is a button: click it to copy that code. Here is the starting color, #2E86DE, in all nine:

FormatValueWhere it’s used
HEX#2E86DECSS, design apps, most color fields
RGBrgb(46, 134, 222)CSS and code
HSLhsl(210, 73%, 53%)CSS, when you want to tweak lightness
RGBArgba(46, 134, 222, 1)CSS with transparency
HSVhsv(210, 79%, 87%)Color wheels in photo and design apps
HWBhwb(210 18% 13%)CSS
CMYKcmyk(79%, 40%, 0%, 13%)A rough starting point for print
LABlab(55% 5 -52)CSS and color matching
NAME≈ cornflowerblueThe nearest CSS color name

HSL, HSV, HWB and CMYK figures are rounded to whole numbers, so they are close but not exact. Keep the HEX or RGB value as your master copy.

HWB, HSV and CMYK in plain words

HWB starts from a pure hue and mixes in white and black. MDN explains that an HWB color is fully saturated when its whiteness and blackness are both 0, that more whiteness lightens it and more blackness darkens it.[2] When whiteness and blackness add up to 100% or more, the result is a shade of gray.[2] You can see this with #808080, which the picker shows as hwb(0 50% 50%).

HSV, also called HSB, uses the same hue as HSL. Its value is the brightest of the three channels, so any color with a channel at 255 has a value of 100%.

CMYK is worked out with the simple formula: black is 1 minus the largest of red, green and blue, and each ink is scaled from what’s left. It uses no printer profile, so a print shop’s software may give different numbers for the same color.

Color names and the ≈ sign

CSS has built-in color names. MDN lists 16 basic colors and about 150 more that have a keyword.[3] Some names are aliases for each other, such as aqua and cyan, or gray and grey.[3] CSS Colors Level 4 added rebeccapurple to honor web pioneer Eric Meyer.[3]

When your color matches a name exactly, the NAME row shows it, so #FF6347 shows tomato. When it doesn’t, the row shows the nearest name with an ≈ sign in front. The tool measures closeness by the distance between the two colors’ LAB values. #E74C3C shows ≈ tomato, and #2E86DE shows ≈ cornflowerblue. A name with ≈ is a different color, so use the HEX code when the exact shade matters.

Using the shades for text and buttons

The shades row mixes your color 80%, 60%, 40% and 20% toward white, shows your color in the middle, then mixes it 20% to 80% toward black. For #2E86DE that gives #D5E7F8, #ABCFF2, #82B6EB, #589EE5, #2E86DE, #256BB2, #1C5085, #123659 and #091B2C. Click any shade and every code above updates to it.

Light tints suit backgrounds, and dark shades suit text and borders. Check that text stays readable. The W3C’s accessibility guidelines ask for a contrast ratio of at least 4.5:1 for normal text and at least 3:1 for large text.[4] Large means at least 18 point, or 14 point bold.[4] Contrast ratios range from 1:1 to 21:1.[4] This page doesn’t measure contrast, so paste your two HEX codes into the color contrast checker.

Common mistakes

  • Typing RGB values above 255. Each channel runs from 0 to 255, so the tool shows an error until the value is fixed.
  • Sending screen colors straight to print. The CMYK row is only a guide. Check with your printer.
  • Trusting a name with ≈. It is only the closest named color. Use the HEX code for an exact match.
  • Picking colors from a photo by eye. To take a color from a picture, use the image color picker, then paste its code here.

What next

Use this often? Add Color Picker to your Home screen.

Frequently asked questions

How do I use the color picker?

Click the color box to choose a color, or type a HEX or RGB code. Then click HEX, RGB or HSL to copy that code.

What is a HEX color code?

A HEX code writes a color’s red, green and blue values in hexadecimal, from 00 to ff each, such as #2E86DE.

Is #abc the same as #aabbcc?

Yes. In a three-digit HEX code each digit is doubled, so #abc means #aabbcc.

How do I convert HEX to RGB?

Type the HEX code in the code box. The RGB value of the same color appears below, ready to copy.

Why does the color picker show ≈ before a color name?

The ≈ means your color isn’t an exact CSS color name. The tool shows the closest name instead. Use the HEX code when you need the exact color.

Can I enter a color with transparency?

Yes. Type an eight-digit HEX code such as #2E86DE80. The RGBA row then shows the transparency, here 0.5.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Developer Tools