Developer Tools

HEX to RGB

Convert hex color codes to RGB format with instant HSL breakdown.

RGB

rgb(214, 74, 38)

HSL: 12°, 70%, 49%

Red214
Green74
Blue38
Hue12°
Saturation70%
Lightness49%

What is the HEX to RGB?

HEX (hexadecimal) and RGB are two ways to express the same color digitally. HEX uses six characters (0-9, A-F) to represent a single colour (e.g. #FF5733), while RGB breaks that colour into three separate values for red, green, and blue intensity on a scale of 0-255. Converting HEX to RGB lets you use colour codes across different platforms—CSS stylesheets often work with RGB, while design tools like Figma export HEX.

How it works

The converter reads your HEX code and splits it into three pairs of characters. The first pair represents red intensity, the second represents green, and the third represents blue. Each pair is a hexadecimal number (base-16) that translates to a decimal number (base-10) between 0 and 255. For example, FF (the maximum in hex) becomes 255 in decimal, while 00 (zero in hex) becomes 0 in decimal. The result is your RGB triplet (R, G, B).

R = HEX[0:2] to decimal, G = HEX[2:4] to decimal, B = HEX[4:6] to decimal

HEX[0:2] means characters 1–2 of the hex code, converted from base-16 to base-10. The same process repeats for characters 3–4 (green) and 5–6 (blue). For #FF5733: FF (hex) = 255 (dec) for red, 57 (hex) = 87 (dec) for green, 33 (hex) = 51 (dec) for blue.

Examples

InputResultNotes
#FF5733RGB(255, 87, 51)A warm orange. Often used for calls-to-action and alert badges.
#1E90FFRGB(30, 144, 255)A bright dodger blue. Popular for links and interactive elements.
#2ECC71RGB(46, 204, 113)A fresh green. Commonly used for success states and confirmation buttons.

How to use the HEX to RGB

  1. Copy or note your HEX colour code (e.g. #FF5733). Remove the # symbol if prompted.
  2. Paste the HEX code into the input field.
  3. Click Convert or press Enter.
  4. View the RGB values displayed (e.g. RGB(255, 87, 51)).
  5. Copy the RGB result to use in your CSS, HTML, or design tool.
  6. Adjust further if needed using a colour picker or RGB to HEX converter.

Benefits

  • Works across platforms—convert colours from Figma, Photoshop, or Sketch into formats your CSS accepts.
  • Saves time compared to manual hex-to-decimal conversion or looking up colour charts.
  • No installation required; works instantly in your browser on desktop or mobile.
  • Supports standard HEX notation (#RRGGBB) and shorthand (#RGB).
  • Helpful for accessibility work—RGB values let you fine-tune colour contrast ratios.

Tips & common mistakes

Common mistakes

  • Forgetting the # symbol when pasting—most converters strip it automatically, but some require it.
  • Confusing RGB with RGBA (which includes an alpha/opacity channel). RGBA adds a fourth value (0-1 or 0-255).
  • Using lowercase and uppercase hex interchangeably without realising they're identical (A and a both work).
  • Assuming RGB order is BGR or GRB—it's always Red, Green, Blue in that sequence.

Tips

  • Bookmark this tool or use it alongside a colour picker—many workflows bounce between both to fine-tune shades.
  • RGB values are also used in SVG, Canvas, and image editing software, so this conversion is useful beyond CSS.
  • For transparency, pair RGB with the alpha channel: use rgba(255, 87, 51, 0.8) in CSS instead of just rgb(255, 87, 51).
  • Test your colours in multiple browsers and on different screens to ensure they render as intended.

Frequently asked questions

What's the difference between HEX and RGB?

Both represent the same colour. HEX is compact (6 characters plus #), while RGB is explicit (three numbers 0-255). HEX is common in design tools; RGB is native to CSS and web standards.

Can I convert RGB back to HEX?

Yes. Our RGB to HEX converter does the reverse—enter your RGB values and get the HEX code. It's useful when you start with CSS and need to share the colour with a designer.

Does HEX support transparency?

Standard HEX (#RRGGBB) does not. However, 8-digit HEX (#RRGGBBAA) adds an alpha channel. RGB uses rgba() for transparency in CSS.

Why does my colour look different in the browser?

Screen calibration, lighting, and browser rendering differences affect how colours appear. Always test on the device and in the environment where the design will be used.

What's the shorthand HEX format (#RGB)?

Shorthand condenses each pair of characters into one: #F57 is equivalent to #FF5577. Use it only when both digits in each pair are identical (e.g. #FF, #55, #77 become #F, #5, #7).

Is this tool accurate for web safe colours?

Yes. Web safe colours are a historical standard (216 colours). Modern web supports the full 16 million colour spectrum, so this converter works for any valid HEX code.

Related tools

FreeTooz Editorial Team · Last reviewed July 2026

Reviewed for accuracy. Results are estimates for general information and are not professional (medical, financial or legal) advice.