Color Hex to RGB Converter
Convert colors between hex, RGB, and HSL formats. Pick a color or type values manually.
Color Values
How to Use
- Enter a hex color code (e.g., #2563eb) or use the color picker.
- Or enter RGB values (0-255) to convert to hex.
- View the converted values in Hex, RGB, and HSL formats.
- Click Copy next to any value to copy it.
About This Tool
This color converter translates between hex, RGB, and HSL color formats used in web development and design. Hex colors are commonly used in CSS, while RGB values are used in many design tools. HSL (Hue, Saturation, Lightness) is often more intuitive for adjusting colors. All conversions happen instantly in your browser.
What Is a Hex to RGB Color Converter?
Colors on the web are represented in several formats, and the most common are hex and RGB. A hex color code like #2563eb is a compact six-character string that encodes red, green, and blue intensity values in hexadecimal (base-16) notation. RGB, on the other hand, uses three decimal numbers ranging from 0 to 255 to define the same color.
Converting between these formats is something designers and developers do constantly. CSS accepts both #2563eb and rgb(37, 99, 235), but different design tools, style guides, and codebases may prefer one format over the other. This converter also includes HSL (Hue, Saturation, Lightness), which many designers find more intuitive for adjusting colors because you can independently control brightness and saturation.
Whether you're matching brand colors across platforms, translating a mockup into code, or experimenting with color palettes, this tool lets you convert instantly without doing the math yourself.
Frequently Asked Questions
What is the difference between hex and RGB?
They represent the same color information in different number systems. Hex uses base-16 (0-9 and A-F), packing each channel into two characters. RGB uses familiar base-10 numbers from 0 to 255. The visual result is identical — it's purely a formatting difference.
What does HSL stand for and why is it useful?
HSL stands for Hue, Saturation, and Lightness. Hue is the color angle on the color wheel (0-360 degrees), saturation controls how vivid the color is, and lightness controls how bright or dark it appears. HSL is useful because you can create lighter or darker shades by adjusting just one value.
Can I use shorthand hex codes like #fff?
Yes. This tool accepts both 3-character shorthand codes (like #fff or #09c) and full 6-character codes (like #ffffff or #0099cc). Shorthand codes are expanded by doubling each character — so #fff becomes #ffffff.
Which format should I use in my CSS?
Hex codes are the most compact and widely used in CSS. RGB is helpful when you want to add transparency using rgba(). HSL is great for programmatically generating color variations. All three are fully supported in modern browsers.
Example Conversions
- #ffffff (White) — RGB: 255, 255, 255 | HSL: 0, 0%, 100%
- #000000 (Black) — RGB: 0, 0, 0 | HSL: 0, 0%, 0%
- #ff0000 (Red) — RGB: 255, 0, 0 | HSL: 0, 100%, 50%
- #2563eb (Blue) — RGB: 37, 99, 235 | HSL: 221, 83%, 53%
- #10b981 (Green) — RGB: 16, 185, 129 | HSL: 160, 84%, 39%