Skip to content
ColorsGuide

HEX to RGB converter

Enter a HEX value such as #2A9D8F to convert it to RGB. Every other format is shown too, and the result updates as you type.

Example paletteUsed until you create or choose your own

Detected HEX.

Examples: #1e90ff, rgb(30 144 255 / 50%), hsl(210 100% 56%), oklch(0.65 0.18 255), cmyk(88% 44% 0% 0%), tomato

Name
Soft sea green(descriptive)
Alpha
100%
Relative luminance
0.2659
Perceived lightness (OKLCH L)
63%
Contrast on white
3.32:1
Contrast on black
6.32:1

See shades, harmonies and palettes for #2A9D8F

Converted values

  • HEX#2a9d8f
  • RGBrgb(42 157 143)
  • HSLhsl(172.7 57.8% 39%)
  • HSV / HSBhsv(172.7 73.2% 61.6%)
  • HWBhwb(172.7 16.5% 38.4%)
  • OKLCHoklch(63.04% 0.1013 183.03)
  • OKLABoklab(63.04% -0.1012 -0.0054)
  • CIELABlab(58.37% -35.2 -2.27)
  • CMYKcmyk(73% 0% 9% 38%)

CMYK is a naive, device-independent approximation. Real print colours depend on the ink, paper and ICC profile your printer uses, so ask your printer for a proofed conversion. HSV/HSB is not a CSS format and is shown for design apps. CIELAB uses the D50 white point, as in CSS lab().

How to convert HEX to RGB

  1. Remove the # and, for three-digit codes, double each digit (#F53 becomes FF5533).
  2. Split the six digits into three pairs: red, green and blue.
  3. Convert each pair from base 16 to base 10: 2A = 2×16 + 10 = 42, 9D = 157, 8F = 143.
  4. Write the result as rgb(42 157 143). An eight-digit code's last pair is alpha: divide it by 255.

About HEX

A HEX code writes the red, green and blue channels of an sRGB colour as two hexadecimal digits each (00–FF), so #FF5733 means red 255, green 87, blue 51. An optional fourth pair adds transparency, and three-digit shorthand such as #F53 doubles each digit.

About RGB

RGB gives the same three sRGB channels as decimal numbers from 0 to 255 (or 0–100%). Modern CSS writes rgb(255 87 51 / 50%) with spaces and a slash before the alpha; the older comma form rgba(255, 87, 51, 0.5) still works everywhere.

Examples

SwatchHEXRGB
#ffffffrgb(255 255 255)
#000000rgb(0 0 0)
#ff0000rgb(255 0 0)
#00a86brgb(0 168 107)
#1e90ffrgb(30 144 255)
#ffd700rgb(255 215 0)
#800080rgb(128 0 128)
#ff7f50rgb(255 127 80)
#708090rgb(112 128 144)
#f5f5dcrgb(245 245 220)
#264653rgb(38 70 83)
#e76f51rgb(231 111 81)

Other conversions

Was this page useful?