Hex to RGB Converter
A hex color code is three pairs of base-16 digits: red, green and blue. Read each pair as a number from 0 to 255 and you have the RGB value, so #FF5733 is rgb(255, 87, 51). Paste any hex code below to convert it instantly in your browser.
Hex to RGB example
#FF5733 = rgb(255, 87, 51)
Red FF = 255 · Green 57 = 87 · Blue 33 = 51
- #FFFFFF = rgb(255, 255, 255) (white)
- #000000 = rgb(0, 0, 0) (black)
- #FF0000 = rgb(255, 0, 0) (red)
- #00FF00 = rgb(0, 255, 0) (lime)
- #0000FF = rgb(0, 0, 255) (blue)
- #808080 = rgb(128, 128, 128) (gray)
Synchronized color
#FF5733Parsed as RGB; malformed or out-of-range channels are rejected, never silently clamped.
Integer or percentage RGB, modern or legacy CSS, Hex with optional alpha, HSL, HSV, OKLCH, LAB, LCH, CMYK, or a CSS name.
Adjust channels
Share this exact input
?color=FF5733One input, implementation-ready output
Color workspace
Hex
#RRGGBB
#FF5733CSS RGB
Modern space syntax
rgb(255 87 51)Legacy RGB
Comma syntax
rgb(255, 87, 51)RGB %
Percentage channels
rgb(100% 34.1% 20%)HSL
CSS hue, saturation, lightness
hsl(11 100% 60%)HSV / HSB
Design-tool model
hsv(11, 80%, 100%)OKLCH
Perceptual CSS color
oklch(68.04% 0.21 33.69)LAB
CSS Lab, D50
lab(61.03% 63.55 55.96)LCH
CSS LCH, D50
lch(61.03% 84.67 41.37)CMYK
Unprofiled approximation
cmyk(0%, 66%, 80%, 0%)Hex to RGB Chart: 24 Common Colors
Hex codes and their RGB values for the most commonly used colors. Click any hex code to load it into the converter above, or a color name for its full breakdown.
| Color | Name | Hex | RGB |
|---|---|---|---|
| Black | #000000 | rgb(0, 0, 0) | |
| White | #FFFFFF | rgb(255, 255, 255) | |
| Red | #FF0000 | rgb(255, 0, 0) | |
| Lime | #00FF00 | rgb(0, 255, 0) | |
| Blue | #0000FF | rgb(0, 0, 255) | |
| Yellow | #FFFF00 | rgb(255, 255, 0) | |
| Cyan | #00FFFF | rgb(0, 255, 255) | |
| Magenta | #FF00FF | rgb(255, 0, 255) | |
| Silver | #C0C0C0 | rgb(192, 192, 192) | |
| Gray | #808080 | rgb(128, 128, 128) | |
| Maroon | #800000 | rgb(128, 0, 0) | |
| Olive | #808000 | rgb(128, 128, 0) | |
| Green | #008000 | rgb(0, 128, 0) | |
| Purple | #800080 | rgb(128, 0, 128) | |
| Teal | #008080 | rgb(0, 128, 128) | |
| Navy | #000080 | rgb(0, 0, 128) | |
| Orange | #FFA500 | rgb(255, 165, 0) | |
| Pink | #FFC0CB | rgb(255, 192, 203) | |
| Gold | #FFD700 | rgb(255, 215, 0) | |
| Brown | #A52A2A | rgb(165, 42, 42) | |
| Coral | #FF7F50 | rgb(255, 127, 80) | |
| Indigo | #4B0082 | rgb(75, 0, 130) | |
| Violet | #EE82EE | rgb(238, 130, 238) | |
| Salmon | #FA8072 | rgb(250, 128, 114) |
Need a value that is not listed? Browse the full color library — every hex code has a page with its RGB, HSL, CMYK and OKLCH values, contrast ratios, tints, shades and matching palette colors.
How to Convert Hex to RGB
A hex color code is three hexadecimal (base-16) numbers written back to back. Converting to RGB is just reading each pair as a decimal number:
- Split the 6-digit hex code into three pairs: RR (red), GG (green), BB (blue).
- Convert each pair from hexadecimal to decimal: multiply the first digit by 16 and add the second digit (A=10, B=11, C=12, D=13, E=14, F=15).
- Each result is a channel value from 0 to 255.
- Write the result as rgb(R, G, B).
Example: convert #FF5733 to RGB
FF → (15 × 16) + 15 = 255 (red)
57 → (5 × 16) + 7 = 87 (green)
33 → (3 × 16) + 3 = 51 (blue)
Result: rgb(255, 87, 51)
How to Use the Hex to RGB Converter
Enter your hexadecimal color code in the input field with or without the # symbol: #FF5733, FF5733, and the shorthand #F53 all work. The converter instantly displays the RGB equivalent, CSS rgb() output, HSL, OKLCH, and CMYK values. Click any copy button to copy the value to your clipboard. Your recent colors are saved for quick access.
Understanding Hex Color Codes
Hexadecimal color codes are six-digit codes that represent colors using base-16 notation. The first two digits represent red, the middle two represent green, and the last two represent blue. Each pair can range from 00 (0) to FF (255), creating over 16 million possible colors. This format was introduced in HTML 3.2 and remains the most common way to specify colors in web design.
Common Use Cases
Web developers use hex to RGB conversion when working with JavaScript color manipulation, CSS variables, or APIs that require RGB format. Designers often need to convert between formats when moving between different design tools. The RGB format is particularly useful for calculating color blends, adjusting brightness, and working with transparency.
Frequently Asked Questions about Hex to RGB Converter
Hex (hexadecimal) uses a 6-character code starting with # to represent colors (e.g., #FF5733), while RGB uses three decimal numbers from 0-255 for red, green, and blue channels (e.g., rgb(255, 87, 51)). Both represent the same colors, just in different notation systems.
Split the hex code into three pairs (e.g., FF, 57, 33), then convert each pair from hexadecimal to decimal. FF = 255, 57 = 87, 33 = 51, giving you rgb(255, 87, 51).
Yes! Shorthand hex codes like #F53 are expanded by doubling each character, becoming #FF5533. Our converter handles both formats automatically.
Both work in CSS. Hex is more compact and traditional, while RGB is easier to read and modify programmatically. Modern CSS also supports rgb() with alpha transparency.
#FFFFFF is rgb(255, 255, 255), pure white: every pair is FF, the maximum value of 255. #000000 is rgb(0, 0, 0), black. Pure red #FF0000 is rgb(255, 0, 0), pure green #00FF00 is rgb(0, 255, 0), and pure blue #0000FF is rgb(0, 0, 255).
Remove the # and parse the six digits as one base-16 number, then shift out each channel: const n = parseInt('FF5733', 16); const r = (n >> 16) & 255, g = (n >> 8) & 255, b = n & 255; gives 255, 87, 51. Expand a 3-digit shorthand such as F53 to FF5533 first.
The last pair is opacity on a 0-255 scale. #FF573380 is rgba(255, 87, 51, 0.5), because 80 in hex is 128 and 128 / 255 is about 0.5. The converter keeps alpha automatically, and the RGBA to hex page has a full opacity chart from 0% to 100%.
Keep the color moving
Useful next steps
Your latest color stays in the local workspace when the next tool uses it.
Color Converter
Convert one color into implementation-ready screen and print-reference formats
RGB to Hex Converter
Convert RGB and alpha to Hex, CSS formats, color spaces, code, and states
Hex to HSL Converter
Convert hex color codes to HSL values instantly
Hex to CMYK Converter
Convert hex color codes to CMYK values for print