RGB Color Converter | HEX to RGB | Online Color Code Tool
Convert colors between HEX, RGB, RGBA, HSL and HSLA with a built-in color picker
Free online color converter that converts between HEX, RGB, RGBA, HSL, and HSLA formats, with a color picker, preset swatches, and CSS code helpers for web design and UI development.
How to Use
What is color format conversion?
Color format conversion translates a color between HEX, RGB, RGBA, HSL, and HSLA so you can use a consistent value across CSS, design specs, and code.
Color selection
Pick colors with the HSV panel, presets and lightness variants on the left. In the middle, preview the color, paste any CSS color string to parse it, or paste/edit any format row and press Enter to convert—formats stay in sync. Use the right column for RGB/HSL component bars.
Supported input formats
- HEX: e.g. #3498db or #3ad (auto expanded to #33aadd)
- RGB/RGBA: e.g. rgb(52, 152, 219), rgba(52, 152, 219, 0.5)
- HSL/HSLA: e.g. hsl(204, 70%, 53%), hsla(204, 70%, 53%, 0.5)
- CSS named colors: e.g. red, cornflowerblue, and other CSS keywords
Color variations
Below the preview you can see five lightness variations (lighter 50%, lighter 25%, base, darker 25%, darker 50%). Click any of them to use it as the new base color.
CSS code generation
The CSS code section provides three templates: modern syntax, compatible fallbacks, and gradients, ready to copy into your stylesheet.
Tips
- Scroll the mouse wheel on RGB/HSL inputs to adjust; hold Shift for fine grained steps
- Short HEX is only displayed when all three components can be compressed (e.g. #ffcc00 → #fc0)
- The closest matching color name is detected based on HSL distance
- Drag the color component bars to quickly adjust R/G/B/H/S/L