Hex to RGB Converter

HEX
RGB
HSL
Part of the Everyday Calculators hubBrowse every everyday calculator in one place

How the hex to RGB converter works

Enter a hex color code and the tool instantly shows the equivalent RGB and HSL values, with a live color swatch. It works both ways: change the red, green, and blue fields and the hex code updates to match. It is the quick reference for translating colors between the formats CSS and design tools use.

Hex, RGB, and HSL explained

A hex code like the one shown packs red, green, and blue into a six digit hexadecimal value, two digits each. RGB writes those same three channels as decimal numbers from 0 to 255. HSL describes color as hue, saturation, and lightness, which many designers find more intuitive for creating tints and shades.

Converting by hand

Each pair of hex digits is a number from 0 to 255 in base 16, so the conversion to RGB is a base conversion of each channel. Going from RGB to hex reverses it. HSL is derived from the RGB values with a standard formula. The tool does all of this for you and keeps every field in sync.

Using it in your work

Designers and developers use it to match a color from a mockup to CSS, to convert a brand color provided in one format into another, or to tweak a shade by editing HSL lightness. The swatch lets you confirm the color visually, and the copy button grabs the hex for pasting into your stylesheet.

Frequently asked questions

How do I convert hex to RGB? Split the six digit code into three pairs and read each as a base 16 number from 0 to 255.

Does it support shorthand hex? Yes, three digit codes are expanded automatically.

What is HSL? A color model using hue, saturation, and lightness, handy for making tints and shades.

Related tools: JSON Formatter, Base64, Password Generator.

Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.