HEX to RGB Converter

Convert any HEX color code to RGB instantly. Enter a HEX value and get exact red, green and blue channels — plus HSL, HSV and CMYK values at the same time.

Enter a 3-digit or 6-digit HEX code. The leading # is optional.

Converted Values

HEX #155EEF
RGB rgb(21, 94, 239)
HSL hsl(215, 84%, 51%)
HSV hsv(215, 84%, 94%)
CMYK cmyk(91%, 61%, 0%, 6%)

What Is HEX to RGB Conversion?

HEX to RGB conversion translates a hexadecimal color code (like #155EEF) into the three red, green and blue channel values (21, 94, 239) that define the same color in the RGB color model. Both formats describe the same visible color — they are simply different notation systems for the sRGB color space used by all modern screens.

HEX is compact and human-friendly in CSS. RGB is what computers and graphics APIs actually use. Converting between them is essential when working in JavaScript, canvas, WebGL, or any tool that expects channel integers rather than hex codes.

How HEX to RGB Works (The Math)

A HEX code is six hexadecimal digits split into three pairs. Each pair represents one channel from 00 to FF:

#155EEF
  15  → Red   = 1×16 + 5 = 21
  5E  → Green = 5×16 + 14 = 94
  EF  → Blue  = 14×16 + 15 = 239

Result: rgb(21, 94, 239)

Each channel ranges from 00 (0) to FF (255), giving 256 values per channel and 16,777,216 possible colors in total.

Example Conversions

  • #FFFFFF → rgb(255, 255, 255) — white
  • #000000 → rgb(0, 0, 0) — black
  • #FF0000 → rgb(255, 0, 0) — pure red
  • #155EEF → rgb(21, 94, 239) — OmniColor blue
  • #87CEEB → rgb(135, 206, 235) — SkyBlue

Uses of HEX to RGB Conversion

  • Canvas drawing: ctx.fillStyle accepts both, but RGB is more common for dynamic colors.
  • WebGL and Three.js: Requires normalized RGB values from 0 to 1.
  • Image processing: Pixel manipulation always works in RGB channels.
  • Color math: Blending, alpha compositing and gradients all use RGB internally.
  • Data visualization: Chart libraries usually expect RGB or arrays of channel values.

Accuracy

OmniColor uses the standard sRGB color space and exact integer conversion. HEX and RGB are mathematically identical — there is no loss of color information when you convert between them. The result you see here matches Chrome DevTools, Figma, Photoshop and any other professional tool.

Frequently Asked Questions