Convert between hex color codes and RGB values instantly, in either direction, with a live color preview.
Google AdSense Banner
This area will contain advertisements after approval.
Google AdSense Banner
This area will contain advertisements after approval.
Hex color codes represent red, green and blue values as two-digit hexadecimal numbers (00 to FF, or 0 to 255 in decimal), combined into a single 6-character code like #2563EB. RGB notation expresses the same three values directly in decimal, like rgb(37, 99, 235).
Hex codes are the most common format in CSS and design tools, while RGB notation is often used when you need to work with individual color channel values directly, such as adjusting brightness or blending colors programmatically.
Converting rgb(37, 99, 235) to hex: each channel is converted to a two-digit hexadecimal number, 37 becomes 25, 99 becomes 63, and 235 becomes EB, joined together as #2563EB. Going the other direction, #2563EB splits into the pairs 25, 63 and EB, each converted back from base-16 to decimal to give rgb(37, 99, 235).
Entering an RGB value above 255 for a channel, each channel is capped at 255 (the maximum a single byte can represent), values above that aren't valid standard RGB.
Forgetting the # prefix when typing a hex code directly into CSS, most tools and browsers require it to recognize the value as a hex color rather than a keyword or invalid value.
Mixing up a 3-digit hex shorthand (like #25E) with a full 6-digit code, shorthand hex duplicates each digit (#25E expands to #2255EE), it isn't simply the first three characters of a longer code.
Hex (hexadecimal) is base-16, using digits 0-9 and letters A-F to represent values from 0 to 15, allowing two hex digits to represent the full 0-255 range in a compact two-character format.
No, this tool converts standard 6-digit hex and RGB values without an alpha channel. 8-digit hex codes with transparency aren't currently supported.
Google AdSense Banner
This area will contain advertisements after approval.