Colors•Client-Side Processing

RGB to HEX Converter

Convert red, green, and blue values (0-255) into standard CSS hexadecimal codes.

#RGB, #RRGGBB, #RRGGBBAA
#
Fine Tune:
Channel Sliders (RGB & Alpha)0 - 255
Red (R)
31%79
Green (G)
27%70
Blue (B)
90%229
Alpha Opacity (A)
100%1.00
Popular Web & UI Colors:
Primary Output
Luminance: 12%
rgb(79, 70, 229)
Red (R)
79
31%
Green (G)
70
27%
Blue (B)
229
90%
Alpha (A)
1.00
100%
Developer Formats & Syntax ExportsClick any row to copy
CSS rgb() / rgba()CSS & Web
rgb(79, 70, 229)

Standard CSS syntax supported in all browsers

Modern CSS (Color 4)CSS & Web
rgb(79 70 229)

Modern space-separated CSS Color Module Level 4

CSS Custom PropertyCSS & Web
--color-primary: rgb(79, 70, 229);

Ready-to-use CSS variable

CSS RGB Channels TokenCSS & Web
--color-primary-rgb: 79, 70, 229;

Allows dynamic alpha via rgb(var(--color-primary-rgb) / 0.5)

Tailwind Config TokenCSS & Web
'brand': 'rgb(79 70 229 / <alpha-value>)'

Tailwind v3/v4 theme color with dynamic opacity support

JavaScript ObjectJavaScript & TypeScript
{ r: 79, g: 70, b: 229, a: 1 }

Parsed object with integer channels and alpha

RGB ArrayJavaScript & TypeScript
[79, 70, 229]

Channel numbers array

WebGL / Three.js NormalJavaScript & TypeScript
[0.31, 0.27, 0.90, 1]

Normalized 0.0 to 1.0 floats for shaders & canvas

SwiftUI ColorMobile & Apps
Color(red: 0.31, green: 0.27, blue: 0.90, opacity: 1)

iOS SwiftUI color initializer

Android Kotlin ARGBMobile & Apps
Color.argb(255, 79, 70, 229)

Native Android Kotlin Color instance

Android XML ColorMobile & Apps
<color name="color_brand">#4F46E5FF</color>

Android resources colors.xml entry

Flutter ColorMobile & Apps
Color(0xFF4F46E5)

Flutter 0xAARRGGBB hexadecimal format

HSL / HSLAColor Spaces
hsl(243, 75%, 59%)

Hue, Saturation, Lightness representation

HSV / HSBColor Spaces
hsv(243, 69%, 90%)

Hue, Saturation, Value used in digital design tools

CMYK (Print)Color Spaces
cmyk(66%, 69%, 0%, 10%)

Cyan, Magenta, Yellow, Key for printing reproduction

OKLCH (CSS Color 4)Color Spaces
oklch(0.51 0.23 277)

Perceptually uniform modern color space

Display P3 GamutColor Spaces
color(display-p3 0.31 0.27 0.90)

Wide color gamut for modern Apple and HDR displays

How to Use RGB to HEX Converter

01

Input R, G, and B numbers (0-255).

02

View instant HEX color code.

03

Copy result.

Frequently Asked Questions

What if values exceed 255?

Values are automatically clamped between 0 and 255.

Related Developer Tools

Explore more free client-side developer utilities in this category

View All Tools