About this tool
A HEX colour such as #1a73e8 is a compact way of writing three numbers: how much red, green and blue to mix. Paste a HEX code and this tool shows those numbers as rgb(), the same colour with alpha as rgba(), and as HSL, which is handy when you want to make a colour lighter or darker.
It understands short codes like #fff, standard six-digit codes and eight-digit codes that include transparency.
How to use it
- Type or paste a HEX code, with or without the # sign.
- See the swatch and the RGB, RGBA and HSL values.
- Copy the format you need.
Good to know
- A three-digit code doubles each digit, so #0af means #00aaff.
- In an eight-digit code the last two digits are the opacity, which shows up as the alpha number in RGBA.
- To go the other way, use the RGB to HEX converter.
Key features
- Instant conversion as you type.
- Copy the result in one click.
Limitations
- Out-of-range values are rejected instead of being rounded silently.
Privacy and security
Runs in your browser; the file is not sent to any server.
Frequently asked questions
How do I convert HEX to RGB by hand?
Split the code into three pairs, then read each pair as a base 16 number. For #1a73e8 the pairs 1a, 73 and e8 are 26, 115 and 232.
What is the difference between RGB and HSL?
RGB mixes light, while HSL describes hue, saturation and lightness. HSL is often easier for tweaking a colour.
Does it accept uppercase or lowercase?
Both work.
What is an eight-digit HEX code?
It is a six-digit colour followed by two digits for transparency.
More tools you may need
Related guides
Last reviewed: 2026-11-23. Found a mistake? Tell us. See our tool accuracy policy.