Convert between HEX, RGB, and HSL color codes instantly. Type any format, adjust with sliders, and see the live preview — 100% in your browser.
HEX and RGB are two ways to represent the same color. HEX uses a 6-digit hexadecimal code (base-16), while RGB uses three decimal numbers (0–255) for red, green, and blue channels. Converting between them is essential when moving between design tools, CSS, JavaScript, and print workflows.
#.#3B82F6 (6-digit). The standard for CSS, HTML, and design tools.3B82F6. For systems that don't accept the hash symbol.rgb(59, 130, 246). Red, green, blue channels (0–255).rgba(59, 130, 246, 1). RGB with an alpha (opacity) channel.hsl(217, 91%, 60%). Hue, saturation, lightness — better for systematic color adjustment.hsla(217, 91%, 60%, 1). HSL with alpha.hsv(217, 84%, 92%). Hue, saturation, value — common in color pickers and image editing software.cmyk(84%, 58%, 0%, 8%). Cyan, magenta, yellow, black — used in print design.| Color | HEX | RGB | HSL |
|---|---|---|---|
| Red | #FF0000 | rgb(255, 0, 0) | hsl(0, 100%, 50%) |
| Green | #00FF00 | rgb(0, 255, 0) | hsl(120, 100%, 50%) |
| Blue | #0000FF | rgb(0, 0, 255) | hsl(240, 100%, 50%) |
| Yellow | #FFFF00 | rgb(255, 255, 0) | hsl(60, 100%, 50%) |
| Cyan | #00FFFF | rgb(0, 255, 255) | hsl(180, 100%, 50%) |
| Magenta | #FF00FF | rgb(255, 0, 255) | hsl(300, 100%, 50%) |
| Black | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) |
| White | #FFFFFF | rgb(255, 255, 255) | hsl(0, 0%, 100%) |
A 6-digit HEX code is really three pairs of hex values:
So #3B82F6 breaks down as:
3B = 59 in decimal (Red)82 = 130 in decimal (Green)F6 = 246 in decimal (Blue)3-digit HEX codes (like #F0C) are shorthand: each digit is doubled. So #F0C = #FF00CC.
All conversions happen in your browser using JavaScript. Nothing is uploaded, stored, or shared.