The last digit of four-digit HEX is alpha
Input and settings
Color: #0f08
Expected result
HEX: #00ff0088 RGBA: rgba(0, 255, 0, 0.533) HSLA: hsla(120, 100%, 50%, 0.533)
Convert between HEX, RGB, and HSL color values with an immediate preview.
These are example steps; replace the values for your task.
Paste a HEX, RGB, or HSL value to see equivalent numeric formats beside the preview. This is useful when a design file provides HEX but a stylesheet or animation uses RGB or HSL.
Alpha is preserved when supplied through four- or eight-digit HEX, rgba(), or hsla(). Named colors and CMYK are not converted.
Enter values such as #ff0000, rgb(255, 0, 0), or hsl(0, 100%, 50%) and see all three formats. Short HEX and alpha values are supported.
Named colors and every CSS Color 4 syntax are outside this tool's scope. Use the displayed numeric values for reliable comparison.
Use a translucent short HEX value and HSL blue to compare color components and alpha notation.
Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.
Color: #0f08
HEX: #00ff0088 RGBA: rgba(0, 255, 0, 0.533) HSLA: hsla(120, 100%, 50%, 0.533)
Color: hsl(240, 100%, 50%)
HEX: #0000ff / RGB: rgb(0, 0, 255) HSL: hsl(240, 100%, 50%)
Short HEX repeats each digit, so #0f08 expands to #00ff0088. Alpha 88 is opacity 136/255, displayed as 0.533. HSL lightness 50% does not mean every RGB component is half its maximum. A translucent color’s appearance also depends on the background underneath.
Supported forms are 3/4/6/8-digit HEX and comma-separated RGB(A)/HSL(A). Color names, modern space-separated CSS, OKLCH, CMYK and print color management are unsupported. Some values are clamped, so this is not strict CSS validation. RGB rounds to integers, HSL to two decimals and alpha to three; conversions are not fully lossless.
Verification: independent checks cover repeated HEX digits, 136/255 and an HSL primary color. Browser checks compare all three formats, the preview and original-input restoration.
#ff000080
#ff000080 rgba(255, 0, 0, 0.502) hsla(0, 100%, 50%, 0.502)
Displayed alpha values are rounded. When converting eight-digit HEX, check the alpha number as well as the preview.
The final 80 is hexadecimal 128. Dividing 128 by 255 gives an alpha of about 0.502. CSS alpha is 0 for transparent and 1 for opaque. The background affects the appearance, so contrast also requires a background color.
Yes. Four- and eight-digit HEX, rgba, and hsla are supported.
No. Input is not stored.
No. This tool focuses on screen colors in the RGB family.
Share only the tool name and public URL. Your input and results are not included.
Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.
Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.