We use cookies

We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.

🎨

Color Picker

by Cosmovex

Color Formats
HEX
RGB
HSL
HSV
CMYK
CSS Variables
--color-primary: #4588f5;
--color-primary-rgb: 69, 136, 245;
--color-primary-hsl: hsl(217, 90%, 62%);

Free Color Picker & Converter Tool

Convert colors between HEX, RGB, HSL, HSV, and CMYK. Canvas-based interactive color picker with hue slider. Generate complementary, analogous, triadic, and tetradic color palettes. Check WCAG AA and AAA contrast ratios. No signup required — works entirely in your browser.

More Developer Tools

View all tools →
.*
Regex Tester
Test & debug regular expressions
±
Diff Checker
Compare two blocks of text
Cron Builder
Build & explain cron expressions
Unix Timestamp
Convert Unix timestamps
{ }
JSON Formatter
Format, validate & explore JSON
YAML Formatter
Lint, format & convert YAML
</>
XML Formatter
Beautify & validate XML
CSV Formatter
View & format CSV tables

Color Picker & Converter is a free in-browser tool for picking a color and reading it back in every format you actually use in code: HEX, RGB, HSL, and HSV. Drag the picker, type a value in any field, and the others update instantly so you never have to convert by hand or trust a half-remembered formula. From any base color you can also generate tints, shades, and a small palette of related colors to drop straight into a stylesheet or design token file.

Everything runs locally in your browser. The color you pick, the values you paste, and the palettes you build never leave your machine, so it works offline and there's no account, upload, or tracking involved. It's meant for the quick, repeatable jobs that come up constantly while building UIs: matching a brand color, sanity-checking contrast, turning a designer's HEX into the RGB/HSL your code expects, or sketching a quick scale around one hue.

How it works and what you get

Pick a color three ways: drag the visual picker, click the native swatch, or type a value into any format field. All fields stay in sync, so editing the HEX updates RGB, HSL, and HSV at the same time, and vice versa.

The formats it shows:

  • HEX #1e90ff for CSS, HTML, and design files. Also accepts the 8-digit #1e90ffcc form when you need alpha.
  • RGB rgb(30, 144, 255) for canvas, image pipelines, and any API that wants 0-255 channels.
  • HSL hsl(210, 100%, 56%) when you want to adjust lightness or saturation without touching hue.
  • HSV/HSB hsv(210, 88%, 100%), the model most design apps use under the hood.

From the active color you can generate tints (mixing toward white), shades (mixing toward black), and a small palette of related hues. Click any swatch to copy its value to the clipboard.

A worked example: one color, four formats

Say a designer hands you #1E90FF ("dodger blue"). Paste it into the HEX field and the tool fills in the rest:

HEX  #1e90ff
RGB  rgb(30, 144, 255)
HSL  hsl(210, 100%, 56%)
HSV  hsv(210, 88%, 100%)

Why these numbers line up:

  • The largest RGB channel is blue (255), the smallest is red (30). HSV value is the max channel as a percentage: 255/255 = 100%.
  • HSV saturation is (max - min) / max = (255 - 30) / 255 ≈ 0.88, i.e. 88%.
  • Hue is the same 210° in both HSL and HSV because hue doesn't depend on the lightness model.

Now drag the lightness slider down to get hsl(210, 100%, 40%), copy it, and you have a darker variant for a hover state without re-picking the color or guessing a new HEX.

Common use cases

  • Translating between teams and tools. Design files speak HEX and HSV; CSS variables and canvas code often want RGB or HSL. This is the fastest way to move a value across that boundary correctly.
  • Building hover/active/disabled states. Take your base color, nudge HSL lightness up or down, and copy the result. Working in HSL keeps the hue stable so variants stay on-brand.
  • Generating a quick scale. Use the tints and shades output to seed a --color-100 through --color-900 ramp for a design-token file.
  • Matching a color you already have. Paste a HEX from a screenshot tool or brand guide and read its exact RGB/HSL.
  • Debugging "why is this the wrong color?" Drop a suspicious value in and confirm whether the issue is the color itself or how your CSS is applying it.

Tips and gotchas

  • Hue is undefined for grays. Pure black, white, and middle gray have zero saturation, so their hue value is arbitrary (often shown as 0°). Don't read meaning into it.
  • HSL and HSV are not interchangeable. Both share the hue, but 50% in HSL lightness is not the same as 50% in HSV value. Copy the whole string for the model you're actually using; don't swap one number between them.
  • Rounding is normal. Converting HEX to HSL and back can shift a value by one unit because HSL percentages are rounded for readability. For exact round-trips, keep HEX or RGB as your source of truth.
  • Mind alpha. A 6-digit HEX has no transparency. If you need it, use the 8-digit form or rgba()/hsla() rather than assuming the short HEX carries opacity.
  • Lowercase HEX is conventional in CSS but #1E90FF and #1e90ff are identical to the browser.

HSL vs HSV: which one and when

Both rebuild RGB from a hue angle (0-360°) plus two other axes, but they slice the color space differently.

HSL uses saturation and lightness. Lightness runs from 0% (black) through 50% (the most vivid version of the hue) to 100% (white). This is the friendlier model for UI work: to make a darker button you lower lightness, to make a tint you raise it, and the hue stays put.

HSV (also called HSB) uses saturation and value/brightness. Value runs from 0% (black) to 100% (full brightness), and at 100% value, lowering saturation moves you toward white. Most color pickers in design software are built on HSV because the classic square-plus-hue-strip UI maps directly onto value and saturation.

Practical rule: reach for HSL when generating CSS variants and ramps, and recognise HSV when you're reconciling values with a design app. The hue is the same in both; only the second and third numbers change meaning.

Tips

  • Type a value into any field, not just HEX. Editing RGB or HSL re-syncs the others, so use whichever you already have on hand.
  • Adjust HSL lightness (not HEX digits) to build consistent hover and disabled states from one base color.
  • Keep HEX or RGB as the source of truth in your codebase; HSL/HSV are great for editing but round on conversion.
  • Click any generated tint or shade swatch to copy it straight to the clipboard for pasting into your stylesheet.
  • For transparency, use 8-digit HEX (#rrggbbaa) or rgba()/hsla() rather than a 6-digit HEX, which has no alpha.
  • Ignore the hue value on grays and near-grays; with zero saturation it's not meaningful.

How to use Color Picker & Converter

  1. 1Pick a color from the wheel or enter a value.
  2. 2See it converted to HEX, RGB, HSL, and HSV.
  3. 3Copy the code in the format you need.
  4. 4Build shades and palettes — all in your browser.

Frequently asked questions

How do I convert HEX to RGB?

Paste the HEX into the HEX field and read the RGB output. Under the hood each pair of hex digits is one channel: #1e90ff is 0x1e=30 red, 0x90=144 green, 0xff=255 blue, giving rgb(30, 144, 255).

What's the difference between HSL and HSV?

Both share the same hue angle, but HSL's third axis is lightness (0% black, 50% vivid, 100% white) while HSV's is value/brightness (0% black, 100% full). HSL is easier for making lighter and darker UI variants; HSV matches most design-app pickers.

Does a HEX color include transparency?

A standard 6-digit HEX like #1e90ff is fully opaque. To include an alpha channel use the 8-digit form #1e90ffcc, or use rgba()/hsla() in CSS.

Why does my HSL value change slightly when I convert it back to HEX?

HSL percentages are rounded to whole numbers for readability, so a HEX to HSL to HEX round-trip can drift by one unit. Keep HEX or RGB as your canonical value if you need exact round-trips.

Can I generate shades and tints from one color?

Yes. Pick a base color and the tool produces tints (mixed toward white) and shades (mixed toward black), plus a small palette of related hues. Click any swatch to copy its value.

Does this work offline and is anything uploaded?

It runs entirely in your browser, so it works offline once loaded and the colors you pick or paste are never sent anywhere. There's no account or upload.

What does HSB mean, and is it the same as HSV?

HSB (hue, saturation, brightness) and HSV (hue, saturation, value) are the same model with different names. Many design apps label it HSB; the numbers are identical.

How do I get a darker or lighter version of a color?

Switch to the color's HSL value and lower the lightness for a darker shade or raise it for a lighter tint, keeping hue and saturation fixed. Then copy the resulting HSL or its HEX equivalent.

← All toolsRead our guides →