← All tools

HEX, RGB and HSL converter

Type a color code to see its equivalent in the other formats at once. It runs in your browser and nothing is sent to a server.

Type HEX (#3b82f6), rgb(), hsl() or a color name (blue). Click any swatch below to select that color.

Tints and shades

Complementary color

Analogous colors

Triadic harmony

How to use it

  1. Type the color code in the field: HEX, rgb() or hsl().
  2. The same color's HEX, RGB and HSL values appear on the right.
  3. Press the Copy button next to the format you want.

Frequently asked questions

How do you convert a HEX code to RGB?

The six digits of the HEX code are split into three pairs: the first two are red, the next two green and the last two blue. Each pair is converted from hexadecimal to decimal. For #3b82f6, 3b = 59, 82 = 130 and f6 = 246, so rgb(59, 130, 246).

What does the 3-digit short HEX mean?

Each digit is doubled: #38f is the same as #3388ff. Only colors whose pairs are identical can be written in the short form.

Can the conversion show small differences?

HSL values are shown rounded to whole numbers, so converting from HSL back to RGB can differ by one unit. The conversion between HEX and RGB is exact.

Are the colors I enter sent anywhere?

No. The calculation runs in your browser and nothing is uploaded.

Related guide

Related tools