Hex to RGB Color Converter
Paste a hex color code and get its RGB and HSL equivalents — ready to drop into CSS or a design tool. This free online developer calculator runs entirely in your browser — no signup, no data sent anywhere.
Inputs
Results
How It Works (Formula & Method)
A six-digit hex code encodes three channels: red, green, and blue, two hex digits each. Each pair is parsed from base 16 into a 0–255 value to give RGB. HSL is then derived by finding the maximum and minimum channel values and computing hue, saturation, and lightness from them.
Worked Example
Below is a worked example using the calculator's default values. The same numbers are pre-filled in the form above so you can press Calculate and see the result without typing anything.
Inputs used:
- Hex Color (e.g. #1f6feb): #1f6feb
With these inputs, the calculator computes the metrics shown in the Results panel. Change any value and press Calculate again to see how the result responds — the live widget and the chart both update instantly.
About the Hex to RGB Color Converter
Hex codes are the most common way to write colors on the web, but RGB and HSL are often easier to reason about — RGB for direct channel values, HSL for adjusting hue, saturation, and lightness. This converter translates any hex code into both formats.
Tips & Considerations
- Three-digit shorthand like
#f60expands by doubling each digit to#ff6600. - The leading
#is optional here — both#1f6feband1f6febwork. - HSL is best for generating tints and shades: keep hue and saturation fixed and change only lightness.
Frequently Asked Questions
What does each hex pair mean?
In #RRGGBB the first pair is red, the second green, the third blue. Each pair ranges from 00 (none) to FF (255, full intensity).
Are hex and RGB the same color?
Yes — hex is simply a base-16 way of writing the same three 0–255 channel values that RGB expresses in decimal.
What about transparency?
An eight-digit hex code adds an alpha pair (#RRGGBBAA). This tool converts the opaque RGB portion; handle alpha separately as an rgba() value.
What does the Hex to RGB Color Converter compute?
The Hex to RGB Color Converter takes 1 input value and returns 2 results. Convert a hex color code like #1f6feb to RGB and HSL values for CSS, design tools, and graphics work.