🎨 Color Converter

Convert HEX color to RGB and HSL values.

Calculate Now

What is a Color Converter?

A color converter takes a HEX color code β€” the six-digit format used everywhere in web design, like #1E73BE β€” and translates it into its RGB (red, green, blue) and HSL (hue, saturation, lightness) equivalents. Designers copying a brand color from a logo file into CSS, developers building a theme that needs both HEX for stylesheets and HSL for programmatic lightness/darkness adjustments, and anyone matching a color across Figma, Photoshop, and code all rely on this kind of conversion rather than guessing values by eye.

Conversion Formula

The HEX code is split into three 2-digit hexadecimal pairs, each converted to a 0–255 decimal value for RGB, then normalised to 0–1 to calculate HSL:

R = first pair (hex β†’ decimal), G = second pair, B = third pair
L = (max(R,G,B) + min(R,G,B)) Γ· 2 (normalised 0–1)
S depends on lightness and the max–min spread; H depends on which channel is largest

How the Digits Map to Color

HEX SegmentRepresentsDecimal Range
1st pair (e.g. 1E)Red channel0–255
2nd pair (e.g. 73)Green channel0–255
3rd pair (e.g. BE)Blue channel0–255

Worked Example

Converting #1E73BE (this site's own accent blue):

1E β†’ 30, 73 β†’ 115, BE β†’ 190
RGB = rgb(30, 115, 190)
Normalised: max = 0.745 (blue), min = 0.118 (red), L = 0.431
HSL β‰ˆ hsl(208, 73%, 43%)

Note that HSL's lightness of 43% correctly signals a mid-toned, slightly-dark blue rather than a pastel or a near-black β€” a quick sanity check when the numbers look right.

How to Use This Calculator

  1. Enter or paste a 6-digit HEX color code (the # is optional).
  2. Click Calculate.
  3. Read off the matching RGB and HSL values, along with a live color swatch preview.
πŸ’‘ Tip: HSL is often more useful than RGB when you need to programmatically lighten or darken a brand color β€” just adjust the lightness percentage and keep hue and saturation fixed, which keeps the color's identity consistent across a whole design system.

Building a full color palette? Pair this with the QR Code Generator for other quick design utilities on this site.

📅 Last reviewed: July 2026 · Formulas verified against RBI/SEBI/IT Dept guidelines.