RGBA to HSL Converter

Color Picker · developer

Convert RGBA values to HSL with a fixed input and output format, live preview of the conversion line, and copy-ready results. All processing runs locally in your browser.

Calculator

From: RGBA (RGB + alpha)

To: HSL (hue, saturation, lightness)

About RGBA

RGBA adds an alpha channel (opacity) from 0 (transparent) to 1 (opaque). The first three channels are the same as RGB.

About HSL

HSL uses hue (0–360°), saturation (0–100%), and lightness (0–100%). It is convenient for adjusting perceived brightness and vividness.

How to convert RGBA to HSL

Enter a valid RGBA value in the calculator. The tool follows the pipeline below: parse your input, hold the color as sRGB (with alpha when relevant), then format the result as HSL.

Accepted shapes include CSS-like functions (e.g. rgb(...), hsl(...)) and compact comma-separated numbers where appropriate. Hex may include or omit the leading #.

Conversion procedure

  1. Parse RGBA: accept rgba(r, g, b, a) or four comma-separated numbers. R, G, B follow the same 0–255 rule as RGB. Alpha may be written between 0 and 1 (typical for CSS) or, if you enter a value between 1 and 255, it is interpreted as an 8-bit alpha and divided by 255.
  2. Resolve to internal sRGB: R, G, B are used as-is; alpha is clamped to 0–1. All later steps that only care about red, green, and blue use these same channel values; formats that support opacity (RGBA, 8-digit HEX) read alpha from this internal value.
  3. Build HSL: RGB is normalized to 0–1. Lightness L = (max + min)/2. Saturation S is 0 if max = min; otherwise S = (max − min) / (max + min) when L ≤ 0.5, or S = (max − min) / (2 − max − min) when L > 0.5. Hue (0–360°) is derived from which channel is maximal and the differences between channels. The page displays integer degrees and whole-number percentages: hsl(h, s%, l%).
  4. Finalize: the result string is what you copy from the calculator. The line under the fields summarizes the path in short form (HSL ← sRGB ← RGBA). Rounding is intentional so values read like typical CSS; tiny differences versus other apps can still appear because of integer hue, saturation, lightness/value, or ink percentages.
  5. HSL/HSV reminder: when hue, saturation, and lightness/value are shown as whole numbers, more than one underlying RGB can produce the same text. Typing those integers back into a converter may therefore differ by ±1 from a color you first picked as HEX in the Color Picker—that is expected rounding behavior, not a broken formula.

Example

Input (RGBA): rgba(52, 152, 219, 0.85)

Output (HSL): hsl(204, 70%, 53%)

Summary

This page converts RGBA input into HSL output. The numbered “Conversion procedure” above is the full breakdown: validation and parsing, conversion to a single internal sRGB (+ alpha) sample, derivation of HSL coordinates from that sample, and final rounding to the strings you see in CSS-oriented tools. The same pipeline runs in your browser as you type.

Relationship context

RGBA (RGB + alpha) and HSL (hue, saturation, lightness) are different ways to describe the same sRGB color (except CMYK, which is an approximate ink model). Converting RGBA → HSL does not change the underlying color within the limits of each notation; it only changes how numbers are written.

Example conversions

Sample RGBA values and the matching HSL output using the same rules as the calculator.

RGBA inputHSL output
rgba(0,0,0,0.5)hsl(0, 0%, 0%)
rgba(255,255,255,1)hsl(0, 0%, 100%)
rgba(46, 204, 113, 0.75)hsl(145, 63%, 49%)

More color format converters

Other dedicated pages (fixed input and output types). Open the Color Picker for the full list.