About this tool
Convert between HEX (including #RGB, #RRGGBB and #RRGGBBAA) and rgba() with an adjustable alpha and a checkerboard preview, all in your browser.
Type in either field and the other updates, along with the alpha slider and the preview. The tool reads 3, 4, 6 or 8 digit hex codes, with or without the #. A 3 or 4 digit code is expanded by doubling each digit, and 3 and 6 digit codes are fully opaque. Hex produced from the rgba field or the slider is always the 8 digit form, with the alpha pair last.
On the rgba side, rgb() and rgba() are both read, separated by commas or spaces. Red, green and blue must be 0 to 255, and alpha 0 to 1 or a percentage. Text that cannot be read shows an invalid message and leaves the other field unchanged.