HEX to RGB Converter
Convert HEX color codes to RGB values instantly. Supports 3-digit shorthand, 6-digit standard, and 8-digit with alpha transparency.
How to Convert HEX to RGB
Paste or type any HEX color code into the input field — with or without the leading #. The tool instantly returns the equivalent RGB value, which you can copy with one click. The result is updated in real time as you type, so you can quickly verify many conversions in a row.
HEX vs RGB: When to Use Which
HEX is the most compact and human-readable format, making it the default in CSS, Figma, Sketch, and most design tools. RGB shines when you need programmatic control: animating individual color channels in JavaScript, drawing on HTML5 canvas, working with image-processing libraries, or applying transparency via the rgba() function.
Understanding the Conversion Math
HEX is just RGB in base 16. The first pair of digits encodes red (00–FF, or 0–255), the second pair encodes green, and the third encodes blue. To convert by hand: take each pair, interpret it as hexadecimal, and convert to decimal. For example, #FF5733 becomes FF=255, 57=87, 33=51 → rgb(255, 87, 51).
Working with Transparency
Modern CSS supports 8-digit HEX codes (#RRGGBBAA) for transparency. The last two digits represent the alpha channel from 00 (fully transparent) to FF (fully opaque). When the tool detects an 8-digit code, it outputs the rgba() equivalent automatically — useful for overlays, modal backgrounds, and ghost buttons.