Hex / RGB / HSL Color Converter
Convert a color between HEX, RGB, and HSL formats, with the parsed channel values and CSS-ready strings.
Result
- HEX#1a73e8
- RGBrgb(26, 115, 232)
- HSLhsl(214, 82%, 51%)
- Red / Green / Blue26 / 115 / 232
- Hue / Sat / Light214° / 82% / 51%
Step-by-step
- Parse the input to RGB channels: 26, 115, 232.
- HEX = #1a73e8.
- Convert RGB→HSL: hue 214°, saturation 82%, lightness 51%.
How to use this calculator
- Enter a color in HEX, rgb(), or hsl() format.
- Read the equivalent HEX, RGB, and HSL values.
- Use the channel breakdown to tweak individual components.
- Copy the CSS-ready string you need into your stylesheet.
About this calculator
Web colors are written in several formats, and converting between them is a constant need in design and front-end work. This converter accepts a color in HEX (#1a73e8), RGB (rgb(26, 115, 232)), or HSL (hsl(214, 82%, 51%)) and returns all three, plus the individual channel values. HEX and RGB are two ways of writing the same thing — the red, green, and blue intensities from 0 to 255 — so converting between them is a direct base-16 mapping. HSL (hue, saturation, lightness) is a cylindrical re-mapping of the RGB cube designed to be more intuitive for humans: hue is the angle on the color wheel (0–360°), saturation is how vivid the color is, and lightness is how bright. HSL is especially handy for generating variations of a color by nudging one channel. All conversions use the standard CSS Color definitions in the sRGB space.
How it works — the formula
HEX↔RGB: each pair = channel value (base 16 ↔ base 10)
RGB→HSL: L=(max+min)/2; S from chroma; H from which channel is maxHEX and RGB are equivalent integer encodings; HSL is derived from the max/min of the normalized channels.
Worked examples
- Inputs:
- color=#ff0000
- Output:
- rgb(255,0,0), hsl(0,100%,50%)
- Inputs:
- color=#1a73e8
- Output:
- rgb(26,115,232), hsl(214,82%,51%)
- Inputs:
- color=rgb(26,115,232)
- Output:
- #1a73e8
Limitations
- sRGB opaque colors; alpha not composited.
- HSL rounded to whole units for readability.
- Named colors (e.g. "tomato") not parsed — use HEX/RGB/HSL.
Standard CSS sRGB conversions.