Online Color Converter

Convert between HEX, RGB, HSL and HSV in real time, right in your browser. Pick a color with the color picker or type a value in any format and the others update instantly. A shade ramp plus complementary, analogous, triadic and tetradic palettes are generated from the current color, and clicking any swatch copies its value.

#409EFF
RGB
HSL
HSV
Palette
Light to dark
Complementary
Analogous
Triadic
Tetradic

About this tool

The same color can be described in several ways. HEX writes the red, green and blue channels as #RRGGBB; RGB gives those three channels as 0-255 numbers; HSL describes hue, saturation and lightness, which maps more closely to how people perceive color; and HSV describes hue, saturation and value, the model used by most design-tool color panels.

All four formats are interconvertible. This tool treats the RGB value as the source of truth, so editing any format refreshes the others and the palette, and the numbers never drift out of sync.

Hue, saturation and lightness describe a colour, but they do not describe how two colours mix. Browsers and design tools blend gradients in the encoded sRGB space, where each channel has been raised to roughly the 2.2 power, and averaging those numbers does not match what light does. The visible symptom is the dull grey band in the middle of a blue-to-yellow gradient, or a red-to-green fade that passes through mud; interpolating in linear light or in a perceptual space such as OKLab avoids it, and modern CSS exposes both options. The same effect explains why a 50 percent tint of a saturated red is not the red you would get by turning the lights down, and why anti-aliased text in a light colour looks thinner than its geometry suggests.

Alpha is where notation conventions collide. In CSS an eight-digit hex is #RRGGBBAA, with alpha last, while Android and some design tools write #AARRGGBB, with alpha first, so a value copied between the two turns a solid colour into a nearly transparent one. The four-digit shorthand expands each nibble, so #F008 is #FF000088, not #0F000088. Hex is also limited to sRGB; modern displays and CSS Color 4 support Display P3 and other wider gamuts, where the same visual colour needs different coordinates, and an sRGB hex converted to P3 will look slightly less saturated rather than wrong. For print, RGB is not the target model at all: CMYK inks, spot colours and paper tint change the result, so a hex value is a brief for a designer rather than a production specification.

Accessibility turns colour into a measurement. WCAG asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text and interface components, computed from relative luminance with the sRGB gamma curve, not from the lightness slider. Two colours can look distinct to you and fail for a reader with deuteranopia, which affects a noticeable share of men, so never encode status with colour alone: pair it with an icon, a label or a pattern. Dark mode is not a simple inversion either; flipping lightness keeps the hue but changes perceived saturation and contrast, which is why a palette that passes on white often fails on near-black. Check the actual pair of foreground and background, including hover and disabled states, and test on a real screen at the brightness people use.

How to use

  1. Color picker: click the picker to choose a color from your system palette; every value updates at once.
  2. HEX: type a value such as #409EFF in #RRGGBB or #RGB form. The leading # is optional.
  3. RGB: adjust the red, green and blue channels, each from 0 to 255.
  4. HSL: adjust hue (0-360), saturation and lightness (0-100%).
  5. HSV: adjust hue, saturation and value (0-100%).
  6. Shade ramp: five tints toward white and five shades toward black are generated from the current color, for picking lighter and darker variants.
  7. Color schemes: complementary, analogous, triadic and tetradic harmonies are produced automatically for quick, balanced combinations.
  8. Copy a value: click any swatch to copy its HEX, or use the Copy button beside each format to copy the rgb() or hsl() notation.
  9. Measure contrast on the final pair of colours, not on the brand swatch: place the text colour against the real background, check the ratio for the size and weight you will ship, and repeat for hover, focus and disabled states.
  10. Keep colours as tokens rather than scattered hex values: name the role (surface, text, accent) and derive tints and shades from one base, so a palette change does not require hunting through stylesheets; switch to a design tool when you need OKLCH, P3 or print profiles.

FAQ

What is the difference between HSL and HSV?

Both describe a color by hue and saturation; they differ in the third component. In HSL, L is lightness and a value of 100% is always white. In HSV, V is value and 100% is the most vivid form of that hue. Design-tool color panels usually use HSV.

Why does the color shift slightly after I edit HSL?

Internally the tool is driven by the RGB channels. Converting HSL to RGB involves rounding, and reading the values back rounds again, so a channel can be off by one or two units. This matches the behavior of most graphics software and does not affect how the color displays.

Is the value I type validated?

Yes. The HEX field accepts both #RRGGBB and #RGB. An invalid value shows a message and keeps the previous color; when the field loses focus it is restored to a valid value.

How are the palette colors calculated?

The shade ramp mixes the current color with white and with black at several ratios. The schemes keep the current saturation and lightness and simply rotate the hue by a fixed angle, for example adding 180 degrees for the complementary color.

Is my color uploaded anywhere?

No. Every conversion runs locally in your browser with JavaScript and makes no network requests. Closing or reloading the page clears the content immediately.

Why does my eight-digit hex colour look transparent?

Because the channel order depends on the platform. CSS reads #RRGGBBAA with alpha last, while Android and several design tools use #AARRGGBB with alpha first. A value written for Android and pasted into CSS therefore takes its red channel as opacity, which can make an opaque colour almost invisible. Convert the order or use rgb() with an explicit alpha.

Why is the middle of my gradient grey or muddy?

Because the browser interpolates in gamma-encoded sRGB, where the midpoint of two saturated colours is a darker, less saturated average. Interpolating in linear light, OKLab or another perceptual space keeps saturation and produces the expected transition. CSS supports this through colour interpolation hints in newer syntax, while older browsers and canvas still blend in sRGB.

What contrast ratio should I aim for?

At least 4.5:1 for body text and 3:1 for text at 24 px or 19 px bold, and for icons and input borders. Aim higher, around 7:1, for text that will be read in bright light or by older users. The ratio is calculated from relative luminance, so a colour that looks light to you may not measure as light.