Skip to content

RGB to HEX Converter

Fast, accurate conversion from Red, Green, Blue Color Model (RGB) to Hexadecimal Color Code (HEX) with live interactive preview.

Source Format (From):
Target Output (To):
RGB Input:0 to 255 per channel
R
G
B
Click to Pick Color
TerracottaPantone 7608 C (Terracotta)
#E07A5F
HEX OutputHexadecimal Color Code
INSTANT RESULT
CSS Syntax
#E07A5F

All 7 Color Space Formats for #E07A5F

Click any format card to copy its full CSS value directly to your clipboard.

Instant Values
HEX
Hexadecimal Color CodeTarget
#E07A5F
RGB
Red, Green, Blue Color Model
rgb(224, 122, 95)
CMYK
Cyan, Magenta, Yellow, Key/Black
cmyk(0%, 46%, 58%, 12%)
HSL
Hue, Saturation, Lightness
hsl(13°, 68%, 63%)
HSV / HSB
Hue, Saturation, Value / Brightness
hsv(13°, 58%, 88%)
CIE-LAB
CIE L*a*b* Perceptual Space
lab(62.2 37.1 32.3)
OKLCH
Oklab Cylindrical (CSS Color 4)
oklch(82.9% 0.072 40.0)

Developer Code Snippets

Production-ready snippets formatted for web, mobile, and game engines.

Ready to Paste
CSS VariableWeb
color: #E07A5F;
Copy Snippet
CSS Display P3Wide Gamut
color(display-p3 0.878 0.478 0.373)
Copy Snippet
Tailwind CSSUtility
bg-[#E07A5F]
Copy Snippet
SwiftUIiOS / macOS
Color(hex: "E07A5F")
Copy Snippet
Flutter / DartCross-Platform
Color(0xFFE07A5F)
Copy Snippet
Unity C#Game Engine
new Color(0.878f, 0.478f, 0.373f, 1.0f);
Copy Snippet
Conversion Purpose & Workflow

Why Convert from RGB to HEX?

Developers and designers frequently need to translate RGB values into HEX when moving between design tools (Figma, Photoshop), CSS style sheets, WebGL shaders, and accessibility testing suites. Each format serves a distinct purpose in modern software architecture.

The Mathematical Formula

How to Convert RGB to HEX Step-by-Step

  1. 1 Step 1: Parse and validate the input RGB value (0 to 255 per channel).
  2. 2 Step 2: Normalize the channels into canonical CIE-Lab and sRGB coordinates.
  3. 3 Step 3: Apply the mathematical transform function to translate into target HEX coordinates.
  4. 4 Step 4: Format output according to standard HEX notation: #E07A5F.

RGB to HEX Frequently Asked Questions

How accurate is this RGB to HEX conversion?

Our conversion engine uses double-precision floating-point arithmetic matching the official W3C CSS Color Module 4 specifications, guaranteeing zero loss in color fidelity.

Can I test accessibility contrast after converting?

Yes! Every conversion result includes real-time WCAG 2.1 AA and AAA readability scores against white and black backgrounds.

How do I copy the converted code?

Click the copy button on the result card to copy the code in HEX, CSS, or Tailwind format with a single click.