Loading tool…
Convert a HEX color to RGB (and RGB back to HEX), with an alpha/opacity option and copy-ready CSS output.
Loading tool…
Privacy: this tool runs entirely in your browser. Your input is never sent to, received by, or stored on any server — there are no uploads and no tracking of what you enter.
A HEX code like #3b82f6 packs red, green and blue into a six-digit hexadecimal string. RGB writes the same three channels as decimal numbers from 0–255, e.g. rgb(59, 130, 246). They describe identical colors.
Set an alpha value between 0 and 1 to get rgba() output, or an eight-digit HEX (#rrggbbaa). Alpha 1 is fully opaque, 0 is fully transparent.
Each pair of HEX digits is a base-16 number from 00 to ff (0–255). The tool parses those pairs to RGB, and converts decimal RGB back to two-digit HEX for the reverse direction.
This is a focused HEX-to-RGB converter (and the reverse) with an alpha/opacity option and ready-to-paste CSS output. HEX and RGB are the two most common ways to write a screen color, and moving between them is one of the most frequent small tasks in web design - this tool makes it instant and exact.
A six-digit HEX code is simply RGB written in hexadecimal: the first two digits are red, the next two green, the last two blue, each a value from 00 to ff (0 to 255 in decimal). So #3b82f6 is red 59, green 130, blue 246. Because it is just a different notation for the same numbers, the conversion is perfectly exact in both directions.
Modern CSS supports an alpha channel for opacity. You can express it as rgba(59, 130, 246, 0.5) for 50% opacity, or as an eight-digit HEX (#3b82f680) where the final two digits encode alpha from 00 (transparent) to ff (opaque). This tool lets you set an alpha value and outputs both forms, so you can use whichever your codebase prefers.
HEX is compact and ubiquitous in design tools and CSS; RGB and RGBA are more readable and are required when you want to set opacity or manipulate channels in JavaScript. Developers constantly switch between them - copying a HEX from a design file but needing RGBA to add transparency, for instance - which is exactly what this converter streamlines.
Enter a HEX code, type RGB values, or use the color picker; set an alpha between 0 and 1 if you need transparency. The matching format and copy-ready CSS update instantly. Shorthand three-digit HEX (like #39f) is expanded automatically. Everything runs in your browser.