How to use the Hex to RGB Converter
- Type or paste your hex code into the input field — with or without the # prefix. Both 3-digit (#FFF) and 6-digit (#FFFFFF) formats work.
- The color preview updates instantly as you type. The large swatch shows exactly what the color looks like.
- Copy any value — click the R, G, B chips for individual channel values, or the CSS chips for ready-to-paste expressions like
rgb(37, 99, 235). - Use the color picker if you want to explore colors visually — drag the picker and the hex input updates automatically.
What is the difference between hex and RGB?
Both hex and RGB represent the same colors — they are just different ways to write them. RGB uses three decimal numbers, each between 0 and 255, to specify how much red, green, and blue light makes up a color. Hex uses base-16 (hexadecimal) encoding to express those same three values as a 6-character string.
For example, the color #2563EB in hex is rgb(37, 99, 235) in RGB. The first two hex digits (25) equal 37 in decimal, the next two (63) equal 99, and the last two (EB) equal 235. They are the same color, written in different notation.
Hex is more compact and common in HTML/CSS design systems and design tools like Figma. RGB is preferred when you need to manipulate individual channel values in code or CSS animations.
When to use RGB vs hex in CSS
Use hex for static color values in design tokens, brand colors, and anywhere the color is fixed. It is shorter to write and universally understood.
Use rgb() when you need transparency (via rgba()), or when you are computing color values in JavaScript. The function syntax is more readable when alpha is involved: rgba(37, 99, 235, 0.5) is clearer than #2563EB80.
Use hsl() when you want to programmatically lighten, darken, or shift a color — adjusting the lightness percentage is far more intuitive than calculating new hex values.
Understanding HSL output
This tool also outputs HSL (Hue, Saturation, Lightness) — a color model that maps more closely to how humans perceive color.
- Hue (0–360°) — the position on the color wheel. 0° is red, 120° is green, 240° is blue.
- Saturation (0–100%) — how vivid or muted the color is. 0% is grey, 100% is fully saturated.
- Lightness (0–100%) — how light or dark the color is. 0% is black, 100% is white, 50% is the pure color.