RGB to Hex Converter
Convert RGB color values to hexadecimal format with color preview
How to use this converter:
🎨 Convert RGB to Hex
Use case: Convert RGB values (0-255) to hexadecimal color codes for use in CSS, web design, or graphics applications.
Example: rgb(255, 87, 51) → #FF5733
🔍 Color Preview
Use case: See a visual preview of the color to verify the conversion is correct.
⚡ Quick Colors
Use case: Use preset colors for quick testing or common color conversions.
Input RGB Values
Enter RGB values (0-255)
Hex Result
Converted hexadecimal color code and preview
Enter RGB values to see hex code
hex = "#" + toHex(R) + toHex(G) + toHex(B)
toHex(n) = n.toString(16).padStart(2, "0")
• rgb(255, 0, 0) = #FF0000 (Red)
• rgb(0, 255, 0) = #00FF00 (Green)
• rgb(0, 0, 255) = #0000FF (Blue)