ColorToolkits
Format Converter

HSL to RGB Converter

Convert CSS HSL (Hue, Saturation, Lightness) coordinates into decimal 0–255 RGB channel integers and CSS Color 4 syntax.

Converted (RGB)
rgb(36 99 235)
#2463EB
Try presets:

How to Use This Tool

  1. Enter or paste your HSL value or choose one of the curated preset swatches.
  2. Copy the formatted RGB value directly, or inspect the secondary HEX, RGB, HSL, and OKLCH chips below.
  3. Click into Tailwind Scale Generator or Contrast Checker to validate accessibility on the converted shade.

Key Features

  • Bidirectional parsing supporting CSS Color Level 4 syntax cleanly
  • HSL computes chroma C = (1 - |2L - 1|) × S, splits Hue modulo 60° sectors into intermediate X, and offsets RGB by lightness floor m = L - C/2.
  • Instant clipboard feedback with live OKLCH and Display-P3 gamut safety
  • Zero server round-trips—every calculation executes immediately in browser memory

Projecting Cylindrical HSL to Cartesian RGB

HSL computes chroma C = (1 - |2L - 1|) × S, splits Hue modulo 60° sectors into intermediate X, and offsets RGB by lightness floor m = L - C/2.

Reference Snippet (JavaScript)

function hslToRgb(h, s, l) {
  s /= 100; l /= 100;
  const k = (n) => (n + h / 30) % 12;
  const a = s * Math.min(l, 1 - l);
  const f = (n) => l - a * Math.max(-1, Math.min(k(n) - 3, 9 - k(n), 1));
  return [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];
}

Frequently Asked Questions

More Color Tools

View all tools →