Convert RGB to Hex
Convert RGB color values to hexadecimal notation instantly. Use the sliders to adjust red, green, and blue channels (0-255), see a live color preview, and get ready-to-use CSS and HTML code snippets. Perfect for web designers, developers, and anyone working with digital colors.
RGB Values
Color Preview
Common Colors
HEX
Code Snippets
CSS:
color: #ffffff;
HTML:
<div style="color: #ffffff">
RGB:
rgb(255, 255, 255)
HSL:
hsl(0, 0%, 100%)
JavaScript:
const color = '#ffffff';
How to convert RGB to Hexadecimal - a step by step tutorial
Learn how to manually convert values between RGB color and hexadecimal numbering system.
How RGB to Hex Conversion Works
RGB (Red, Green, Blue) colors use decimal values from 0-255 for each channel. Hexadecimal color codes represent these same values in base-16 notation, where each color channel is represented by two hex digits (00-FF).
Conversion Process:
- Take each RGB value (0-255)
- Convert to hexadecimal (00-FF)
- Concatenate in order: RRGGBB
- Add # prefix for CSS/HTML use
Example:
RGB(255, 99, 71) → #FF6347 (Tomato Red)
- Red: 255 → FF (15×16 + 15 = 255)
- Green: 99 → 63 (6×16 + 3 = 99)
- Blue: 71 → 47 (4×16 + 7 = 71)
Common Use Cases
Web Development
Convert design tool colors (Figma, Photoshop) to CSS hex codes for consistent styling.
Accessibility Testing
Check color contrast ratios for WCAG compliance and readability.
Design Systems
Document brand colors in multiple formats for team collaboration.
Color Palettes
Generate harmonious color schemes and variations for projects.
Quick Reference: Common Colors
Color | RGB | Hex | Preview |
---|---|---|---|
Black | 0, 0, 0 | #000000 | |
White | 255, 255, 255 | #FFFFFF | |
Red | 255, 0, 0 | #FF0000 | |
Green | 0, 255, 0 | #00FF00 | |
Blue | 0, 0, 255 | #0000FF | |
Yellow | 255, 255, 0 | #FFFF00 | |
Cyan | 0, 255, 255 | #00FFFF | |
Magenta | 255, 0, 255 | #FF00FF | |
Orange | 255, 165, 0 | #FFA500 |
Convert decimal numbers to hexadecimal numbers.
Convert hexadecimal numbers to decimal numbers.
Convert text characters to hexadecimal numbers.
Convert binary numbers to hexadecimal numbers.