Skip to main content
WebColorTools

RGB to HSL Converter

Convert RGB color values to HSL instantly. Free, in your browser.

Instant 100% Private Free Forever
RGB HSL CSS Converters
RGB values
#228B22

HSL output

hsl(120, 61%, 34%)
Raw 120, 61%, 34%
HEX #228B22

Examples

How to use the RGB to HSL Converter

Four steps to turn RGB into HSL cylindrical values.

  1. 1

    Enter RGB channels

    Type red, green, and blue (0–255) in the three fields, or pick with the native swatch.

  2. 2

    Preview the color

    The large swatch reflects the RGB you entered so you can spot typos early.

  3. 3

    Copy HSL output

    Click Copy on the main hsl() line, or grab Raw components or the bonus HEX code.

  4. 4

    Use quick examples

    Load example or tap gallery chips for forest green, blue violet, and gold.

What is RGB to HSL conversion?

RGB to HSL conversion reframes additive screen colors — three byte-sized channels — into the cylindrical HSL coordinates designers use to reason about hue, vividness, and brightness. You might receive RGB from a screenshot sampler, an analytics dashboard, a hardware LED spec, or legacy CSS written as rgb(34, 139, 34). To build accessible variants, animate themes, or document a palette in human terms, you need HSL. This converter performs that translation instantly with a live preview and copy-ready strings.

RGB stores red, green, and blue as integers 0–255 (or 0–1 in some APIs). It is precise and universal for pixels and GPUs, but opaque: nudging all three channels by the same amount does not reliably lighten a brand color. Search terms such as rgb to hsl, rgb to hsl converter, and convert rgb to hsl reflect developers normalizing foreign RGB tuples into a more adjustable model before writing CSS custom properties.

HSL expresses the same sRGB color as an angle plus two percentages. Hue (0–360°) locates the color on the wheel. Saturation (0–100%) measures distance from gray. Lightness (0–100%) controls luminance without wandering hue. CSS syntax looks like hsl(120, 61%, 34%) for forest green — far easier to tweak than its RGB counterpart.

The conversion algorithm normalizes RGB to 0–1, finds min and max channels, derives lightness as their midpoint, computes saturation from spread relative to lightness, and calculates hue from which channel dominates. This matches the W3C CSS Color Module path implemented in browsers, so pasted values behave consistently in stylesheets. A bonus HEX row and Raw comma-separated HSL components accompany the primary hsl() output.

Where this helps: importing RGB from Figma inspect mode into HSL-based token files; translating canvas pixel reads into theme variables; auditing contrast by adjusting lightness in HSL after grabbing RGB from a legacy site; teaching color theory with wheel vocabulary instead of channel triples; preparing Sass loops that iterate hue while holding saturation fixed; and debugging why two RGB codes look similar but sit at different hues when plotted cylindrically.

The tool is private by design — calculations stay on your device, with no account required. Enter channels manually, use the picker, or try example swatches. Copy the formatted HSL, Raw components, or uppercase HEX. Complete your converter toolkit with HEX to HSL, HSL to RGB, and the multi-format Color Converter.

Because HSL separates identity from intensity, it is the preferred interchange format when designers and engineers collaborate: creatives describe adjustments in hue and lightness, while production code can still consume the resulting hsl() or HEX literals this tool outputs alongside the live swatch confirmation.

Frequently asked questions

Why convert RGB to HSL for CSS theming?
RGB channels change independently, so lightening a color means guessing three numbers. HSL separates hue (identity), saturation (intensity), and lightness (brightness). After converting RGB to HSL, you can bump lightness for hover states or reduce saturation for borders while keeping the same hue — a pattern common in design tokens and dark-mode switches.
I have rgb(34, 139, 34) from an API — what will HSL look like?
Forest green maps to roughly hsl(120, 61%, 34%). Exact values depend on rounding; the live swatch confirms the match. Paste your three integers and copy the computed hsl() string for stylesheets.
What is the Raw output row?
Raw lists hue, saturation, and lightness as comma-separated numbers — for example 120, 61%, 34% — without the hsl() wrapper. Handy for spreadsheets, design docs, or preprocessors that assemble the function yourself.
Do values above 255 get accepted?
Each RGB field clamps to 0–255 on blur, matching the valid sRGB range. While typing, you can clear a field; empty inputs pause conversion until all three channels are filled again.
Is conversion done on your servers?
No. Your RGB values never leave the browser. The page works offline once loaded, with zero tracking.