Color Picker: HEX, RGB and HSL Values

Choose a color with your browser's color input, type a 6-digit HEX code, or click one of 24 presets. The tool shows the color as HEX, RGB and HSL, and each value copies with one click.

Color Information:

Selected Color

Click any value below to copy it to your clipboard

Popular Colors

Runs in your browser: your files and text are not uploaded. Free, no account needed.

Last updated: · Reviewed by the QuickTooly Team

How the values are calculated

From HEX to RGB and HSL

A 6-digit HEX code is three pairs of base-16 digits for red, green and blue. Each pair runs from 00 to FF, which is 0 to 255. RGB writes the same three numbers in decimal.

HSL is calculated from them. Divide each channel by 255. Lightness is L = (max + min) / 2. Saturation is S = (max − min) / (1 − |2L − 1|). Hue depends on which channel is largest. The tool rounds H to whole degrees and S and L to whole percentages.

Worked example: #4ADE80

  • Channels: 4A = 74, DE = 222, 80 = 128, so the RGB value is rgb(74, 222, 128).
  • Lightness: max = 222 / 255 = 0.871 and min = 74 / 255 = 0.290, so L = (0.871 + 0.290) / 2 = 0.580, or 58%.
  • Saturation: max − min = 0.580, and 1 − |2 × 0.580 − 1| = 0.839, so S = 0.580 / 0.839 = 0.69, or 69%.
  • Hue: green is the largest channel, so H = 60 × ((B − R) / (max − min) + 2) = 60 × (0.212 / 0.580 + 2) ≈ 142°.

Result: hsl(142, 69%, 58%).

Limits of This Picker

  • 3- and 6-digit HEX only. If you type three or six hex digits without #, the tool adds it. A 3-digit shorthand such as #ABC is read as #AABBCC for the RGB and HSL boxes. The browser swatch only accepts the six-digit form, so type #AABBCC if you want the swatch to show the color too. 4- and 8-digit codes with alpha show "Invalid color".
  • No transparency. The browser color input only handles opaque colors, and the outputs have no alpha value.
  • Rounded HSL. Because H, S and L are rounded, turning the HSL value back into HEX can land one step away from the original code.
  • The dialog belongs to the browser. Clicking the swatch opens the color dialog of your browser or operating system, so its look and options, such as an eyedropper, vary.

Color Picker Questions

Why does this tool show 69% when another shows 69.16%?

This picker rounds hue to whole degrees and saturation and lightness to whole percentages. Tools that keep decimals describe the same color with more precision.

Can I type a color name such as red?

No. The text field takes HEX codes only. The HEX to RGBA converter accepts color names, rgb(), hsl() and oklch() values.

Which preset colors are included?

There are 24: twelve hues from red to pink, five grays from black to white, and seven browns such as Saddle Brown, Chocolate and Wheat.

Other Color Tools for the Next Step

  • HEX to RGBA Converter: add transparency, or convert a value you already have in rgb(), hsl() or oklch() form.
  • OKLCH Color Picker: adjust the color by perceptual lightness and chroma and check whether it fits sRGB or Display P3.
  • Contrast Checker: test the picked color as text or background against the WCAG ratios.