A color picker lets you choose a color visually and read back its exact code in HEX, RGB and HSL, converting between all three formats in real time. That is the core job, but a good color picker is also a color converter that handles hex to rgb and rgb to hex in both directions, builds tints and shades, finds the complementary color, and checks contrast for accessibility. This page explains what every one of those numbers means, the math that turns a hex color picker value into RGB and back, and how to use the tool well whether you are writing CSS, designing a brand palette, or tuning the colors on a landing page.
What a hex code actually means
A hex code like #3B82F6 looks cryptic until you break it apart. The hash is just a marker that says “a color follows.” The six characters after it are three pairs, one each for red, green and blue. The first pair, 3B, is the red channel; 82 is green; F6 is blue. Each pair is written in hexadecimal — base 16 — which uses the digits 0 through 9 and then the letters A through F to represent the values 10 through 15.
Because each channel is two hex digits, it can hold any value from 00 (0 in decimal) up to FF (255). That gives 256 possible levels per channel and 256 × 256 × 256 = 16,777,216 colors in total — the “16 million colors” figure you have probably seen. A pure red is #FF0000, pure green is #00FF00, pure blue is #0000FF, black is #000000 and white is #FFFFFF. There is also a shorthand three-digit form: #F00 expands to #FF0000 by doubling each digit, which is why this color code picker accepts both three- and six-digit hex.
How to convert HEX to RGB (the math)
Converting hex to rgb is simply reading each pair of hex digits as a base-16 number and writing it in base 10. Take #3B82F6 again and work through the three channels:
- Red (3B): the first digit is 3, worth 3 × 16 = 48; the second is B, which equals 11. So 48 + 11 = 59.
- Green (82): 8 × 16 = 128, plus 2, gives 130.
- Blue (F6): F equals 15, so 15 × 16 = 240, plus 6, gives 246.
The result is rgb(59, 130, 246). To go the other way and convert rgb to hex, you reverse the process: divide each 0–255 value by 16 for the first hex digit and take the remainder for the second, then pad to two digits. The picker above does all of this for you the instant you pick a color or type a value — but knowing the arithmetic helps you sanity-check a conversion and understand why a tiny change in one channel barely shifts the color while a big jump transforms it.
HEX vs RGB vs HSL: three ways to say the same thing
HEX, RGB and HSL are three notations for the same underlying colors, and every one of them maps to a single point in the visible range your screen can show. Which one you reach for depends on the task.
- HEX is compact and the default in most design tools and CSS. #3B82F6 is easy to copy and paste, but hard to adjust by eye — you cannot tell at a glance how to make it 10 percent lighter.
- RGB exposes the three channels as plain numbers from 0 to 255, which is useful when you are mixing light or working with code that manipulates channels directly. rgb(59, 130, 246) says exactly how much of each primary is present.
- HSL describes a color by hue, saturation and lightness instead of raw channels, which is the most human-friendly of the three for editing. hsl(217, 91%, 60%) tells you the color sits at 217 degrees on the wheel (a blue), is highly saturated, and is a touch brighter than mid-tone.
All three are valid in modern CSS, and browsers treat them identically once parsed. There is no “best” format — HEX for storing and sharing, RGB for channel math, HSL for adjusting. A good color converter lets you move between them freely, which is exactly what the tool above does: edit the hue in HSL and the HEX and RGB codes follow; nudge the blue channel in RGB and the HSL hue shifts to match.
Understanding HSL in depth
HSL is worth understanding because it maps to how people actually think about color. Hue is an angle from 0 to 360 degrees around a color wheel: 0 and 360 are red, 120 is green, and 240 is blue, with every other color spread between. Saturation is a percentage from 0 (a flat gray) to 100 (the most vivid version of that hue). Lightness runs from 0 percent, which is always black regardless of hue, to 100 percent, which is always white, with the pure color sitting at 50 percent.
This structure makes HSL ideal for generating variations. Keep the hue and saturation fixed and raise the lightness, and you get a lighter version of the same color. Lower the saturation and the color drifts toward gray while keeping its character. Shift the hue by 180 degrees and you land on the complementary color. The tool's HSL sliders let you explore all three dimensions independently, and the rgb to hsl and hsl to hex conversions update live so you never lose track of the code you need.
Tints, shades and building a palette
A single brand color is rarely enough. Interfaces need a range of related colors for backgrounds, borders, hover states and text. The two most useful families are tints and shades:
- Tints are lighter versions of a color, made by moving its lightness toward 100 percent (mixing in white). They work well for subtle backgrounds, disabled states and large fills that should not overpower the content.
- Shades are darker versions, made by moving lightness toward 0 percent (mixing in black). They suit text on light backgrounds, borders and pressed-button states.
The picker generates a strip of tints and shades automatically for whatever color you choose, giving you an instant scale from very light to very dark. Click any swatch in that strip to make it the active color and read its exact code. This is how most design systems build their numbered color scales — a single hue expressed at nine or ten lightness steps — and you can replicate the approach here in seconds without doing the lightness math by hand.
Complementary colors and color harmony
Complementary colors sit directly opposite each other on the color wheel — 180 degrees apart in hue. Blue and orange, red and green, yellow and purple are classic complementary pairs. Placed next to each other they create strong contrast and visual energy, which is why they work for call-to-action buttons against a dominant brand color, or for an accent that needs to stand out.
The tool shows the complementary color for any pick, side by side with your base, so you can judge the pairing immediately. Complementary is only one of several harmony schemes — analogous colors sit close together on the wheel for a calm, cohesive feel; triadic schemes use three evenly spaced hues; and split-complementary softens the clash by using the two colors either side of the true complement. Because HSL exposes hue as a simple angle, you can build any of these by hand: just add or subtract degrees from your base hue and read off the new code.
Alpha, transparency and CSS color formats
So far every color has been fully opaque, but the web also supports alpha — a transparency channel. In CSS you express it with rgba(59, 130, 246, 0.5) for 50 percent opacity, or hsla(217, 91%, 60%, 0.5), or an eight-digit hex such as #3B82F680 where the final pair is the alpha. An alpha of 0 is fully transparent and 1 (or FF) is fully opaque.
Alpha is essential for overlays, drop shadows, hover tints and glass effects, where you want the background to show through. Modern CSS also adds newer color spaces — hwb(), lab(), lch() and oklch() — that can express colors outside the traditional RGB range on capable displays. For everyday web work, though, HEX, RGB and HSL with optional alpha cover almost everything, and they are supported in every browser without a fallback.
Web-safe colors: a bit of history
You may still see references to web-safe colors, a palette of 216 colors that rendered identically across the 256-color monitors common in the late 1990s. Each channel in a web-safe color uses only the hex values 00, 33, 66, 99, CC or FF, giving 6 × 6 × 6 = 216 combinations that every machine of the era could display without dithering.
On modern hardware, which shows millions of colors, the restriction is obsolete — you can use any of the full 16 million hex codes with confidence. The web-safe palette survives mostly as a historical footnote and the occasional constraint in legacy environments. If a brief ever asks for web-safe colors, just round each channel to the nearest value in that set; otherwise, pick freely.
Choosing accessible colors (WCAG contrast)
Picking a pretty color is only half the job; it also has to be readable. The Web Content Accessibility Guidelines (WCAG) measure readability as a contrast ratio between the text color and its background, ranging from 1:1 (identical, invisible) to 21:1 (pure black on pure white). The thresholds worth remembering are:
- 4.5:1 — the minimum for normal body text to pass WCAG AA.
- 3:1 — the minimum for large text (roughly 18pt, or 14pt bold) and for user-interface components and graphics.
- 7:1 — the stricter AAA level for normal text, used where maximum legibility matters.
The picker shows your color's contrast against both white and black, with an AA / AAA badge, so you can tell at a glance whether text will be legible on or against it. Good color contrast is not just an accessibility checkbox — it improves readability for everyone, including people reading on phones in bright sunlight, and it is a signal of overall page quality. If you are tightening up a page's on-page experience, pair this with the rest of your free SEO tools so design and content both pull their weight.
Color in design, development and SEO
For designers, a color picker is where a palette begins: choose a brand hue, generate its tints and shades, find a complementary accent, and export the codes to Figma or a style guide. For developers, the same tool is a quick color converter — a designer hands over a hex code and you need the RGB or HSL equivalent for a CSS variable, a gradient stop, or an alpha overlay. Copying the exact format string from the tool removes the guesswork and the typos.
Color matters for SEO and conversion too, though indirectly. Search engines increasingly reward pages that deliver a good experience, and legible, well-contrasted color is part of that. Clear calls to action in a high-contrast accent color lift click-through; readable body text keeps visitors on the page; and a consistent palette builds the kind of trust that turns a visit into a signup. When you are shipping content that needs to rank and convert, color is one of the small details that compounds — and getting the exact right code takes seconds here.
Privacy: why in-browser conversion matters
This color picker runs entirely in your browser using JavaScript. The hex-to-rgb and rgb-to-hsl math happens on your own device, and nothing you pick or paste is sent to a server, stored or logged. For a color tool that may feel like a minor point, but it means the tool works offline, loads instantly, and never adds a tracking step to your workflow. Pick a color, copy the code, close the tab — nothing is left behind.
Lean on the live conversions as you work and color stops being a lookup you do by hand and becomes part of the design flow. Pick a color above to see the HEX, RGB and HSL codes, the tints and shades, the complementary color and the contrast check all update in real time.