UTILYARD
tools / developer

Color Converter

Convert between HEX, RGB, HSL, and HSV.

contrast on white: 3.68:1 ✗ fails AA
contrast on black: 5.71:1 ✓ AA
HEX#3B82F6
RGBrgb(59, 130, 246)
RGBArgba(59, 130, 246, 1)
HSLhsl(217, 91%, 60%)
HSVhsv(217, 76%, 96%)
CSScolor: #3B82F6;

FAQ

What is the difference between HSL and HSV?
HSL (Hue, Saturation, Lightness) is used in CSS. HSV (Hue, Saturation, Value/Brightness) is used in design tools like Figma and Photoshop. Pure white is HSL(0, 0%, 100%) vs HSV(0, 0%, 100%). Pure red is HSL(0, 100%, 50%) vs HSV(0, 100%, 100%).
What does WCAG contrast mean?
AA compliance requires a contrast ratio of at least 4.5:1 for normal text. Higher contrast means better readability for users with visual impairments.

ABOUT THIS TOOL

Enter a color in HEX, RGB, HSL, or HSV and instantly see the equivalent values in all other formats. HEX and RGB describe a color as red, green, and blue channel intensities, while HSL (hue, saturation, lightness) and HSV (hue, saturation, value) describe the same color more intuitively in terms of the color wheel, how vivid it is, and how light or dark it is — which is why designers often prefer adjusting HSL sliders while developers write HEX or RGB into CSS. Useful when moving colors between design tools and code, or when a CSS property requires a format different from what you have, such as needing an rgba() value with transparency derived from a HEX swatch.

HOW TO USE

  1. Paste or type a color value in any supported format — HEX like #3366ff, RGB like rgb(51,102,255), HSL, or HSV.
  2. The tool auto-detects the format and instantly shows the equivalent values in the others.
  3. Preview the resulting swatch to confirm it's the color you expected.
  4. Adjust sliders (if available) for hue, saturation, or lightness to fine-tune the color visually.
  5. Copy whichever format your CSS, design tool, or code needs.
  6. Add an alpha/opacity value if you need an rgba() or hsla() variant for transparency.

COMMON USE CASES

  • A frontend developer receives a HEX color from a designer's Figma file and needs the RGB values to plug into a canvas drawing API.
  • Someone building a themed UI adjusts a base color's HSL lightness to generate lighter and darker shades for hover states.
  • A designer handing off specs to a developer converts a color picked in HSV (common in design software) into the HEX code developers expect in CSS.
  • A developer debugging inconsistent colors across browsers checks whether an rgba() value and a hex-with-alpha value are actually equivalent.
  • Someone building a data visualization picks colors by adjusting hue systematically across a set of categories and needs HEX codes for each.

TIPS & COMMON MISTAKES

  • HEX shorthand like #fff is equivalent to the full #ffffff — each shorthand digit is just duplicated once.
  • HSL lightness and HSV value are not the same thing despite looking similar — a fully saturated color with 100% HSV value can still look darker in HSL terms, so don't assume the numbers translate directly between them.
  • CSS supports an optional alpha channel in every format (#RRGGBBAA, rgba(), hsla()), so if a color looks right but is fully opaque when you expected transparency, check whether the alpha value was dropped during conversion.
  • When picking accessible color combinations, adjusting HSL lightness while keeping hue and saturation fixed is often the easiest way to create a contrast-compliant text color on a given background.

MORE QUESTIONS

What's the actual difference between HSL and HSV?
Both use hue and saturation, but HSL's third value (lightness) treats pure white and pure black as extremes of the same axis, while HSV's third value (value/brightness) measures distance from black only, with white requiring low saturation as well as high value — so the same hue can look visually different in each model.
Does converting between formats ever lose precision?
Practically no for typical 8-bit-per-channel colors, but converting through HSL/HSV and back to RGB can introduce tiny rounding differences of a unit or two per channel due to floating-point math in the conversion formulas.
Why does my HEX color have 8 characters instead of 6?
An 8-character HEX code includes an alpha channel (#RRGGBBAA) for transparency, supported in modern CSS but not recognized by older tools expecting the standard 6-character format.
Can I convert named CSS colors like "rebeccapurple"?
Many converters support the standard CSS named color keywords by looking up their fixed HEX equivalent, but named colors are a fixed list defined in the CSS Color spec, not a mathematical conversion like the others.

RELATED GUIDES

Color Codes Explained
What HEX, RGB, and HSL color codes mean, how to convert between them, and when to use each format.
Read →
Color Converter — UtilYard