To move color codes between CSS, design files and programs, check the original values, alpha and destination format. Enter #3ac in the color converter and verify that #33aacc and rgb(51, 170, 204) describe the same opaque color.
Choose HEX, RGB or HSL for the task
| Format | Example | Use | Check |
|---|---|---|---|
| HEX | #33aacc / #3ac | Store original 8-bit values in CSS or a palette | Repeat each shorthand digit |
| RGB | rgb(51, 170, 204) | Compare channel values or use code | Each component is 0–255 |
| HSL | hsl(193, 60%, 50%) | Adjust hue, saturation and lightness | Integer output is rounded |
| CSS with alpha | #ff000080 | Layer a translucent color | 80 means 128/255 alpha |
| Component | Calculation | Decimal |
|---|---|---|
| 33 | 3×16 + 3 | 51 |
| aa | 10×16 + 10 | 170 |
| cc | 12×16 + 12 | 204 |
| ff | 15×16 + 15 | 255 |
Preserve the original color
Check HEX and RGB against each other
Enter #3ac and compare #33aacc with the RGB components 51, 170 and 204. Copy the format your destination expects.
HSL lightness and WCAG luminance have different roles
HSL represents hue, saturation and lightness. The tool accepts a nonnegative safe integer hue and wraps it modulo 360. Saturation and lightness are integers from 0 to 100. For hsl(210,100%,50%), rounding RGB to 8-bit components gives #0080ff.
The HSL L value is not the relative luminance used by WCAG. Yellow at hsl(60,100%,50%) and blue at hsl(240,100%,50%) have the same L but different contrast on white. Check a foreground/background pair with the contrast guide and checker.
Check supported input syntax before copying
| Input | Tool behavior | Action |
|---|---|---|
| #3ac / 33aacc | Three- or six-digit HEX | Leading # is optional |
| rgb(51, 170, 204) | Comma-separated integers | Check component ranges |
| hsl(210, 100%, 50%) | Comma-separated integers | Hue wraps modulo 360 |
| rgba(255,0,0,0.5) / #ff000080 | Alpha input gives an error | Check the original and background |
| rgb(51 170 204) / display-p3 / color names | Unsupported | Use browser tools for full CSS parsing |
Composite transparent colors with the background
For a simple source-over composite on an opaque background, each resulting component is alpha × foreground + (1 − alpha) × background. Using ordinary sRGB-component compositing, 50% red over white rounds to rgb(255,128,128), approximately #ff8080. The alpha in #ff000080 is 128/255, slightly different from 0.5.
For a background image, gradient or blend mode, inspect the actual compositing conditions and location. To generate more candidates, use the palette guide and palette generator.
Verify the destination
Check the pasted code and opacity setting
Copy HEX or RGB when you need the original channels. Inspect the destination’s opacity and background as well as the code.
You can reopen the tool from the utility category. A favorite adds a shortcut to My Tools in the same browser. Keep the actual color values in your design file.
Tools Hub editorial staff checked CSS references, input handling, copying and rounding examples on November 8, 2026.
FAQ
How do I expand three-digit HEX?
Repeat each digit. #3ac becomes #33aacc. The component values are 51, 170 and 204, giving rgb(51, 170, 204).
Can I enter four- or eight-digit HEX or rgba()?
CSS supports these alpha formats, but this tool handles opaque colors. An alpha input produces an error. Check both the original color and its background.
Why does converting through HSL slightly change a color?
The HSL output rounds hue, saturation and lightness to integers. #33aacc displays as hsl(193, 60%, 50%), which converts back to #33abcc. Copy HEX or RGB to preserve the original 8-bit values.
Can I copy a result during an input error?
Copy is disabled while input is invalid. Enter RGB integers from 0 to 255 or saturation and lightness integers from 0 to 100%. Valid input enables copying again.