RGBA to HEX
Turn any rgba() value with transparency into an 8-digit HEX color.
HEX
#4F46E580
About the rgba to hex
8-digit HEX is a compact way of encoding an RGBA color. The first six digits are the usual RGB pairs and the last two encode alpha from 00 (fully transparent) to FF (fully opaque).
rgba(79, 70, 229, 0.5) becomes #4F46E580.
Frequently asked questions
Is 8-digit HEX with alpha supported in CSS?+
Yes. All modern browsers support 8-digit HEX values where the last two digits represent alpha.
How is the alpha channel converted to HEX?+
Multiply the 0–1 alpha by 255 and convert to two hexadecimal digits. 0.5 alpha becomes 80 in HEX.
Should I use 8-digit HEX or rgba()?+
Use whichever is easier in your codebase. 8-digit HEX is more compact; rgba() is easier to read.
Color converter tools
Use a focused converter when you already know the input and output format.
Color Converter
Convert any color between HEX, RGB, HSL, HSV and CMYK.
HEX to RGB
Convert HEX color codes to RGB instantly.
RGB to HEX
Convert RGB color values to HEX codes.
HEX to HSL
Convert HEX color codes to HSL instantly.
HSL to RGB
Convert HSL color values to RGB instantly.
CMYK to RGB
Convert CMYK print colors to RGB and HEX.