RGB to HEX converter

Convert red, green and blue values into a hex color code for CSS and design tools.

Three values 0–255

3, 6 or 8 hex digits, with or without #

#3B82F6RGB 59, 130, 246HEX #3B82F6
Closest match:AzureΔE 2.1

All values for this color

RGB to HEX reference table

Common colors with their Red, Green, Blue and Hexadecimal values. Select a name to open its full color page.

ColorNamergbhex
Black0, 0, 0#000000
White255, 255, 255#FFFFFF
Red255, 0, 0#FF0000
Green0, 128, 0#008000
Blue0, 0, 255#0000FF
Yellow255, 255, 0#FFFF00
Cyan0, 255, 255#00FFFF
Magenta255, 0, 255#FF00FF
Orange255, 165, 0#FFA500
Purple128, 0, 128#800080
Pink255, 192, 203#FFC0CB
Brown165, 42, 42#A52A2A
Gray128, 128, 128#808080
Navy0, 0, 128#000080
Teal0, 128, 128#008080
Maroon128, 0, 0#800000
Olive128, 128, 0#808000
Lime0, 255, 0#00FF00
Silver192, 192, 192#C0C0C0
Gold255, 215, 0#FFD700

Frequently asked questions

How do I convert RGB to hex?

Convert each of the red, green and blue numbers (0–255) to a two-digit base-16 value and concatenate them behind a # sign. For example 59, 130, 246 becomes #3B82F6. This converter does the base-16 math for you.

Why is my hex code uppercase?

Hex color codes are case-insensitive — #3b82f6 and #3B82F6 are identical. We display uppercase for consistency and readability, which matches how most style guides format them.

Can RGB always be written as hex?

Any RGB value with whole channels from 0 to 255 maps exactly to a six-digit hex code. Alpha transparency adds a fourth pair, giving an eight-digit hex.

Browse colors by family

Every tool feeds the reference catalog. Pick a family to explore.