HEX, RGB & HSL Color Converter
Convert colors between HEX, RGB, and HSL formats. Edit any value, preview the color, and copy CSS-ready color codes for your projects.
Example: #FF5733
Example: 255, 87, 51
Example: 11, 100%, 60%
color: #FF5733;
Ready to convert colors.
How to Use the Color Converter
Use this free color converter to work with HEX, RGB, and HSL color values. Enter a value in any supported format, choose a color with the color picker, or copy a converted value for your CSS project.
- Enter a color value. Type a HEX, RGB, or HSL value into the corresponding field.
- View the converted formats. The other fields and the color preview update when the input is valid.
- Choose a color visually. Use the color picker to select a color without entering its code manually.
- Copy the value you need. Use the Copy button beside a format or copy the CSS declaration.
Understanding HEX, RGB, and HSL
HEX color values
HEX represents a color with a hexadecimal code. A six-digit HEX value
uses two digits for red, two for green, and two for blue. Each pair
ranges from 00 to FF. For example,
#FF5733 represents a coral-orange color.
RGB color values
RGB stands for red, green, and blue. Each channel is represented by an
integer from 0 to 255. For example,
rgb(255, 87, 51) describes the same color as
#FF5733.
HSL color values
HSL stands for hue, saturation, and lightness. Hue represents the color angle from 0 to 360 degrees. Saturation and lightness are percentages from 0% to 100%. HSL can be useful when adjusting how vivid or light a color appears.
Color Conversion Example
The following values represent approximately the same color. HSL values are rounded for display, so minor differences may occur when converting between formats.
| Format | Example value |
|---|---|
| HEX | #FF5733 |
| RGB | rgb(255, 87, 51) |
| HSL | hsl(11, 100%, 60%) |
Supported Input Formats
- HEX: Three-digit or six-digit hexadecimal values, with or without the leading hash symbol.
-
RGB: Three comma-separated integer channels from
0 to 255, optionally written as an
rgb()expression. -
HSL: Hue from 0 to 360 and saturation and lightness
from 0% to 100%, optionally written as an
hsl()expression.
This version does not accept alpha-channel formats such as RGBA, HSLA, or eight-digit HEX. Percentage-based RGB values and modern space-separated CSS color syntax are also outside its supported input format.
Using Converted Colors in CSS
Copy the generated CSS declaration and paste it into a rule in your stylesheet. For example:
.button {
color: #FF5733;
}Replace the example value with the color you selected. The converter generates a text declaration; it does not edit your website or stylesheet automatically.
Privacy and Browser Compatibility
Color conversion is performed with JavaScript in your browser and does not require a conversion API. The tool does not need to upload color values to a conversion server. The color picker and clipboard features depend on browser support; clipboard access may require HTTPS or a supported secure context.
Frequently Asked Questions
What is a HEX, RGB, and HSL color converter?
A color converter translates a color between different formats used in web design and CSS. This tool supports HEX, RGB, and HSL values and provides a preview of the selected color.
How do I convert HEX to RGB?
Enter a three-digit or six-digit HEX value in the HEX field. The converter calculates the corresponding red, green, and blue channel values and updates the RGB and HSL fields.
How do I convert RGB to HEX?
Enter three integer values between 0 and 255, separated by commas. The converter turns each channel into a two-digit hexadecimal value and combines them into a HEX color code.
What is the difference between RGB and HSL?
RGB describes a color through red, green, and blue channel intensities. HSL describes it through hue, saturation, and lightness, which can make it easier to adjust a color’s vividness or brightness.
Why do converted HSL values sometimes differ slightly?
RGB channels are integers, while hue, saturation, and lightness can include decimal values. Rounding during conversion can therefore produce small differences when a color is converted back and forth.
Can I use the converted values directly in CSS?
Yes. Copy the HEX, RGB, or HSL value and use it in a compatible CSS
property. The CSS Copy button in this version copies a
color declaration using the HEX value.
Does the color converter support transparent colors?
Not in this version. RGBA, HSLA, and eight-digit HEX values with an alpha channel are not supported.
Does this tool upload my color values?
The conversion logic runs in your browser and does not require a conversion API. The tool does not send color values to a dedicated conversion server.