Color Picker and Converter
Pick a color or type any value and get HEX, RGB, HSL and HSV kept in sync, each with a copy button, plus a row of darker shades and a CSS gradient.
The interactive tool loads here when JavaScript runs.
About this toolWhat is the Color Picker and Converter?
The Color Picker and Converter lets you choose a color visually or type it as HEX, RGB, HSL or HSV, and keeps all four formats in sync. Each format has its own copy button that copies a ready-to-paste value such as rgb(51, 102, 255) or hsl(225, 100%, 60%).
Below the converter, a palette shows five shades of the current color, from 20% to 100% of its brightness, and a CSS linear-gradient line built from the darkest and the original shade. Conversions are calculated in the page, so you can move between a designer's HEX value and the HSL you want for CSS without opening a design tool.
It works with opaque sRGB colors. The HEX field takes six digits, there is no alpha channel, and HSL and HSV values are whole numbers, so converting back and forth can shift a channel by one step.
- HEX, RGB, HSL and HSV kept in sync
- Native color picker plus numeric inputs with range checks
- Copy button for each format, ready to paste into CSS
- Five-step shade palette and CSS gradient line
- Runs in your browser
Updated
How to use the Color Picker and Converter
- Click the color swatch to pick a color, or type a six-digit HEX value such as #3366FF.
- Or adjust the R, G, B, H, S, L or H, S, V number fields directly. Hue runs from 0 to 360; the other HSL and HSV fields are percentages.
- Copy whichever format you need with its copy button.
- Click a swatch in Color Palette to copy that shade, or copy the CSS Gradient line.
Worked examples
One color in four notations
Input
#3366FF
Output
rgb(51, 102, 255), hsl(225, 100%, 60%), hsv(225, 80%, 100%)
33, 66 and FF are 51, 102 and 255 in decimal. Blue is the largest channel and at full strength, so HSV value is 100%, while HSL puts the same color at 60% lightness.
The shade palette
Input
#FF8800
Output
#331b00, #663600, #995200, #cc6d00, #ff8800
Each swatch multiplies all three channels by 0.2, 0.4, 0.6, 0.8 and 1. The shades only get darker; for lighter tints raise L in the HSL fields instead.
Background and insight
RGB describes color the way screens produce it: red, green and blue light, each from 0 to 255 in 8-bit color. HEX is the same three numbers written in base 16, so #FF8800 is RGB(255, 136, 0). Neither format is intuitive for people. Making a color "a bit lighter" in RGB means changing all three numbers.
HSL and HSV were introduced in the 1970s, notably by Alvy Ray Smith in a 1978 SIGGRAPH paper, to give color pickers a more human set of controls: hue as an angle around a color wheel, saturation as intensity, and lightness or value as brightness. CSS has supported hsl() since CSS3, which is why many design systems define their palettes in HSL. Adjusting lightness alone gives a consistent set of tints and shades.
One caution: HSL lightness is not perceived lightness. A yellow and a blue with the same L value look very different in brightness. Newer CSS color spaces such as OKLCH, supported in modern browsers, were designed to fix that, and accessibility contrast checks still use their own relative luminance formula from WCAG.
Common use cases
Converting design tokens
Turn HEX values from a design file into rgb() or hsl() for CSS variables.
Building hover and pressed states
Lower HSL lightness by 8 to 10 points to get a darker hover color from a brand color.
Matching colors across tools
Translate between the HSV used by many image editors and the HEX used on the web.
Quick gradients
Copy the generated linear-gradient line as a starting point for a button or header background.
Tips and limitations
- Hue 0 and hue 360 are the same red. Both are accepted.
- Expand shorthand HEX before typing it: #F80 is #FF8800.
- A color that passes a contrast check in HSL terms can still fail WCAG. Check text and background pairs with the Contrast Checker.
- HSV and HSL share hue but not the other two numbers. Do not paste HSV saturation into an hsl() function.
- Use the Color Picker from Image tool when you need to sample a color from a screenshot or logo.
Sources and further reading
- CSS Color Module Level 4, W3C. Defines hex, rgb(), hsl() and OKLCH colors in CSS
- Color gamut transform pairs, ACM SIGGRAPH Computer Graphics. Alvy Ray Smith's 1978 paper introducing HSV
- Web Content Accessibility Guidelines (WCAG) 2.2, W3C. Defines relative luminance and contrast ratio
- hsl() CSS function, MDN Web Docs
Frequently asked questions
What is the difference between HSL and HSV?
Both use the same hue angle. HSL lightness puts a fully saturated color at 50% and white at 100%, while HSV value puts the pure color at 100% and reaches white only when saturation drops to 0. CSS uses HSL; many image editors' pickers use HSV.
Which color format should I use in CSS?
Any of them works in every modern browser. HEX is compact and common in design handoff, rgb() accepts an alpha value for transparency, and hsl() is the easiest to adjust by hand because lightness and saturation are separate numbers. Pick one per codebase and stay consistent.
Does the color converter accept 3-digit or 8-digit HEX?
No. The HEX field expects six digits with a leading #, such as #FF8800. Expand shorthand like #F80 by doubling each digit. Eight-digit HEX with alpha is not supported, because the converter works with opaque colors only.
Can this color picker check contrast for accessibility?
No. It converts between formats but does not calculate contrast ratios. Use a contrast checker to test text and background pairs against WCAG 2 thresholds: 4.5:1 for normal text and 3:1 for large text at level AA.
Why does converting HSL back to HEX change a value slightly?
HSL and HSV values are shown as whole numbers, so a little precision is lost when a HEX color is converted to them. Typing those rounded numbers back can land one step away in a channel, for example 102 instead of 101. Keep HEX or RGB as the source of truth.
Is there an in-depth guide to the Color Picker and Converter?
Yes. “HEX, RGB, HSL and HSV: A Developer's Guide to Color Formats” covers the background, how it works, common pitfalls and worked examples. Read the full guide.
Related Tools You May Like
Free, in-browser tools that pair well with this one.