RGB to Hex
Turn red, green and blue values into a hex code.
- 100% Free
- No Sign Up
- Works in Your Browser
RGB to hex
Convert RGB values to a hex color code
More Color Tools
View all tools- Color converterConvert any color between hex, RGB, HSL, CMYK and more
- Hex to RGBConvert hex color codes to RGB values
- Hex to HSLConvert hex color codes to HSL values
- HSL to hexConvert HSL values to a hex color code
- RGB to HSLConvert RGB values to HSL
- Palette generatorGenerate color palettes and lock the ones you like
- Color pickerPick a color and copy it as hex, RGB or HSL
- Contrast checkerCheck text and background contrast against WCAG
- Palette from imageExtract a color palette from any photo
Every everyday color tool, right in your browser.
No software. No uploads. No signup.
Browse all 28 tools- Color tools
- 28
- Named colors
- 139
- Curated palettes
- 216
How to use the rGB to hex
Three steps, all in your browser.
- 1
Enter a color
Type or paste a code in any format, or use the picker.
- 2
See every format
The converted values update as you type, in every format at once.
- 3
Copy the codes
Copy any color code in one click, or share the page link.
RGB to Hex: what to know
RGB to Hex turns red, green and blue values from 0 to 255 into a six-digit hex code. Each value is written as a two-digit base-16 number and the three are joined after a #: rgb(32, 178, 170) becomes 20, B2 and AA, or #20B2AA, the CSS color lightseagreen.
You can type the three numbers or paste a CSS rgb() or rgba() value. Percentages are scaled to 0-255 first, and an alpha value adds a fourth pair to the hex code, from 00 for transparent to FF for opaque.
Hex codes are the most widely accepted color format, in CSS, HTML, design tools and brand guides, which is why they're the usual way to share a color even though RGB holds exactly the same information.
Popular uses
- Copying a color from a tool that shows RGB into CSS
- Writing brand guides with a single shareable code
- Converting colors from code or a screen reading into hex
- Shortening rgb() values in stylesheets
Tips for the best result
- Values above 255 or below 0 aren't valid; they're clipped to the nearest edge.
- When all three pairs repeat a digit (like #FF00CC), the short form #F0C works too.
- Keep alpha separate if your design tool doesn't understand eight-digit hex codes.
Read how JustYourPalette works, browse named colors and curated palettes, and see our privacy details. Colors you enter and images you open are processed in your browser and are never sent to our server.