Developer
HEX to RGB Converter
Convert HEX colours to RGB and HSL, or pick a colour visually. Live swatch and copy.
About this tool
This colour converter turns a HEX code into RGB and HSL values, and lets you pick a colour visually. Designers and developers use it to move a colour between the formats different tools expect — a hex code for CSS, RGB for design apps, HSL for adjusting lightness and saturation.
The three formats
- HEX — a six-digit code like
#22c55e, common in CSS and design handoffs. - RGB — red, green, and blue from 0–255, e.g.
rgb(34, 197, 94). - HSL — hue, saturation, and lightness, which makes it easy to create tints and shades of the same colour.
How HEX and RGB relate
A hex colour is just RGB written in base 16. The first two digits are red, the next two green, the last two blue — so #22c55e is red 0x22 (34), green 0xc5 (197), blue 0x5e (94). Three-digit shorthand like #2c5 expands by doubling each digit. This tool handles both and shows the result as a live swatch.
Everything is computed in your browser. Pick a colour with the picker or type a hex value — the RGB and HSL update instantly.
Frequently asked questions
How do I convert HEX to RGB?
Split the six-digit hex code into three pairs and read each as a base-16 number. #22c55e is red 34, green 197, blue 94 — or rgb(34, 197, 94). This tool does it instantly.
What is the difference between RGB and HSL?
RGB describes a colour by its red, green, and blue components. HSL describes it by hue, saturation, and lightness, which is more intuitive for making a colour lighter, darker, or less saturated.
Does it accept 3-digit hex codes?
Yes. Shorthand like #2c5 is expanded automatically to its six-digit form (#22cc55) before converting.
Can I pick a colour visually?
Yes. Use the colour picker to choose a colour and the HEX, RGB, and HSL values update to match.
Is anything sent to a server?
No. All conversion happens in your browser.
Related tools
JSON Formatter & Validator
Beautify, validate, or minify JSON instantly in your browser. Spot syntax errors fast.
Developer
Base64 Encode & Decode
Encode text to Base64 or decode Base64 to text, with full Unicode support. Runs in your browser.
Developer
URL Encoder & Decoder
Percent-encode text for safe use in URLs, or decode encoded links back to readable text.
Developer
UUID Generator
Generate random version 4 UUIDs one at a time or in bulk, using secure browser randomness.
Developer
