RGB to HEX Color Converter Online · HEX Color Code Interconversion
Online RGB and hexadecimal color code interconversion tool, quickly convert RGB to HEX and HEX to RGB, support real-time color preview, with a reference table of 140 common colors.
Conversion Result · Color Preview
Common Color Reference Table
| Color | Name | Description | Hexadecimal | RGB |
|---|---|---|---|---|
| LightPink | Light Pink | #FFB6C1 | 255,182,193 | |
| Pink | Pink | #FFC0CB | 255,192,203 | |
| Crimson | Crimson | #DC143C | 220,20,60 | |
| LavenderBlush | Lavender Blush | #FFF0F5 | 255,240,245 | |
| PaleVioletRed | Pale Violet Red | #DB7093 | 219,112,147 | |
| HotPink | Hot Pink | #FF69B4 | 255,105,180 | |
| DeepPink | Deep Pink | #FF1493 | 255,20,147 | |
| MediumVioletRed | Medium Violet Red | #C71585 | 199,21,133 | |
| Orchid | Orchid | #DA70D6 | 218,112,214 | |
| Thistle | Thistle | #D8BFD8 | 216,191,216 | |
| Plum | Plum | #DDA0DD | 221,160,221 | |
| Violet | Violet | #EE82EE | 238,130,238 | |
| Magenta | Magenta | #FF00FF | 255,0,255 | |
| Fuchsia | Fuchsia | #FF00FF | 255,0,255 | |
| DarkMagenta | Dark Magenta | #8B008B | 139,0,139 | |
| Purple | Purple | #800080 | 128,0,128 | |
| MediumOrchid | Medium Orchid | #BA55D3 | 186,85,211 | |
| DarkViolet | Dark Violet | #9400D3 | 148,0,211 | |
| DarkOrchid | Dark Orchid | #9932CC | 153,50,204 | |
| Indigo | Indigo | #4B0082 | 75,0,130 | |
| BlueViolet | Blue Violet | #8A2BE2 | 138,43,226 | |
| MediumPurple | Medium Purple | #9370DB | 147,112,219 | |
| MediumSlateBlue | Medium Slate Blue | #7B68EE | 123,104,238 | |
| SlateBlue | Slate Blue | #6A5ACD | 106,90,205 | |
| DarkSlateBlue | Dark Slate Blue | #483D8B | 72,61,139 | |
| Lavender | Lavender | #E6E6FA | 230,230,250 | |
| GhostWhite | Ghost White | #F8F8FF | 248,248,255 | |
| Blue | Blue | #0000FF | 0,0,255 | |
| MediumBlue | Medium Blue | #0000CD | 0,0,205 | |
| MidnightBlue | Midnight Blue | #191970 | 25,25,112 | |
| DarkBlue | Dark Blue | #00008B | 0,0,139 | |
| Navy | Navy | #000080 | 0,0,128 | |
| RoyalBlue | Royal Blue | #4169E1 | 65,105,225 | |
| CornflowerBlue | Cornflower Blue | #6495ED | 100,149,237 | |
| LightSteelBlue | Light Steel Blue | #B0C4DE | 176,196,222 | |
| LightSlateGray | Light Slate Gray | #778899 | 119,136,153 | |
| SlateGray | Slate Gray | #708090 | 112,128,144 | |
| DodgerBlue | Dodger Blue | #1E90FF | 30,144,255 | |
| AliceBlue | Alice Blue | #F0F8FF | 240,248,255 | |
| SteelBlue | Steel Blue | #4682B4 | 70,130,180 | |
| LightSkyBlue | Light Sky Blue | #87CEFA | 135,206,250 | |
| SkyBlue | Sky Blue | #87CEEB | 135,206,235 | |
| DeepSkyBlue | Deep Sky Blue | #00BFFF | 0,191,255 | |
| LightBlue | Light Blue | #ADD8E6 | 173,216,230 | |
| PowderBlue | Powder Blue | #B0E0E6 | 176,224,230 | |
| CadetBlue | Cadet Blue | #5F9EA0 | 95,158,160 | |
| Azure | Azure | #F0FFFF | 240,255,255 | |
| LightCyan | Light Cyan | #E1FFFF | 225,255,255 | |
| PaleTurquoise | Pale Turquoise | #AFEEEE | 175,238,238 | |
| Cyan | Cyan | #00FFFF | 0,255,255 | |
| Aqua | Aqua | #D4F2E7 | 212,242,231 | |
| DarkTurquoise | Dark Turquoise | #00CED1 | 0,206,209 | |
| DarkSlateGray | Dark Slate Gray | #2F4F4F | 47,79,79 | |
| DarkCyan | Dark Cyan | #008B8B | 0,139,139 | |
| Teal | Teal | #008080 | 0,128,128 | |
| MediumTurquoise | Medium Turquoise | #48D1CC | 72,209,204 | |
| LightSeaGreen | Light Sea Green | #20B2AA | 32,178,170 | |
| Turquoise | Turquoise | #40E0D0 | 64,224,208 | |
| Aquamarine | Aquamarine | #7FFFAA | 127,255,170 | |
| MediumAquamarine | Medium Aquamarine | #00FA9A | 0,250,154 | |
| MediumSpringGreen | Medium Spring Green | #00FF7F | 0,255,127 | |
| MintCream | Mint Cream | #F5FFFA | 245,255,250 | |
| SpringGreen | Spring Green | #3CB371 | 60,179,113 | |
| SeaGreen | Sea Green | #2E8B57 | 46,139,87 | |
| Honeydew | Honeydew | #F0FFF0 | 240,255,240 | |
| LightGreen | Light Green | #90EE90 | 144,238,144 | |
| PaleGreen | Pale Green | #98FB98 | 152,251,152 | |
| DarkSeaGreen | Dark Sea Green | #8FBC8F | 143,188,143 | |
| LimeGreen | Lime Green | #32CD32 | 50,205,50 | |
| Lime | Lime | #00FF00 | 0,255,0 | |
| ForestGreen | Forest Green | #228B22 | 34,139,34 | |
| Green | Green | #008000 | 0,128,0 | |
| DarkGreen | Dark Green | #006400 | 0,100,0 | |
| Chartreuse | Chartreuse | #7FFF00 | 127,255,0 | |
| LawnGreen | Lawn Green | #7CFC00 | 124,252,0 | |
| GreenYellow | Green Yellow | #ADFF2F | 173,255,47 | |
| OliveDrab | Olive Drab | #556B2F | 85,107,47 | |
| Beige | Beige | #F5F5DC | 245,245,220 | |
| LightGoldenrodYellow | Light Goldenrod Yellow | #FAFAD2 | 250,250,210 | |
| Ivory | Ivory | #FFFFF0 | 255,255,240 | |
| LightYellow | Light Yellow | #FFFFE0 | 255,255,224 | |
| Yellow | Yellow | #FFFF00 | 255,255,0 | |
| Olive | Olive | #808000 | 128,128,0 | |
| DarkKhaki | Dark Khaki | #BDB76B | 189,183,107 | |
| LemonChiffon | Lemon Chiffon | #FFFACD | 255,250,205 | |
| PaleGoldenrod | Pale Goldenrod | #EEE8AA | 238,232,170 | |
| Khaki | Khaki | #F0E68C | 240,230,140 | |
| Gold | Gold | #FFD700 | 255,215,0 | |
| Cornsilk | Cornsilk | #FFF8DC | 255,248,220 | |
| Goldenrod | Goldenrod | #DAA520 | 218,165,32 | |
| FloralWhite | Floral White | #FFFAF0 | 255,250,240 | |
| OldLace | Old Lace | #FDF5E6 | 253,245,230 | |
| Wheat | Wheat | #F5DEB3 | 245,222,179 | |
| Moccasin | Moccasin | #FFE4B5 | 255,228,181 | |
| Orange | Orange | #FFA500 | 255,165,0 | |
| PapayaWhip | Papaya Whip | #FFEFD5 | 255,239,213 | |
| BlanchedAlmond | Blanched Almond | #FFEBCD | 255,235,205 | |
| NavajoWhite | Navajo White | #FFDEAD | 255,222,173 | |
| AntiqueWhite | Antique White | #FAEBD7 | 250,235,215 | |
| Tan | Tan | #D2B48C | 210,180,140 | |
| BurlyWood | Burly Wood | #DEB887 | 222,184,135 | |
| Bisque | Bisque | #FFE4C4 | 255,228,196 | |
| DarkOrange | Dark Orange | #FF8C00 | 255,140,0 | |
| Linen | Linen | #FAF0E6 | 250,240,230 | |
| Peru | Peru | #CD853F | 205,133,63 | |
| PeachPuff | Peach Puff | #FFDAB9 | 255,218,185 | |
| SandyBrown | Sandy Brown | #F4A460 | 244,164,96 | |
| Chocolate | Chocolate | #D2691E | 210,105,30 | |
| SaddleBrown | Saddle Brown | #8B4513 | 139,69,19 | |
| SeaShell | Sea Shell | #FFF5EE | 255,245,238 | |
| Sienna | Sienna | #A0522D | 160,82,45 | |
| LightSalmon | Light Salmon | #FFA07A | 255,160,122 | |
| Coral | Coral | #FF7F50 | 255,127,80 | |
| OrangeRed | Orange Red | #FF4500 | 255,69,0 | |
| DarkSalmon | Dark Salmon | #E9967A | 233,150,122 | |
| Tomato | Tomato | #FF6347 | 255,99,71 | |
| MistyRose | Misty Rose | #FFE4E1 | 255,228,225 | |
| Salmon | Salmon | #FA8072 | 250,128,114 | |
| Snow | Snow | #FFFAFA | 255,250,250 | |
| LightCoral | Light Coral | #F08080 | 240,128,128 | |
| RosyBrown | Rosy Brown | #BC8F8F | 188,143,143 | |
| IndianRed | Indian Red | #CD5C5C | 205,92,92 | |
| Red | Red | #FF0000 | 255,0,0 | |
| Brown | Brown | #A52A2A | 165,42,42 | |
| FireBrick | Fire Brick | #B22222 | 178,34,34 | |
| DarkRed | Dark Red | #8B0000 | 139,0,0 | |
| Maroon | Maroon | #800000 | 128,0,0 | |
| White | White | #FFFFFF | 255,255,255 | |
| WhiteSmoke | White Smoke | #F5F5F5 | 245,245,245 | |
| Gainsboro | Gainsboro | #DCDCDC | 220,220,220 | |
| LightGrey | Light Grey | #D3D3D3 | 211,211,211 | |
| Silver | Silver | #C0C0C0 | 192,192,192 | |
| DarkGray | Dark Gray | #A9A9A9 | 169,169,169 | |
| Gray | Gray | #808080 | 128,128,128 | |
| DimGray | Dim Gray | #696969 | 105,105,105 | |
| Black | Black | #000000 | 0,0,0 |
What is an RGB to HEX Color Converter?
I. The RGB Color Model
RGB is an additive color model that creates a broad spectrum of colors by superimposing red, green, and blue light at varying intensities. Each color channel accepts a value from 0 to 255, providing 256 distinct levels. The combination of these three channels can represent over 16.7 million unique colors. This model is fundamental to digital displays, including computer monitors, televisions, and smartphone screens, making it a cornerstone of digital color theory. For web developers and digital designers, understanding how to manipulate these three channels is essential for creating visually appealing and color-accurate content across different devices.
II. Hexadecimal Color Codes (HEX)
A hexadecimal color code is a compact, human-readable representation of an RGB value. It begins with a hash symbol (#) followed by six hexadecimal digits. These six digits are grouped into three pairs, where each pair corresponds to the red, green, and blue color channels, respectively. Hexadecimal, or base-16, uses the characters 0-9 and A-F to represent values. A two-digit hexadecimal number can perfectly represent the decimal range of 0 to 255, where 00 equals 0 and FF equals 255. This format is the standard for defining colors in HTML, CSS, and SVG, and is widely used by software engineers and UI designers for its precision and brevity.
III. The Mathematical Principle of RGB to HEX Conversion
The conversion from RGB to HEX is a straightforward numerical conversion from decimal (base-10) to hexadecimal (base-16). For each RGB channel value (0-255), you divide the decimal number by 16. The quotient becomes the first hexadecimal digit, and the remainder becomes the second. For instance, if the red value is 255, dividing by 16 gives a quotient of 15 and a remainder of 15. In hexadecimal, 15 is represented by the letter 'F'. Therefore, the red channel converts to 'FF'. This process is repeated for the green and blue channels, and the three resulting pairs are concatenated to form the final 6-digit HEX color code.
IV. The Mathematical Principle of HEX to RGB Conversion
The reverse conversion, from HEX to RGB, involves parsing each pair of hexadecimal digits back into a decimal value. The first digit of a pair is multiplied by 16 and then added to the second digit to get the final decimal value. For example, with the hex code #FFB406, the red component 'FF' is calculated as (15 × 16) + 15 = 255. The green component 'B4' is (11 × 16) + 4 = 180, and the blue component '06' is (0 × 16) + 6 = 6. This method also applies to shorthand 3-digit HEX codes, where each digit is duplicated; for example, #F00 is equivalent to #FF0000, providing a convenient shorthand for colors like pure red.
How to Use This RGB to HEX Converter Tool
This online color converter is designed for efficiency and ease of use. To convert an RGB color to its hexadecimal equivalent, simply enter the decimal values (0-255) for the Red, Green, and Blue channels in the "RGB Input" section. The conversion happens in real time as you type, or you can click the "RGB to HEX" button. The resulting HEX color code and a live preview of the color will be displayed instantly in the result panel. Conversely, to perform a HEX to RGB conversion, type or paste a 6-digit hexadecimal color code (with or without the '#') into the "HEX Input" field. The tool will parse the code and display the corresponding R, G, and B channel values. The visual color preview makes it simple to verify your color selections at a glance, and the comprehensive color reference table below can serve as a quick lookup for standard web colors.
Frequently Asked Questions
What is a hex color code and how is it used in web design?
A hex color code is a 6-digit representation of a color used extensively in HTML, CSS, and graphic design. It's a fundamental tool for defining colors on the web, allowing developers to precisely control the visual appearance of text, backgrounds, borders, and other UI elements. For instance, a CSS rule like `color: #3498db;` sets text to a specific shade of blue.
How do I manually convert an RGB value like 120, 80, 200 to hex?
You convert each number to its two-digit base-16 equivalent. 120 divided by 16 is 7 with a remainder of 8, so the hex pair is 78. 80 divided by 16 is 5 with a remainder of 0, giving 50. 200 divided by 16 is 12 (which is C in hex) with a remainder of 8, giving C8. The full hex code is #7850C8.
Can I use this tool for CSS color conversion?
Absolutely. This tool is perfect for CSS color conversion. Whether you're given a color as RGB values from a design specification or need to convert a hex color to an RGBA format to add opacity, this tool provides a quick and accurate way to bridge the gap between different color representation formats.
What is the valid range for RGB values?
The valid range for each RGB channel (Red, Green, Blue) is from 0 to 255, inclusive. A value of 0 means the channel has no light, while 255 is the maximum intensity. Values outside this range are invalid and will cause a conversion error in any standard color system.
Does the tool support shorthand 3-digit hex codes like #FFF?
Yes, it does. The converter recognizes 3-digit shorthand hex codes. If you input #ABC, the system automatically expands it to the full 6-digit code #AABBCC before performing the RGB conversion. This is a standard practice for handling web-safe colors defined in a compact format.
Why does my hex color sometimes look different on another screen?
A hex code represents a precise color formula, but its appearance can vary across monitors due to differences in screen calibration, color profiles, and panel technology. A professional designer would use a color management system and calibrate their monitor to ensure color accuracy between the digital code and the physical display.
Is there a difference between #000 and #000000?
In web standards, there is no difference in the color they represent. Both are pure black. The #000 format is a convenient shorthand where each character is implicitly duplicated to form a 6-digit code. The full #000000 is the explicit, canonical form. Both are understood by all modern browsers.
Can I use this converter for mobile app development?
Yes, the conversion principles are universal. Mobile platforms like iOS (Swift UI/UIKit) and Android (Jetpack Compose/XML layouts) use color definitions that are often based on RGB or hex models. This tool can help you port a color palette from a web project to a mobile platform by converting between these standard formats.
What is the purpose of the color reference table?
The table provides a quick reference for 140 common named web colors with their corresponding HEX codes, RGB values, and descriptive names. This is a valuable resource for quickly looking up standard colors like "Tomato", "DodgerBlue", or "MediumSpringGreen" without needing to memorize or search for their precise color codes.