HEX to RGB Converter
Convert HEX colour codes to RGB and HSL.
Input
This tool runs entirely in your browser. The data you paste or load is never uploaded.
Result
Enter your input, then run the tool.
About this tool
Turns a HEX code, with or without the hash and in three or six digits, into RGB, RGBA and HSL values ready to paste into CSS. Alpha is preserved when the HEX includes an alpha pair.
How to use it
- Pick a colour or type a HEX code.
- Read the RGB, RGBA and HSL values.
- Copy the format your stylesheet needs.
Frequently asked questions
What does #fff expand to?
Three-digit HEX is shorthand: each digit is doubled, so #fff becomes #ffffff.
Does it support eight-digit HEX?
Yes. The last two digits are the alpha channel and are converted to a 0–1 opacity value.
Keep going
Related tools
RGB to HEX Converter
Convert RGB channel values into a HEX code.
RGB to HSL Converter
Convert RGB channels to hue, saturation and lightness.
Color Contrast Checker
Test text and background colours against WCAG 2.2.
CSS Gradient Generator
Build linear and radial gradients with copy-ready CSS.
CSS Box Shadow Generator
Design layered shadows and copy the CSS.
CSS Border Radius Generator
Shape corners with independent radii and copy the CSS.