Money & metals

Live Gold Prices Live Silver Prices Currency Converter Loan & Mortgage Percentage Calculator Tip Calculator

Convert & measure

Unit Converter Age Calculator BMI Calculator Unix Timestamp

Words & text

Word Unscrambler Word Counter Case Converter

Developer

JSON Formatter Base64 Encoder Hash Generator Color Converter Password Generator

More

Numerology Calculator Guides & Resources About Tiger Tools Contact us

Color Converter

Convert between HEX, RGB and HSL with a live preview.

HEX, RGB and HSL explained

All three describe the same colors in different ways. HEX (like #2563EB) and RGB (like rgb(37, 99, 235)) both specify how much red, green and blue to mix. HSL (hsl(220, 82%, 53%)) uses hue, saturation and lightness, which is often more intuitive to tweak by eye — slide the lightness up for a tint, down for a shade. Use whichever your CSS or design tool prefers; this converter keeps them in sync.

The three notations

HEX, RGB and HSL describe the same sRGB colours in different coordinates. HEX and RGB are the same numbers in different bases; HSL is a rotation of that cube into something humans can reason about.

#3B82F6 → R 59 G 130 B 246 → hsl(217, 91%, 60%) 3B = 3×16 + 11 = 59
  • HEX — compact and unambiguous; the default in design handoffs. Supports #RGB shorthand and #RRGGBBAA for alpha.
  • RGB — three 0–255 channels; the easiest form to compute with.
  • HSL — hue in degrees around the wheel, plus saturation and lightness as percentages. Best for building palettes, because a tint or shade is one number away.

Building a palette in HSL

Hold hue and saturation, vary lightness, and you get a coherent scale of tints and shades. Rotate the hue instead and you get harmonies: 30° apart is analogous, 180° is complementary, 120° apart is a triad. This is why design systems store colours in HSL and generate the rest.

One caveat: HSL lightness is not perceived brightness. hsl(60 100% 50%) (yellow) looks far brighter than hsl(240 100% 50%) (blue) despite both claiming 50%. If you need perceptually even steps, use OKLCH, now supported across modern browsers.

Contrast is a ratio, not a colour

WCAG measures the relative luminance of two colours and expresses the difference as a ratio from 1:1 to 21:1.

ContentLevel AALevel AAA
Body text4.5:17:1
Large text (18.66px bold / 24px)3:14.5:1
UI components and graphics3:1

Luminance is weighted for human vision — green contributes about 71% of it, red 21% and blue 7% — which is why yellow text on white fails badly while the same lightness in blue may pass.

Colour spaces beyond sRGB

sRGB has covered the web for two decades, but modern displays exceed it. Display P3 offers roughly 25% more gamut, reachable in CSS with color(display-p3 …). For programmatic manipulation, OKLCH is the better tool: change lightness and the hue stays put, which plain HSL cannot promise.

Color converter FAQ

How do I convert HEX to RGB?
Split the six digits into three pairs and read each as a base-16 number. 3B becomes 59, 82 becomes 130 and F6 becomes 246.
What is HSL?
A colour notation using hue in degrees, plus saturation and lightness as percentages. It makes tints, shades and colour harmonies easy to generate by changing one value.
What contrast ratio do I need for accessibility?
WCAG AA requires 4.5 to 1 for body text, 3 to 1 for large text and user interface components, and AAA requires 7 to 1 for body text.
Why does HSL lightness not match how bright a colour looks?
HSL lightness is a geometric measure, not a perceptual one. Yellow at 50 percent lightness looks much brighter than blue at 50 percent. OKLCH exists to fix this.
What is the difference between sRGB and Display P3?
Display P3 covers a wider gamut, roughly 25 percent more than sRGB, so it can show more saturated colours on capable screens. CSS reaches it with the color(display-p3 ...) function.
Can HEX codes include transparency?
Yes. Eight-digit HEX adds two alpha digits, so #3B82F680 is the same blue at about 50 percent opacity.

Recently used

Jump back in