Home / Images & Design / HEX, RGB and HSL Converter
🎨

HEX, RGB and HSL Converter

Convert colors between HEX, RGB and HSL.

About HEX, RGB and HSL Converter

Web designers and developers switch between HEX, RGB and HSL color formats daily. Pick a color or type a value, and this converter shows all three formats and a preview. It accepts HEX codes with or without the hash and RGB values. It helps when moving colors between design tools and CSS.

Example

Input: #10b981. Output: rgb(16, 185, 129) and hsl(160, 84%, 39%) with a color swatch.

Tips for better results

  • HEX is compact, RGB is handy for transparency in CSS, and HSL makes it easy to adjust lightness.
  • Check that the color keeps good contrast with its background.
  • Copy values directly from the results.

When to use HEX, RGB and HSL Converter

This converter is useful whenever a color arrives in one format and the tool you are using wants another. A designer may send a HEX code while a stylesheet needs RGB, or a developer may want HSL to make a color lighter without guessing. Marketers working in website builders, students learning CSS and anyone matching a brand color across apps can save time. Type the value, check the preview, copy the format you need and move on.

Real-world uses

  • A marketer copies a brand HEX code from a style guide and needs the RGB values for a social media design program.
  • A beginner learning CSS pastes an RGB value from a screenshot color picker to find the HEX version for a stylesheet.
  • A developer converts a color to HSL so a hover state can be made slightly darker by reducing the lightness value.
  • A presenter matches a slide background to a company logo by entering the logo color and copying the value the software accepts.

Common mistakes to avoid

  • Typing a HEX code with the wrong number of characters gives a different color or an error. Use six digits, or three for the short form, and check the preview.
  • Rounding can make converted values differ by a tiny amount between tools. If an exact match matters, keep using the original code as your reference.
  • A color picked from a compressed screenshot may not match the original brand color. Use the official color value from the brand guide when you can.

How to use HEX, RGB and HSL Converter

  1. Pick a colour with the colour picker, or type a value into β€œOr type HEX / rgb()”.
  2. Typed values take priority. You can enter #10b981, 10b981 or rgb(16,185,129).
  3. Read the HEX, RGB and HSL versions and copy the one you need.

Worked examples

Example 1: Picker set to #10b981.

Result: HEX #10B981, rgb(16, 185, 129), hsl(160, 84%, 39%).

Example 2: Typed: rgb(255, 99, 71).

Result: HEX #FF6347, hsl(9, 100%, 64%).

Example 3: Typed: #000.

Result: HEX #000000, rgb(0, 0, 0), hsl(0, 0%, 0%). Three-digit codes are expanded automatically.

Limitations and things to check

  • Alpha (transparency) values are not converted.
  • HSL values are rounded to whole numbers, so converting back may differ by one step.
  • CMYK for print is not included.

More tools like this: Images & Design.

Frequently asked questions

Why does HSL help when adjusting colors?

HSL describes hue, saturation and lightness separately, so you can change one aspect at a time. Raising lightness gives a lighter tint, and lowering saturation gives a more muted tone, without recalculating channels.

Can I use a color name instead of a code?

This tool works with color codes. If you only know a name like navy, look up the code for the exact shade you want, since the same name can mean slightly different colors.

What is the difference between HEX and RGB?

They describe the same colour. HEX writes red, green and blue as two-digit hexadecimal numbers; RGB writes them as numbers from 0 to 255.

When is HSL useful?

HSL (hue, saturation, lightness) makes it easy to create lighter or darker versions of a colour by changing one number.

Can I use short HEX codes like #fff?

Yes, three-digit codes are expanded, so #fff becomes #FFFFFF.

Related tools

Related guides