HEX to RGB Color Converter — Free Online Color Tool

Convert HEX color codes to RGB values instantly with our free online converter. Essential for web designers working with CSS, HTML, and design systems.

Formula: R = hex[1..2], G = hex[3..4], B = hex[5..6] (base 16 → base 10)

HEX to RGB Conversion Table

HEXRGB
#ff0000rgb(255, 0, 0)
#00ff00rgb(0, 255, 0)
#1a2b3crgb(26, 43, 60)

Formula

R = hex[1..2], G = hex[3..4], B = hex[5..6] (base 16 → base 10)

Example: #ff0000 = rgb(255, 0, 0)

Frequently Asked Questions

Looking for the reverse? RGB to HEX Converter

About color conversion

Color conversion between HEX, RGB, HSL, and HSV is essential for web development, graphic design, and digital publishing. HEX codes like #FF5733 are shorthand for RGB values — each pair encodes red, green, and blue intensity from 0 to 255. HSL (Hue, Saturation, Lightness) and HSV (Hue, Saturation, Value) are more intuitive for artists because they separate color tone from brightness, making tweaks easier. All four systems describe the same sRGB color space; they're just different ways to coordinate it.

How the math works

HEX to RGB is direct: split the 6-character hex into three 2-character pairs, then convert each from base-16 to base-10. #FF5733 → R=255, G=87, B=51. HSL conversion is trickier because it involves finding the dominant channel and computing relative differences. Our converter handles the math, but the key insight is that all conversions are lossless when performed precisely — any color has one true HEX value and one true RGB triple.

When you'll use this conversion

  • Web design and CSS color definitions
  • Graphic design (Photoshop, Figma, Sketch)
  • Brand color system documentation
  • Data visualization color palettes
  • Accessibility checks (contrast ratios require RGB values)
  • Print-to-digital color matching (though print uses CMYK, not RGB)

A bit of history

RGB as a color model dates to 1861 experiments by James Clerk Maxwell demonstrating that all visible colors could be produced by combining red, green, and blue light. The HEX shorthand for RGB became standard with HTML 3.2 in 1996 because web browsers needed a compact way to specify colors. HSL was formalized in 1978 and became a CSS standard in CSS3 (2011) for more intuitive color manipulation.

Common mistakes

  • Using 3-digit hex (like #F53) when 6-digit is required — #F53 only has 4,096 colors vs 16.7M
  • Assuming HSL hue angles are degrees (0–360) when a tool expects 0–1 normalized values
  • Mixing sRGB and linear-RGB values — most tools use sRGB but some pipelines use linear
  • Forgetting that color perception is non-uniform — equal RGB distances aren't equally visible

Quick tips

  • Quick HEX mental decode: F = 15 × 16 + F = 255; 80 = 128 (half brightness)
  • Pure red = #FF0000 = rgb(255, 0, 0) = hsl(0, 100%, 50%)
  • For accessibility: aim for at least 4.5:1 contrast ratio between text and background