RGB to Hex Converter
Use RGB sliders (with alpha) or paste a hex code. Get hex, RGBA, HSL, and the nearest of 140 CSS named colors. Check WCAG contrast (AA/AAA) and explore matching palettes — click any swatch to copy.
All conversions and palette generation happen in your browser. Nothing is uploaded.
How to use this rgb to hex converter
- Adjust RGB sliders (with alpha) or paste a hex code.
- View hex, RGB, RGBA, HSL and nearest CSS color name.
- Check WCAG contrast against white and black.
- Click any swatch in tints, shades, complementary, analogous or triadic to copy.
Frequently asked questions
How do I convert RGB to hex?
Each RGB component (0-255) is converted to a 2-digit hexadecimal value. RGB(37, 99, 235) becomes #2563eb.
What does the nearest CSS color name show?
The closest of 140 CSS named colors (red, dodgerblue, lavender, etc.) by Euclidean distance — useful when you need a friendly name.
Can I include transparency?
Yes. Adjust the alpha slider for an 8-digit hex like #2563ebcc.
Why does my CSS color render differently from the hex I picked here?
Browsers render colors in the display's actual color space. If your monitor is wide-gamut (P3) and the page doesn't declare a color profile, the browser falls back to sRGB and the rendered color can shift visibly. Use the CSS `color()` function with explicit color space if exact match matters.