How to use this converter

Type a HEX code in the HEX field — 3, 4, 6 or 8 digits, with or without the # — or click the picker to choose visually. To go the other way, enter Red, Green and Blue values from 0 to 255, with an optional alpha between 0 and 1. Every format updates live, the swatch previews the colour, and each result row has a Copy button. Invalid input — a letter outside A–F, an RGB value above 255 — shows an error rather than a guessed answer.

Worked example: one colour in every format

Quick answer: #FF5733 is rgb(255, 87, 51) — a warm orange-red. In HSL it is hsl(11, 100%, 60%), and in HSV hsv(11, 80%, 100%). The hue of about 11° places it just past red, towards orange.
FormatValueWhat it shows
HEX#FF5733Red FF, green 57, blue 33 in base 16
RGBrgb(255, 87, 51)The same pairs as decimal numbers
HSLhsl(11, 100%, 60%)Hue 11°, full saturation, 60% lightness
HSVhsv(11, 80%, 100%)Hue 11°, 80% saturation, full value

All four rows describe the exact same colour. Designers copy the HEX into a brand guide, developers paste the RGB or HSL into CSS, and photo-style tools often work in HSV — converting between them loses nothing, because each format is just a different way of writing the same red, green and blue mix.

What a HEX colour code is

A HEX code is RGB written in base 16 (hexadecimal), which counts 0–9 then A–F. The six digits split into three pairs: red, green, then blue. Each pair runs from 00 (none of that channel) to FF (the full 255). So #FF5733 means red FF = 255, green 57 = 5×16 + 7 = 87, and blue 33 = 3×16 + 3 = 51. The 3-digit shorthand doubles each digit, so #0F8 becomes #00FF88. An extra pair at the end — #RRGGBBAA — adds alpha.

What RGB and RGBA are

RGB describes a colour as three decimal numbers, one per light channel, each from 0 to 255. Screens build every pixel from red, green and blue light, so RGB matches the hardware directly. Adding a fourth value gives RGBA, where A (alpha) controls opacity from 0 (invisible) to 1 (solid). CSS writes them as rgb(255, 87, 51) and rgba(255, 87, 51, 0.5) — the second is the same orange-red at half opacity, which is why this page's swatch sits on a checkerboard.

What HSL is

HSL reorganises the same colour around how people describe colours. Hue is a position on the colour wheel in degrees: 0° is red, 120° green, 240° blue. Saturation runs from 0% (grey) to 100% (pure colour). Lightness runs from 0% (black) through 50% (the pure hue) to 100% (white). For #FF5733 the hue is about 11°, saturation is 100%, and lightness is 60% — the average of the strongest channel (100%) and the weakest (20%).

What HSV is — and how it differs from HSL

HSV (also called HSB, for brightness) keeps the same hue, but replaces lightness with value: the strength of the strongest channel. #FF5733 has red at full power, so its value is 100%, and its HSV saturation is 80% — the gap between the strongest channel (100%) and the weakest (20%), relative to the strongest. The practical difference: in HSL, white sits at 100% lightness whatever the hue; in HSV, a colour at 100% value and 100% saturation is the pure hue itself, turning white only as saturation falls. Design-software pickers usually use HSV; CSS offers HSL.

The conversion formulas in brief

HEX to RGB is just base conversion: read each pair as a base-16 number. For HSL and HSV, first scale the channels to 0–1 and find the largest (max) and smallest (min). Hue comes from which channel is largest — for a red-dominant colour, hue = 60 × ((green − blue) ÷ (max − min)) = 60 × (0.341 − 0.200) ÷ 0.8 ≈ 10.6°, rounded to 11°. Lightness is (max + min) ÷ 2; HSL saturation is the channel gap divided by (2 − max − min) when lightness is above 50%, or by (max + min) below it. HSV value is simply max, and its saturation is the gap divided by max.

Common mistakes to avoid

  • Reading HEX pairs as decimal. The pair 57 is not fifty-seven — it is 5×16 + 7 = 87. Treating hex digits as ordinary numbers gives a noticeably different colour.
  • Mixing up HSL and HSV numbers. The same colour has different saturation and brightness figures in each system — copying HSV values into an hsl() function shifts the colour.
  • Forgetting the alpha pair. An 8-digit code pasted somewhere that only reads 6 digits can be misread or rejected; use the rgba() form when a tool does not support #RRGGBBAA.
  • Assuming grey has a hue. When all three channels are equal, hue and saturation are 0 by definition — there is no colour direction in a grey.

Honest limitations, and your privacy

This converter works in the sRGB colour space that CSS and the web use; it does not convert to CMYK for print or to models such as Lab. Hue, saturation, lightness and value are rounded to whole numbers for display, so converting back can differ by one step in a channel — invisible in practice, but worth knowing for exact brand work. Everything runs in your browser: the colours you enter never leave your device and are not stored.