Hex to RGB Converter
Convert colors between HEX, RGB, and HSL instantly, in either direction, inside your browser.
What color formats does this convert?
Colors on the web are commonly written in three interchangeable formats: HEX (a six-digit code like #2f6fed), RGB (red, green, and blue values from 0 to 255), and HSL (hue, saturation, and lightness). This tool converts between all three live, with a color picker and preview swatch.
How to use it
How the conversion works
HEX and RGB are two representations of the exact same value — each pair of hex digits is simply the base-16 form of a 0-255 red, green, or blue channel. HSL is calculated from RGB using the standard formula that separates a color into hue (its position on the color wheel), saturation (intensity), and lightness.
Why it helpsFeatures & benefits
Why this runs entirely in your browser
Every conversion is simple math that runs in JavaScript locally in the tab, which means it keeps working offline once the page has loaded and nothing entered here is ever sent to a server.
Common uses
Converting a design tool's hex color into CSS rgb() notation, translating a brand color into HSL to adjust its lightness, or checking what a color code actually looks like.
Frequently asked questions
A few things people usually want to know before trusting the numbers.
Yes — shorthand hex codes like #fff are automatically expanded to their full 6-digit equivalent before converting.
They all describe the exact same colors, just with different notation. HEX and RGB use red/green/blue channel values, while HSL separates a color into hue, saturation, and lightness, which can be more intuitive for adjusting shades.
Hex codes must be 3 or 6 valid hex digits, and RGB values must each be between 0 and 255 — anything outside that range can't represent a valid color.
No, this tool converts solid RGB colors only, without an alpha channel.
No. All conversion happens locally in your browser. Nothing entered here is sent to a server, stored, or shared.