RGB / HEX / HSL Color Converter

Convert colors between HEX, RGB, RGBA, HSL, and HSB/HSV. Type in any field or use the color picker โ€” all formats update instantly. Click any value to copy it.

Developer Tools

Color Picker
#29ABE2
e.g. #FF5733 or #F53
e.g. rgb(255, 87, 51)
e.g. rgba(255, 87, 51, 0.5)
e.g. hsl(14, 100%, 60%)
41
171
226
199ยฐ
74%
52%

What This Tool Does

Converts between HEX, RGB, HSL, and HSV color formats instantly in your browser, with a live color preview swatch. Supports copy-to-clipboard for each format.

Who This Is For

  • Frontend developers translating design tokens between CSS color formats
  • UI designers checking color values across different design tools that use different formats
  • Web developers matching brand colors from a style guide to their CSS variables
  • Anyone who knows a color in one format and needs it in another without searching conversion formulas

Example: Input: A HEX color code like #3B82F6 → Output: RGB: rgb(59, 130, 246) ยท HSL: hsl(217, 91%, 60%) ยท HSV: hsv(217ยฐ, 76%, 96%) โ€” all at once with a live preview swatch

How to Convert Colors

  1. Select the input format: HEX, RGB, HSL, or another supported format.
  2. Enter your color value. The live preview updates instantly.
  3. All equivalent values in every supported format appear simultaneously.
  4. Click any value to copy it.

The converter handles shorthand hex and full hex formats. For the decimal equivalent of any hex code, the Number Base Converter shows binary and decimal alongside hex. The converter handles shorthand hex (#FFF), 8-digit hex with alpha (#FF5733FF), and RGB/RGBA/HSL/HSLA values with or without the rgba()/hsla() wrapper.

Color Format Reference

FormatSyntaxExampleNotes
HEX#RRGGBB#FF5733Most common in web/CSS. Shorthand: #F57
HEX+alpha#RRGGBBAA#FF573380Last two digits = opacity
RGBrgb(r, g, b)rgb(255, 87, 51)Each value 0โ€“255
RGBArgba(r, g, b, a)rgba(255, 87, 51, 0.5)Alpha 0=transparent, 1=opaque
HSLhsl(h, s%, l%)hsl(14, 100%, 60%)H: 0โ€“360ยฐ, S/L: 0โ€“100%
HSLAhsla(h, s%, l%, a)hsla(14, 100%, 60%, 0.5)HSL with transparency
oklchoklch(l% c h)oklch(66% 0.22 30)Perceptually uniform (2023+)

When to Use Each Color Format

Using HSL for Design Systems

HSL is uniquely useful for generating color variations programmatically. A brand color at hsl(220, 80%, 55%) can produce a full scale:

:root {
  --brand:       hsl(220, 80%, 55%);
  --brand-light: hsl(220, 80%, 75%);
  --brand-dark:  hsl(220, 80%, 35%);
  --brand-muted: hsl(220, 30%, 55%);
}

Adjusting only the lightness or saturation keeps the hue consistent โ€” critical for a coherent palette. This pattern is far more maintainable than hardcoding separate HEX values for each variant.

Color Design Workflow

Color format conversion connects to the full design toolchain:

Related Tools

Related Guides

Frequently Asked Questions

What is the difference between RGB and HEX?
They represent the same color model (red, green, blue channels, each 0โ€“255). HEX is just a base-16 representation: #FF5733 is the same as rgb(255, 87, 51). FF = 255, 57 = 87, 33 = 51 in decimal.
When should I use HSL instead of HEX?
HSL is easier to read and modify by hand. hsl(120, 100%, 50%) is clearly "pure green at full saturation". The equivalent HEX #00FF00 requires decoding. Use HSL for design systems, CSS custom properties, and any code where you want colors to be self-documenting.
What is oklch and should I use it?
oklch is a perceptually uniform color space โ€” equal numerical steps in lightness look equally different to the human eye, unlike HSL. It is supported in all major browsers as of 2023. For new design systems, oklch is the modern recommendation. Use the color picker to experiment with oklch values.
How do I convert a CSS color to RGB for use in JavaScript?
Use this converter to get the rgb(r, g, b) values. In JavaScript, you can then extract the numbers: const [r,g,b] = "rgb(255,87,51)".match(/\d+/g).map(Number). For dynamic manipulation, consider using the CSS Custom Properties (variables) approach instead.
Why does my color look different on screen vs print?
Screens use RGB (additive color โ€” combining light). Printers use CMYK (subtractive color โ€” combining ink). Colors in RGB cannot all be reproduced in CMYK. For print work, use a design tool that supports CMYK and color profile management.
What is the alpha channel?
Alpha controls transparency: 0 = fully transparent, 1 = fully opaque (in CSS). In HEX, two extra digits are appended: #FF000080 is 50% transparent red. Use rgba() or hsla() in CSS, or 8-digit hex.