Every color on a screen has three codes: hex, RGB, and HSL. They all describe the same color — just in different number systems. Here's how each works, when to use which, and how to find the code for any color you see.
Hex codes start with # followed by 6 characters (0-9 and A-F). The format is #RRGGBB — two characters each for red, green, and blue intensity.
| Hex Value | Decimal Equivalent | Meaning |
|---|---|---|
| 00 | 0 | None of this color channel |
| 80 | 128 | Half intensity |
| FF | 255 | Full intensity |
So #FF5733 means: full red (FF=255), moderate green (57=87), some blue (33=51). The result is a burnt orange.
RGB uses three decimal numbers from 0 to 255: rgb(red, green, blue). It's the same information as hex, just in base-10 instead of base-16.
| RGB Value | Color | Why |
|---|---|---|
| rgb(255, 0, 0) | Pure red | Max red, no green, no blue |
| rgb(0, 255, 0) | Pure green | No red, max green, no blue |
| rgb(0, 0, 255) | Pure blue | No red, no green, max blue |
| rgb(255, 255, 0) | Yellow | Max red + max green = yellow |
| rgb(255, 255, 255) | White | All channels at maximum |
| rgb(128, 128, 128) | Medium gray | All channels equal = gray |
HSL describes color the way humans think about it: hsl(hue, saturation, lightness).
Why HSL matters for developers: To make a button hover state darker, just lower the lightness by 10%. With hex or RGB, you'd need to calculate new values for all three channels. HSL makes color math intuitive.
Open Color Picker, select a color visually from the wheel or spectrum, and get hex, RGB, and HSL codes instantly. Best for: choosing new colors for a design or project.
Right-click any element on a webpage > Inspect (F12). In the Styles panel, find the color property. The hex/RGB/HSL code is displayed directly. Click the color swatch to open Chrome's built-in picker for that value.
Upload a logo, screenshot, or photo to Color Extractor. Click anywhere on the image to get the exact color code. Best for: matching brand colors from a logo file or design mockup.
Have an RGB value but need hex? Type it into the Hex-RGB Converter or the Color Picker and all formats appear. Works in any direction: hex to RGB, RGB to HSL, HSL to hex.
Mac: Digital Color Meter (built-in, Applications > Utilities). Windows: PowerToys Color Picker (Win+Shift+C). These sample any pixel on your screen in real-time.
| Color | Hex | RGB | Use Case |
|---|---|---|---|
| Tailwind Blue-500 | #3B82F6 | rgb(59, 130, 246) | Default blue in Tailwind CSS |
| Bootstrap Primary | #0D6EFD | rgb(13, 110, 253) | Bootstrap 5 primary blue |
| Material Design Indigo | #3F51B5 | rgb(63, 81, 181) | Google Material Design |
| GitHub Dark BG | #0D1117 | rgb(13, 17, 23) | GitHub dark mode background |
| Slack Aubergine | #4A154B | rgb(74, 21, 75) | Slack brand purple |
| Spotify Green | #1DB954 | rgb(29, 185, 84) | Spotify brand green |
Find any color code — hex, RGB, HSL. Instant conversion.
Open Color Picker