All free tools

Free tool · technology

HSL Colour Converter

Convert a hex colour to RGB and HSL with live values.

Colours

Result

Hue
83°
Saturation
78%
Lightness
55%
HEX  #a3e635
RGB  rgb(163, 230, 53)
HSL  hsl(83, 78%, 55%)
CSS  #a3e635

Runs in your browser · Nothing is uploaded

Embed this on your site

Free to embed. The attribution link stays with the widget, and the calculator keeps working exactly as it does here.

<iframe src="https://thedigitalstash.net/embed/hsl-color-converter" title="The Digital Stash calculator" width="100%" height="720" style="border:0;max-width:100%" loading="lazy"></iframe>

Understanding the HSL Colour Converter

The HSL Colour Converter is a utility designed to translate digital colour codes between different mathematical representations. In web development and graphic design, colours are frequently defined using hexadecimal (hex) notation. However, different tasks often require the use of Red-Green-Blue (RGB) values or Hue-Saturation-Lightness (HSL) values. This tool performs these conversions instantly as you enter a hex code, providing a synchronised view of how that specific colour is structured across the three common systems.

The Methodology of Colour Conversion

A hexadecimal colour code is a six-digit representation of the intensity of red, green, and blue. Each pair of digits corresponds to one of these three colours, expressed in base-16 arithmetic.

To convert from hex to RGB, the tool separates the six-digit string into three pairs. Each pair is converted from base-16 to base-10, resulting in a value between 0 and 255 for each channel.

To derive HSL from RGB, the tool follows a standard algorithmic process. First, it determines the maximum and minimum values among the red, green, and blue components to calculate the lightness. Saturation is determined by the difference between these extreme values relative to the lightness. Hue is calculated based on which colour channel holds the maximum value, expressed as an angle on a 360-degree colour wheel.

A Worked Example

Consider the hexadecimal colour code #B87333, which represents a shade of copper.

  1. Hex to RGB Conversion: The code is split into three parts: B8, 73, and 33.
  • Red: B8 in hex equals 184 in decimal.
  • Green: 73 in hex equals 115 in decimal.
  • Blue: 33 in hex equals 51 in decimal. The resulting RGB value is RGB(184, 115, 51).
  1. RGB to HSL Conversion:
  • Hue: The hue is calculated as 28 degrees on the colour wheel.
  • Saturation: The calculated intensity of the colour is 56 per cent.
  • Lightness: The brightness level is 46 per cent. The resulting HSL value is HSL(28, 56%, 46%).

Interpreting the Results

Interpreting these values depends on the context of your work. The RGB format is the standard for screen-based output, as it mirrors how electronic displays mix light. If you are adjusting a colour in a graphics editor, RGB is the most direct way to specify values.

The HSL format is often considered more intuitive for human selection. Hue allows you to choose a colour family. Saturation lets you decide how vivid or grey the colour appears. Lightness controls how close the colour is to white or black. When you use the HSL converter, you can quickly identify if a colour is too dark for your background contrast or if it needs to be less saturated to fit a muted design palette.

Assumptions and Limits

This tool operates on the assumption of the sRGB colour space, which is the standard for the majority of web browsers and computer monitors. It does not account for CMYK values, which are required for physical printing processes. Because CMYK depends on physical ink properties and paper quality, a direct numerical conversion from hex to CMYK is not possible without specific colour profiles.

Furthermore, the tool assumes 8-bit per channel precision. It does not support High Dynamic Range (HDR) colours or wide-gamut colour spaces such as Adobe RGB or ProPhoto RGB. While the tool provides precise mathematical conversions, it cannot predict how a colour will appear on screens with different calibration settings or colour profiles. It is a mathematical tool rather than a colour management system.

Who This Tool Is Not For

This tool is not intended for professionals who require high-fidelity colour management for professional printing or broadcast media. If your work involves preparing files for a printing press or managing colour consistency across high-end professional photographic equipment, you should use industry-standard software that supports International Colour Consortium (ICC) profiles. This tool is also not suitable for those working with accessibility compliance tools that require specific colour contrast ratios, though it can provide the base data required for such calculations. It is a utilitarian tool for developers and hobbyists who need a quick, accurate conversion for standard digital design tasks.

More tools like this