Polysh for agents is in early access. Your coding agent records the demo, and Polysh finishes it. Join the waitlist →

HEX Color Picker

Convert any HEX color to RGB and HSL, or pick a new one visually.

Loading your browser tool…

What HEX Color Picker does

Type a HEX code such as #3157D5 or the short form #35D and the swatch, RGB and HSL values update as you type. Or click the swatch to open your system color picker and choose a color by eye. It's a quick way to translate a design-tool color into rgb() for CSS, or to check what a short HEX code expands to.

No image is needed. If you do want to sample a color from a screenshot, open More options and drop the image there. Recent picks from an image are kept as swatches. To analyse the colors of an entire image, use the Dominant Color Extractor.

Example

Input

#35D

Result

HEX #3355DD
RGB rgb(51, 85, 221)
HSL hsl(228, 71%, 53%)

Each digit of a 3-digit code is doubled, so #35D is #3355DD.

How to use HEX Color Picker

  1. Type a code in HEX, or click the swatch to choose a color.
  2. Read the RGB and HSL values below the large swatch.
  3. Click Copy to copy the HEX code, or copy RGB or HSL from their own fields.

Good to know

  • 8-digit HEX codes with alpha, such as #3157D580, aren't accepted. Use the first six digits and set opacity separately in CSS.
  • Only HEX is accepted as input on this page. Output covers HEX, RGB and HSL; there is no CMYK or Pantone.
  • HSL values are rounded to whole numbers, so converting them back can be off by one unit in RGB.

Questions about HEX Color Picker

How do I convert HEX to RGB?

Split the six digits into three pairs and convert each from base 16 to base 10. #3157D5 becomes 31, 57 and D5, which are 49, 87 and 213. Type the code here and rgb(49, 87, 213) appears immediately.

What is a 3-digit HEX color?

It's shorthand where each digit is doubled: #35D means #3355DD, and #FFF means #FFFFFF. It only works for colors whose pairs repeat, so most brand colors need all six digits.

When should I use HSL instead of HEX?

HSL is easier to adjust by hand. Changing only the last value makes a color lighter or darker, which is handy for hover states and tints. HEX is shorter and what most design tools export.