HEX to RGB Converter

One colour, every notation: type a HEX code (or RGB, or HSL) and get all three, with a live swatch — the small translation job between a designer's palette and a developer's stylesheet.

Convert a colour

In short

#0F766E = rgb(15, 118, 110) = hsl(175, 77%, 26%) — the deep teal this very site uses. All three fields stay in sync as you type.

Three notations for one idea

Every screen colour is a recipe of three lights — red, green, blue — each at an intensity from 0 to 255. The notations differ only in handwriting. RGB writes the recipe in decimal: rgb(15, 118, 110). HEX writes the same three numbers in base 16 and glues them behind a #: 0F is 15, 76 is 118, 6E is 110, hence #0F766E — two hex digits are exactly one byte, which is why the format is so compact. HSL abandons the recipe for a description: hue picks the colour family by angle (0 red, 120 green, 240 blue; teal sits near 175), saturation says how pure, lightness how bright. Converting among them is pure arithmetic — no information is gained or lost — and the reason to bother is workflow: brand guidelines arrive as HEX, CSS effects want RGB with an alpha channel, and any human adjusting a colour ("a bit lighter, a bit less saturated") thinks in HSL whether they know the name or not.

How to use this converter

  1. Type a HEX code into the HEX field, or an "r, g, b" triple into the RGB field.
  2. The other formats and the swatch update instantly.
  3. Copy whichever notation your stylesheet, design tool or brand document needs.

Note: conversions are exact for the sRGB colour space that web colours live in. Print reproduction (CMYK) is a different system and will shift colours.

Frequently asked questions

How do I convert a HEX colour to RGB?

Split the six hex digits into three pairs — red, green, blue — and read each pair as a hexadecimal number. #0F766E splits into 0F, 76 and 6E, which are 15, 118 and 110 in decimal: rgb(15, 118, 110). Each channel runs 0–255 because a pair of hex digits (base 16) covers exactly one byte.

What is the 3-digit HEX shorthand?

A compression for colours whose pairs have doubled digits: #FFFFFF shortens to #FFF, #0F766E cannot shorten because its pairs (0F, 76, 6E) are not doubled. CSS accepts both; this converter accepts 3- and 6-digit input and always reports the full form.

What is HSL and when is it better than RGB?

HSL describes a colour as hue (the angle on the colour wheel, 0–360), saturation (how grey or vivid) and lightness (how dark or bright). It is the format humans can actually steer: 'same colour, but lighter' is one number changed in HSL and a small puzzle in RGB. Designers build palettes and hover states in HSL for exactly that reason.

Why do screens use RGB at all?

Because display hardware is RGB: every pixel is literally a red, a green and a blue light mixed at different intensities, matching the three cone types in the human eye. HEX is simply RGB written compactly in base 16 for code. Print, by contrast, mixes inks and uses CMYK — which is why a screen colour and its printed version are cousins, not twins.

Is anything uploaded?

No. Conversion happens in your browser as you type.

Related tools