inyourbrowser.com

RGB to HSL Converter

Convert RGB color values to HSL format. Great for moving from image colour pickers to more intuitive design adjustments. Browser-only.

Input
All formats
HEX#3b82f6
RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)

CONVERT

All three formats are shown simultaneously regardless of mode.

Runs entirely in your browser

How it works

The converter scales red, green and blue to 0 to 1, takes lightness as the midpoint of the largest and smallest channel, and derives saturation and hue from their spread and from which channel is largest. rgb(255, 99, 71) gives hsl(9, 100%, 64%). All conversion runs in JavaScript in your browser.

Processing runs in your browser

All computation happens inside your browser tab. Our servers are not involved at any point.

Related operations

To check whether two colours meet WCAG legibility, try the contrast checker. For building a coordinated set from one base colour, use the colour palette generator. To craft smooth multi-stop blends in CSS, see the CSS gradient generator.

Frequently asked questions

Why convert RGB to HSL?
HSL is more human-readable and easier to tweak programmatically, you can lighten or darken a colour by changing just the L value.
Is this accurate?
The algorithm follows the standard RGB-to-HSL formula. The HSL output is rounded to whole numbers, so converting it back to RGB can shift a channel slightly (by up to 5 out of 255).
Why is the hue 0 for grey?
When red, green and blue are equal the color has no hue, so the converter shows hue 0 and saturation 0%: rgb(128, 128, 128) is hsl(0, 0%, 50%).
Can I enter decimals?
Yes. R, G and B accept decimals such as 127.5 as long as they stay between 0 and 255. The HEX and HSL results are rounded to whole numbers.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Contrast checker
Check WCAG AA/AAA contrast ratios between two colours. Live pass/fail results.
Color palette generator
Generate complementary, analogous, triadic, and monochromatic color palettes. Copy hex values or all colors as CSS variables.
Tints & shades generator
Generate 5, 10, or 20 tints and as many shades from any base color. Click any swatch to copy the hex code.
Image color picker
Pick any color from an image you open. Hex, RGB, and HSL output. Runs in your browser.
Number base converter
Convert numbers between binary, octal, decimal, and hex. All bases shown at once.