+Moyoutil
English

HEX to RGB and HSL Converter

Convert HEX color codes to RGB and HSL values.

How to use the HEX to RGB and HSL Converter

Use the color picker or enter 3 or 6 hexadecimal digits, optionally prefixed with #. View the RGB and HSL values together. Invalid HEX input hides the preview and disables copying. The picker keeps the last valid color; choosing a new color replaces the invalid input.

Example usage

#3366FF is RGB(51, 102, 255). Colors entered as 3 digits, such as #fff, are expanded to 6 digits.

Please note

This tool handles opaque sRGB colors. 4-digit and 8-digit HEX with alpha channel are not supported.

Step-by-step instructions

  1. Enter a HEX value such as #3366FF, or use the color picker.
  2. Check the color preview and RGB·HSL values.
  3. Copy the result to take the necessary values, such as CSS.

Three color expressions

HEX displays RGB channel values ​​in hexadecimal, and RGB represents red, green, and blue with values ​​from 0 to 255, respectively. HSL is expressed in terms of hue angle, saturation, and brightness. This tool is based on opaque sRGB and HSL values ​​are rounded to the nearest whole number. It does not check color contrast or CMYK conversion for printing.

Color converter input and result example
HEXRGBHSL
#3366FF51, 102, 255225°, 100%, 60%
#FFFFFF255, 255, 2550°, 0%, 100%
#0000000, 0, 00°, 0%, 0%

Frequently Asked Questions

Are #fff and #ffffff the same color?

Yes. Repeat each character of the three-digit HEX twice to expand it to six digits.

Can colors include transparency?

Currently, only 3-digit and 6-digit HEX are supported. Alpha channels of 4-digit and 8-digit HEX and rgba are not processed.

When converted back to HSL, the values ​​are slightly different.

HSL on screen rounds to integers. Keep the original HEX as repeated conversions may result in small differences.

Created and operated by: Moyoutil · Content review: 2026-10-01 · Error report

Tool Utilization Blog

See all blogs

Why 50% HSL Lightness Does Not Mean Equal Text Contrast

Reproduce different relative luminance and white-background contrast for red and green with the same HSL lightness using W3C formulas.

Read the article

HEX to RGB and HSL: Shorthand Colors and Rounding Differences

Check three-digit HEX, RGB values, gray hues and rounded HSL with actual conversion results. Learn how to preserve the original color and recognize alpha-input limits.

Read the article