HEX to RGB Converter
Convert HEX color codes to RGB instantly. Free, runs in your browser.
RGB output
rgb(255, 87, 51) 255, 87, 51 hsl(10.6, 100%, 60%) Examples
How to use the HEX to RGB Converter
Four steps to turn any hex code into RGB values.
- 1
Enter a HEX code
Type in the field (with or without #) or pick a color with the swatch. 3-, 6-, and 8-digit codes are supported.
- 2
See the live preview
The large swatch updates instantly so you can confirm you have the right color.
- 3
Copy the RGB value
Click Copy next to the main rgb() output, or grab the raw numbers or HSL bonus value.
- 4
Try an example
Use Load example or the gallery chips (#FF5733, #000000, #FFFFFF) to explore common colors.
What is HEX to RGB conversion?
HEX to RGB conversion is one of the most common tasks in web design and front-end development. HEX (hexadecimal) colors appear everywhere in CSS, Figma exports, brand guidelines, and design-system tokens — but many tools, APIs, and color functions need values expressed as RGB (red, green, blue) integers from 0 to 255. This free converter translates any valid HEX code into its RGB equivalent instantly, with a live preview and one-click copy.
A HEX color code uses base-16 notation. The familiar six-digit format #RRGGBB packs three channels into six characters: the first pair is red, the second green, the third blue. For example, #FF5733 means red=FF (255), green=57 (87), blue=33 (51). CSS also accepts three-digit shorthand (#F53 → #FF5533) and eight-digit codes with an alpha channel (#RRGGBBAA).
RGB describes the same color using decimal numbers. Each channel ranges from 0 (none of that primary) to 255 (full intensity). In CSS you write rgb(255, 87, 51). When you need transparency, RGB becomes RGBA: rgba(255, 87, 51, 0.8) — and building that RGBA string often starts with converting HEX to the three RGB integers first.
The conversion math is straightforward. Split the HEX string into three pairs of characters. Convert each pair from hexadecimal to decimal: FF = 15×16 + 15 = 255, 57 = 5×16 + 7 = 87, 33 = 3×16 + 3 = 51. That is all there is to it — no lookup tables, no approximations. The result is exact.
Why developers convert HEX to RGB: Canvas and WebGL APIs accept RGB arrays. CSS rgba() and color-mix() need numeric channels. Design handoff documents may list HEX while your animation library expects RGB. Accessibility contrast calculations use linear RGB. Sass and Tailwind config files often store colors as RGB tuples. Photoshop and Figma export HEX, but your React inline styles may need rgb() format.
Common use cases include: translating brand HEX colors into rgba() for semi-transparent overlays; feeding RGB values into charting libraries (Chart.js, D3); debugging colors in browser DevTools; preparing colors for Python PIL or ImageMagick scripts; writing unit tests that assert exact channel values; and teaching color theory with concrete numbers students can verify. Search terms like hex to rgb, hex to rgb converter, convert hex to rgb, and hex color to rgb all describe this same practical need.
This tool runs entirely in your browser — no signup, no upload, no delay. Type a HEX code, use the color picker, or try an example. Copy the rgb() string, the raw comma-separated numbers, or the bonus HSL value. For multi-format conversion, see our Color Converter.
Frequently asked questions
What's the difference between HEX and RGB?
#RRGGBB. RGB expresses the same color as three decimal channels from 0 to 255. They describe identical colors — HEX is compact for CSS and design tools; RGB is easier for math, alpha blending, and graphics APIs.How do I convert HEX to RGBA?
#FF5733 becomes rgb(255, 87, 51), and RGBA is rgba(255, 87, 51, 0.5) for 50% opacity. Eight-digit HEX like #FF573380 includes alpha in the last two digits.Why does my 3-digit hex code work?
#F53 expands to #FF5533 — F→FF, 5→55, 3→33. This tool accepts 3-, 6-, and 8-digit HEX automatically.Is my color data private?
Can I convert RGB back to HEX?
Related tools
More free tools — all run in your browser.
RGB to HEX
Convert RGB values to HEX color codes instantly.
HEX to HSL
Convert HEX color codes to HSL values instantly.
Color Converter
Convert between HEX, RGB, HSL, HSV, CMYK, and OKLCH.
Color Name Finder
Find the name of any color. Enter a HEX, RGB, or HSL value and get the closest named color instantly. Free, in your browser.
HSL to HEX
Convert HSL color values to HEX codes instantly.