Color Converter (HEX/RGB/HSL)
Pick a color or paste a 6-digit HEX code and instantly read its RGB and HSL equivalents. Conversion runs one way, from HEX to RGB and HSL, entirely in your browser.
#535bebrgb(83, 91, 235)hsl(237, 79%, 62%)How to use this tool
- 1
Click the color swatch to open your operating system's color picker and choose a color visually.
- 2
Or type a 6-digit HEX value (such as #535beb, with or without the leading #) into the text field.
- 3
Read the matching rgb(R, G, B) and hsl(H, S%, L%) strings in the result cards below.
- 4
Copy whichever format you need straight into your CSS or design file.
How does HEX to RGB and HSL conversion work?
HEX, RGB, and HSL all describe the same point in the sRGB color space, just with different notation. A HEX code like #535beb packs three bytes: 53, 5b, and eb in base 16, which are the red, green, and blue channels. This tool reads those two-hex-digit pairs and converts each to a 0-255 decimal value, giving you rgb(83, 91, 235). HSL is derived from those RGB numbers: hue is the angle on the color wheel (0-360 degrees), saturation is how vivid the color is (0-100%), and lightness is how bright it is (0-100%). The math finds the max and min of the three channels to compute lightness, scales their difference for saturation, and picks the dominant channel to compute hue, then rounds each result to a whole number. Because rounding happens, converting HEX to HSL and back by hand may shift a value by one. The tool only parses standard 6-digit HEX; 3-digit shorthand (#abc), 8-digit HEX with alpha, and named colors like rebeccapurple are not recognized and fall back to black.
Common use cases
Translating a brand HEX code from a style guide into the rgb() values a legacy stylesheet or email template requires.
Grabbing the HSL form of a color so you can nudge its lightness or saturation while keeping the same hue for a palette.
Checking the exact RGB channels of a color picked from a screenshot or mockup before writing it into CSS.
Confirming what a designer's HEX swatch becomes in RGB for a canvas, SVG, or charting library that wants numeric channels.
Teaching or learning how hexadecimal color notation maps to decimal RGB and to the HSL model.
Quickly sampling a color visually with the picker and reading all three CSS-ready notations at once.
Frequently asked questions
Can I convert RGB or HSL back into HEX with this tool?▼
Why does my color turn black when I type something?▼
Does it support alpha or transparency?▼
Are HEX letters case sensitive?▼
Why is the HSL value slightly off from another converter?▼
Does it handle OKLCH or other modern color spaces?▼
Is my color data uploaded anywhere?▼
Related tools
CSS Box Shadow Generator
Build CSS box-shadow visually.
CSS Gradient Generator
Build linear and radial CSS gradients.
Cubic Bezier Generator
Build CSS easing curves visually.
Color Palette Generator
Generate harmonious color palettes from any base color.
CSS Border Radius Generator
Build complex CSS border-radius visually.
CSS Clamp Generator
Generate responsive CSS clamp() functions.