Home/Design Tools/HEX to RGB Converter
🎨

Enter a HEX value on the left to convert

What Is a HEX to RGB Converter?

A HEX to RGB converter takes a hexadecimal colour code like #28396C and returns the equivalent red, green, and blue channel values used in the RGB colour model — for example rgb(40, 57, 108). Both formats describe the exact same colour; HEX is just a more compact notation. Developers and designers convert HEX to RGB constantly: when CSS needs an opacity value (rgba(...)), when manipulating channels in JavaScript, or when an API or design tool expects integer channels instead of a hex string.

HEX to RGB Converter Online — What This Tool Does

This free HEX to RGB converter takes any 3-digit, 6-digit, or 8-digit HEX colour code and returns the RGB triplet (or RGBA quadruplet) instantly. Paste a HEX value, see a live swatch preview, and copy the RGB string for your stylesheet or JavaScript. Runs entirely in your browser — no account, no upload.

How to Convert HEX to RGB

  • Paste your HEX value into the HEX input — with or without the leading #.
  • The tool accepts 3-digit (#F03), 6-digit (#FF0033), and 8-digit (#FF003380 with alpha) HEX values.
  • See the equivalent RGB triplet (or RGBA with alpha) appear instantly.
  • A live colour swatch shows you exactly what the colour looks like.
  • Click Copy next to the RGB output to copy the CSS-ready string to your clipboard.
  • Need the opposite direction? Click the RGB to HEX tab.

HEX to RGB Conversion Formula

HEX is hexadecimal (base 16); RGB channels are decimal (base 10). To convert by hand, split the 6-digit HEX into three pairs and convert each pair from hex to decimal: #28396C28 = 40, 39 = 57, 6C = 108 → rgb(40, 57, 108). For 3-digit HEX, each digit is doubled: #F03 = #FF0033. For 8-digit HEX, the last pair is the alpha channel — divide by 255 to get the 0–1 alpha value used in rgba().

Common HEX to RGB Conversions

  • #000000rgb(0, 0, 0) — pure black
  • #FFFFFFrgb(255, 255, 255) — pure white
  • #FF0000rgb(255, 0, 0) — pure red
  • #00FF00rgb(0, 255, 0) — pure green
  • #0000FFrgb(0, 0, 255) — pure blue
  • #808080rgb(128, 128, 128) — middle grey

When to Use RGB Instead of HEX

  • Transparency / opacityrgba() takes an alpha channel; HEX has 8-digit support but RGBA is more readable.
  • JavaScript manipulation — easier to read and modify individual channels.
  • CSS animations — RGB interpolates smoothly between two states.
  • API responses — many design APIs return RGB triplets, not HEX.
  • Print-to-screen conversion — RGB maps directly to display sub-pixels.

Tips & Tricks

  • 3-digit shorthand#F03 equals #FF0033. Useful for memorable brand colours.
  • Alpha as 8-digit HEX#FF003380 is red with 50% transparency (80 hex = 128 decimal = ~0.5 alpha).
  • Always lowercase or uppercase consistently#ff0033 and #FF0033 are identical but mixing them in one stylesheet looks sloppy.
  • Check accessibility — copy the RGB into our Contrast Checker to verify WCAG contrast against a background.

Related Tools

Is My Color Sent to a Server?

No. HEX to RGB conversion runs entirely in your browser using small JavaScript arithmetic. There is no upload, no log, no analytics on the colour values you enter. Conversions are instant and local.