Skip to main content
ToolCube – All tools at one place.

HEX to HSL Converter

Turn a HEX code into hue, saturation and lightness, the format that makes it easy to create lighter, darker or softer versions of a color.

  • HEX to HSL preselected
  • Every format with Copy
  • Contrast checker

Convert a color

Detected: HEX

RGB
HSL

All formats

  • HSLhsl(24, 100%, 50%)
  • HEX#ff6600
  • RGBrgb(255, 102, 0)
  • HSV / HSBhsv(24, 100%, 100%)
  • CMYKcmyk(0%, 60%, 100%, 0%)
  • Nameclosest: orangered
  • CSScolor: #ff6600;

CMYK values are an approximation for screen colors; printed colors depend on the printer profile.

Pick a color from an image

Upload a photo or screenshot (JPG, PNG, WebP, AVIF or iPhone HEIC), then click or tap any point to pick its color. The image stays on your device.

Want to recolor part of an image? Try Change Image Color.

Shades, tints and harmonies

Shades (darker)

  • #e85d00
  • #d15300
  • #b94a00
  • #a24100
  • #8b3800
  • #742e00
  • #5d2500
  • #461c00
  • #2e1300
  • #170900

Tints (lighter)

  • #ff7417
  • #ff822e
  • #ff9046
  • #ff9e5d
  • #ffac74
  • #ffb98b
  • #ffc7a2
  • #ffd5b9
  • #ffe3d1
  • #fff1e8

Harmonies

Complementary – Opposite on the color wheel (180°).

Analogous – Neighbours 30° either side.

Triadic – Three colors 120° apart.

Split-complementary – The two colors next to the complement (150° and 210°).

Tetradic (square) – Four colors 90° apart.

Contrast checker (WCAG)

  • Your color on white

    2.93:1

    Sample of your color as text on #ffffff: contrast 2.93:1.

    • AA normal: Fail
    • AA large: Fail
    • AAA normal: Fail
    • AAA large: Fail
  • Your color on black

    7.15:1

    Sample of your color as text on #000000: contrast 7.15:1.

    • AA normal: Pass
    • AA large: Pass
    • AAA normal: Pass
    • AAA large: Pass
  • Your color on #1e3a8a

    3.52:1

    Sample of your color as text on #1e3a8a: contrast 3.52:1.

    • AA normal: Fail
    • AA large: Pass
    • AAA normal: Fail
    • AAA large: Fail

Guide

How to convert HEX to HSL

  1. Convert the HEX code to RGB, then divide each value by 255 to get numbers from 0 to 1.
  2. Lightness is the average of the largest and smallest of the three values.
  3. If they are equal, the color is grey: saturation and hue are 0. Otherwise saturation = (max − min) ÷ (1 − |2 × lightness − 1|).
  4. Hue depends on which channel is largest and is measured in degrees around the color wheel (red 0°, green 120°, blue 240°).

Why designers use HSL

HSL describes a color the way people think about it. The hue is the basic color, such as orange at about 24°; saturation says how vivid it is; and lightness says how close it is to black or white. To make a hover color slightly darker, you only lower the lightness, without touching the other two numbers.

That makes HSL popular for design systems and CSS themes. A whole palette can share one hue and step through lightness values, and every browser supports hsl() and hsla() in CSS.

About decimals

HEX codes have 16.7 million possible colors, while whole-number HSL values can describe fewer. To make sure a color converts back to exactly the same HEX code, this converter shows HSL with one decimal place when it is needed, such as hsl(0, 0%, 50.2%) for #808080. Rounding to whole numbers is fine for most design work, but it can shift the color by one step.

Building a palette from one HEX code

Once a brand color is in HSL, you can create a whole scale by changing only the lightness. For #2563eb, a strong blue at hsl(221, 83%, 53%), lightness steps of 95%, 85%, 70%, 53% and 30% give a pale background, a border, a hover color, the main color and a dark text color, all with the same hue. Keep saturation close to the original for a consistent look.

The converter's shades and tints below the tool do a similar job by mixing with black and white, if you prefer to pick a step visually.

HEX to HSL chart of common colors

HEX to HSL values for common colors
ColorHEXHSL
Black#000000hsl(0, 0%, 0%)
White#ffffffhsl(0, 0%, 100%)
Red#ff0000hsl(0, 100%, 50%)
Lime#00ff00hsl(120, 100%, 50%)
Blue#0000ffhsl(240, 100%, 50%)
Yellow#ffff00hsl(60, 100%, 50%)
Cyan#00ffffhsl(180, 100%, 50%)
Magenta#ff00ffhsl(300, 100%, 50%)
Silver#c0c0c0hsl(0, 0%, 75.3%)
Gray#808080hsl(0, 0%, 50.2%)
Maroon#800000hsl(0, 100%, 25.1%)
Olive#808000hsl(60, 100%, 25.1%)
Green#008000hsl(120, 100%, 25.1%)
Purple#800080hsl(300, 100%, 25.1%)
Teal#008080hsl(180, 100%, 25.1%)
Navy#000080hsl(240, 100%, 25.1%)
Orange#ffa500hsl(38.8, 100%, 50%)
Tomato#ff6347hsl(9.1, 100%, 63.9%)

Other colors: use the converter above or the Color Converter.

FAQ

Frequently Asked Questions

Answers to common questions about HEX to HSL on ToolCube.

What is #ff6600 in HSL?

#ff6600 is hsl(24, 100%, 50%): an orange hue at full saturation and middle lightness.

Why does grey have a hue of 0?

Greys have no saturation, so the hue has no effect. By convention it is written as 0.

Can I use HSL in CSS?

Yes. All modern browsers support hsl() and hsla(), for example color: hsl(24, 100%, 50%);.