Developer Tools
RGB to HEX
Convert RGB color values to hexadecimal format instantly.
Hexadecimal
#D64A26
Enter red, green, and blue values (0–255). The hex code updates in real time.
Developer Tools
Convert RGB color values to hexadecimal format instantly.
Hexadecimal
#D64A26
Enter red, green, and blue values (0–255). The hex code updates in real time.
RGB (Red, Green, Blue) uses decimal values from 0–255 to describe each color channel's intensity. HEX (hexadecimal) represents the same colors as a six-character code (e.g., #FF5733), where each pair of characters encodes one channel in base-16. Both formats describe identical colors; HEX is simply how browsers and CSS natively consume color values.
Each RGB channel (0–255) is converted to a two-digit hexadecimal number. Red, green, and blue conversions are concatenated with a # prefix to form the HEX code. For example, RGB(255, 87, 51) divides each decimal by 16 to find the two hex digits: 255 becomes FF, 87 becomes 57, and 51 becomes 33, yielding #FF5733.
HEX = #[Red in base-16][Green in base-16][Blue in base-16]Each RGB value (0–255) is converted to hexadecimal (00–FF). The three pairs are prefixed with # to create the HEX code that CSS and HTML recognize.
| Input | Result | Notes |
|---|---|---|
| RGB(255, 0, 0) | #FF0000 | Pure red: all red intensity, no green or blue |
| RGB(0, 128, 255) | #0080FF | Sky blue: moderate green channel, high blue |
| RGB(100, 100, 100) | #646464 | Neutral gray: equal values across all channels |
Yes—our HEX to RGB converter reverses the process. Pair it with this tool for bidirectional color format switching.
No. RGB and HEX are two notations for the same 16.7 million color space. HEX is simply how web browsers read color values.
Both work in modern CSS (RGB and rgb() are valid), but HEX is shorter, faster to type, and universally supported across older browsers and tools.
200 in decimal = C8 in hexadecimal. The converter handles this automatically.
Yes. If each HEX pair is identical (#FF00FF), you can abbreviate to #F0F. But full HEX is recommended for precision.
No. The # is required in CSS and HTML color attributes. Some older systems may accept three-digit hex (e.g., #FFF), but six digits is the standard.