Convert a Six-Digit HEX Color Into RGB Values
Start with the task you actually need to finish
- Converting a HEX brand colour from a style guide into RGBA for a CSS overlay with transparency.
- Building a design system's colour scale by adjusting HSL lightness values.
- Matching a colour picked from an image editor to the CSS value used in code.
A practical check before you begin
The color #3B82F6 separates into pairs 3B, 82, F6. Converting each pair to decimal gives rgb(59, 130, 246). Send both the format and values when handing a color to another designer.
Follow the workflow and review the result
- Enter a HEX colour code, or switch input mode to RGB or HSL.
- Watch the live swatch update to preview the exact colour.
- Check the converted values shown in HEX, RGB, RGBA and HSL formats.
- Adjust sliders or type new values to fine-tune the colour.
- Copy the format you need directly into your CSS or design file.
How HEX to RGB conversion works
A hex colour packs three byte pairs for red, green and blue. #FF5733 splits into FF, 57 and 33, which convert from base 16 to decimal as rgb(255, 87, 51) — the same colour, expressed in a different numbering system.
When to reach for HSL
HSL separates hue, saturation and lightness, which makes building tints and shades intuitive: keep hue and saturation fixed and vary only lightness to generate a consistent colour scale for buttons, borders and backgrounds.
RGBA and transparency
RGBA adds a fourth alpha channel for transparency, useful for overlays and hover states. HEX and plain RGB have no transparency component, so converting to RGBA is often the step needed before adding opacity in CSS.
Limits worth knowing before you rely on the output
Color conversion is not an accessibility contrast check. Shorthand and alpha formats may need a different input workflow.