RGB to HEX Converter
Type or paste a RGB color: With commas or spaces, rgba(), three bare numbers, a HEX code or a CSS color name.
#FF0000RGB:
rgb(255, 0, 0)HEX:
#FF0000CSS Usage:
background-color: #FF0000;color: #FF0000;border: 1px solid #FF0000;Popular Examples:
How to Convert RGB to HEX
RGB to HEX conversion takes three decimal values (0–255 each) and produces a 6-character hexadecimal color code. For example, rgb(255, 0, 0) becomes #FF0000, and rgb(65, 105, 225) becomes #4169E1 (royalblue). HEX is the most common color format for CSS, HTML attributes, and design tools like Figma and Sketch. Use this converter whenever you have RGB values from a color picker and need a HEX code for web.
Step by step for the color above
- Red: 255 ÷ 16 = 15 remainder 15 → FF
- Green: 0 ÷ 16 = 0 remainder 0 → 00
- Blue: 0 ÷ 16 = 0 remainder 0 → 00
- Join the three pairs: #FF0000
Why Use This Converter?
- Instant real-time conversion
- Free online tool - no registration required
- Live color preview
- CSS code examples
- One-click copy to clipboard