Color Picker & Converter

Pick any color and instantly get its HEX, RGB, and HSL codes with one-click copy — free and private.

One colour, three codes: HEX, RGB and HSL

Designers, developers and anyone making a poster or a slide keep running into the same colour written in different ways: #1E88E5 in a brand guide, rgb(30, 136, 229) in an app, hsl(208, 79%, 51%) in a stylesheet. Pick a colour visually or type a HEX code, and this tool shows the same colour in all three formats with a copy button for each. HSL is the easiest format for making a lighter or darker shade of a colour you already have.

How to pick and convert a colour

  1. Click the color swatch and choose a color, or type a HEX code.
  2. Read the HEX, RGB, and HSL values.
  3. Click Copy next to the format you need.
  4. Paste it straight into your design or code.

Features

  • Visual picker plus HEX input.
  • Instant HEX, RGB, and HSL conversion.
  • One-click copy for each format.
  • Fully private and browser-based.
  • Free with no sign-up.

How the three formats relate

FormatExampleWhat the numbers mean
HEX#1E88E5Red 1E, green 88, blue E5, each from 00 to FF in base 16
RGBrgb(30, 136, 229)The same red, green and blue amounts from 0 to 255
HSLhsl(208, 79%, 51%)Hue (position on the colour wheel, 0–360°), saturation and lightness

HEX to RGB by hand: split #1E88E5 into 1E, 88 and E5. 1E = 1 × 16 + 14 = 30, 88 = 8 × 16 + 8 = 136, E5 = 14 × 16 + 5 = 229.

Making shades with HSL

Keep the hue and saturation and change only the lightness to get a family of matching colours, for example for a button and its hover state:

UseHSLHEX
Light backgroundhsl(208, 79%, 92%)#DAECFB
Main brand colourhsl(208, 79%, 51%)#1E88E5 (rounded)
Hover / pressedhsl(208, 79%, 40%)#156BB7
Dark text on light backgroundhsl(208, 79%, 20%)#0B365B

Readable text needs contrast

Grey text on a pale background may look elegant but is hard to read in sunlight and for people with weak eyesight. The web accessibility guideline (WCAG) asks for a contrast ratio of at least 4.5 : 1 for normal text. As a quick rule, use very dark text on light backgrounds and white text only on colours with a lightness of about 45% or less.

Related tools

To take a colour from a photo or a logo, use the Image Color Picker. To blend two colours into a background, use the CSS Gradient Generator.

Your privacy

Colours are converted by your own browser. Nothing is uploaded or stored.

Frequently asked questions

How do I convert HEX to RGB?

Type or paste the HEX code and the RGB value appears instantly. By hand, convert each pair of HEX digits from base 16 to a number from 0 to 255.

What is HSL used for?

HSL makes it easy to create lighter or darker shades: keep the hue and saturation and change only the lightness.

Which format should I use in CSS?

Any of the three works in all modern browsers. HEX is the most common, and HSL is handy when you need several shades of one colour.

Can I type a HEX code without the #?

Include the # for CSS. Codes can be six digits (#1E88E5) or the short three-digit form (#18E), which doubles each digit.

Why does my colour look different when printed?

Screens mix light (RGB) and printers mix ink (CMYK), so bright screen colours can print slightly duller. Ask the printer for a proof.

Is anything uploaded?

No. The tool works entirely in your browser.

Related tools