HEX to RGB and HSL Converter
Turn HEX color codes into copy-ready RGB and HSL CSS values, with a live color preview and support for short HEX codes.
Convert HEX to RGB and HSL
Use 3 or 6 hexadecimal digits, with or without #. Alpha transparency is not supported.
Enter 3 or 6 valid hexadecimal digits, such as #F00 or #FF5733.
Try sample colors
Color preview
Copy-ready CSS color codes
HEX
—
RGB
—
HSL
—
RGB channels
r
—
g
—
b
—
Hue
—
Saturation
—
Lightness
—
HSL values are rounded to whole degrees and percentages; converting the rounded HSL back may not reproduce identical RGB channel numbers.
How to use
- 1
Type a 3- or 6-digit HEX code, such as #F00 or #FF5733, with or without #.
- 2
Check the live color preview, or choose a sample swatch or the browser color picker.
- 3
Read the normalized HEX, rgb(...) and hsl(...) results and their component values.
- 4
Use Copy beside any output to paste that CSS color value into your project.
About this tool
A HEX code describes a color using hexadecimal red, green and blue channel values. Enter a code such as #FF5733 and this converter instantly returns its six-digit uppercase HEX form, rgb(255, 87, 51), and hsl(11, 100%, 60%). You can copy any of those CSS-ready strings or use the color swatch to confirm the result visually. The HSL example uses whole-number rounding, so it is an approximate HSL representation of the original RGB channels.
RGB stands for red, green and blue. In standard six-digit HEX, each pair of characters represents one channel from 00 to FF (0 to 255 in decimal). HEX #FF0000 and rgb(255, 0, 0) describe the same pure red. The shorter form #F00 expands to #FF0000 because each digit is repeated; #ABC likewise becomes #AABBCC. You may omit the leading #, and lowercase HEX letters are accepted. The tool normalizes valid entries to uppercase for copying.
HSL expresses a color using hue, saturation and lightness rather than direct RGB channel numbers. Hue describes the position around the color wheel from 0 to under 360 degrees; saturation indicates intensity, and lightness ranges from black at 0% to white at 100%. For example, hsl(0, 100%, 50%) is pure red, while lowering saturation makes that red more neutral. HSL is often easier for experimenting with color variations in CSS, whereas HEX is compact for design tokens and RGB is helpful when inspecting individual channel strengths.
Conversion updates as you type a valid code, and you can also choose a color using the browser's color control or one of the sample swatches. Invalid inputs hide the previous results rather than showing a misleading old conversion. This is a standard opaque RGB color converter: it accepts exactly 3 or 6 HEX digits, not 4- or 8-digit alpha codes, color names, or other CSS syntax. HSL values are rounded to whole degrees and percentages, so recreating a color from the rounded HSL may differ by a small amount from its original RGB channels. All calculations occur locally in your browser, with no color value sent to Toolaros servers.
Frequently asked questions
Do HEX, RGB and HSL show the same color?
Yes. They describe the same opaque RGB color in different notations. For example, #FF0000, rgb(255, 0, 0) and hsl(0, 100%, 50%) all represent pure red. Display appearance can still depend on your screen and color management.
Can I enter a three-digit HEX code?
Yes. A code such as #F00 is expanded to #FF0000 and #ABC becomes #AABBCC. You can also leave off the # sign.
Why is the HSL result rounded?
The converter uses the standard RGB-to-HSL calculation and rounds hue to the nearest whole degree and saturation/lightness to the nearest whole percentage. #FF5733 becomes approximately hsl(11, 100%, 60%). This makes CSS values easier to read but can lose slight precision when converting back.
What do hue, saturation and lightness mean?
Hue is the color-wheel angle; saturation is how vivid or neutral a color appears; and lightness controls its position between black (0%) and white (100%). At 0% saturation, the result is a shade of gray regardless of hue.
Does the converter support transparency or 8-digit HEX?
No. It accepts only three or six hexadecimal digits for opaque colors. #RGBA and #RRGGBBAA include alpha transparency and are intentionally not supported.
What happens when I enter an invalid HEX code?
An inline error appears and the previous preview and outputs are hidden. Only digits 0–9 and letters A–F are allowed, in a group of exactly 3 or 6 characters after the optional #.
Are my color codes uploaded or stored by Toolaros?
No. This converter calculates values directly in your browser and does not make a server request to process your entered color. The tool does not provide an account-based color history.