Hex Codes for Colors
Find the perfect hex codes for colors with our comprehensive guide. Browse popular hex color values, use our interactive color picker, and learn how to implement hex codes in your web design projects.
Interactive Color Hex Code Picker
Use our interactive color picker to find the perfect hex codes for colors in your projects. Simply select a color to get its hex code along with RGB and HSL values.
Understanding Hex Codes for Colors
Hex codes for colors are six-digit hexadecimal values that precisely define colors for web design and digital applications. They provide an exact way to specify colors in HTML, CSS, and other programming languages.
Each hex color code begins with a hash symbol (#) followed by six characters (0-9, A-F). These six digits represent the intensity of red, green, and blue components that make up a specific color:
- First two digits: Red component (00-FF)
- Middle two digits: Green component (00-FF)
- Last two digits: Blue component (00-FF)
For example, #FF0000
represents pure red because the red component is at its maximum value (FF), while the green and blue components are at their minimum values (00).
How Hex Codes Work
#FFA52C
The hexadecimal number system uses 16 digits (0-9 and A-F):
- 00 = No intensity (0 in decimal)
- 80 = Medium intensity (128 in decimal)
- FF = Maximum intensity (255 in decimal)
With this system, hex codes can represent over 16 million unique colors (256 shades each of red, green, and blue).
Hex Codes for Common Colors
Below is a comprehensive list of hex codes for colors commonly used in web design. Click on any color to copy its hex code to your clipboard.
Basic Colors
Red
#FF0000
Green
#00FF00
Blue
#0000FF
Yellow
#FFFF00
Cyan
#00FFFF
Magenta
#FF00FF
Black
#000000
White
#FFFFFF
Red Shades
Light Red
#FF4D4D
Dark Red
#8B0000
Crimson
#DC143C
Indian Red
#CD5C5C
Firebrick
#B22222
Maroon
#800000
Blue Shades
Light Blue
#ADD8E6
Sky Blue
#87CEEB
Dodger Blue
#1E90FF
Royal Blue
#4169E1
Navy Blue
#000080
Midnight Blue
#191970
Green Shades
Light Green
#90EE90
Lime Green
#32CD32
Forest Green
#228B22
Sea Green
#2E8B57
Olive
#808000
Dark Green
#006400
Popular Web Color Hex Codes
These versatile colors are widely used in web design. They work well for various interface elements including buttons, backgrounds, and text colors.
Turquoise
#40E0D0
Hot Pink
#FF69B4
Coral
#FF7F50
Tomato
#FF6347
Orange Red
#FF4500
Gold
#FFD700
Khaki
#F0E68C
Lawn Green
#7CFC00
Medium Aquamarine
#66CDAA
Steel Blue
#4682B4
Slate Blue
#6A5ACD
Purple
#800080
How to Use Hex Codes for Colors in Web Design
HTML Example
<!-- Inline HTML styles --> <div style="color: #FF5733;"> This text uses a coral color </div> <div style="background-color: #3498DB; color: #FFFFFF;"> White text on blue background </div> <div style="border: 2px solid #2ECC71;"> Element with a green border </div>
CSS Example
/* CSS styles using hex codes */ .header { background-color: #34495E; color: #ECF0F1; } .button { background-color: #3498DB; border: 2px solid #2980B9; color: #FFFFFF; } /* Using variables for consistency */ :root { --primary-color: #2ECC71; --secondary-color: #E74C3C; --text-color: #333333; }
Pro Tips for Working with Hex Codes
- •
Use CSS variables: Store your hex codes as CSS variables for easy maintenance and consistency across your website.
- •
Shorthand notation: If all three color pairs have repeating digits (like #FFAA33), you can use the shorthand form (#FA3).
- •
Consider accessibility: Ensure sufficient contrast between text and background colors (4.5:1 ratio recommended by WCAG).
- •
Create color schemes: Use complementary, analogous, or triadic colors to create visually appealing color combinations.
Color Scheme Examples with Hex Codes
Here are some example color schemes with their corresponding hex codes for use in your web design projects:
Related Color Tools
Advanced Color Picker
Use our comprehensive color picker with additional features like HSL adjustment and color harmonies.
Pick Colors →Color Chart
Browse our color chart featuring flat design colors, material design, and web safe colors with their hex codes.
View Chart →HTML Color Names
View all 140 standard HTML color names with their corresponding hex codes for easy reference.
View Names →Frequently Asked Questions
What are hex codes for colors?
Hex codes for colors are six-digit hexadecimal values that specify colors in web design and digital applications. They start with a hash symbol (#) followed by six characters representing red, green, and blue color components. For example, #FF0000 represents pure red. Hex codes provide a precise and consistent way to define colors in HTML, CSS, and other programming languages.
How do I find the hex code for a specific color?
You can find the hex code for a specific color using our interactive color picker tool at the top of this page. Simply adjust the color picker until you find your desired color, and the corresponding hex code will be displayed. Alternatively, you can browse our color chart or use tools like eyedroppers in design software to pick colors from images or websites.
How many colors can hex codes represent?
Hex codes can represent over 16.7 million different colors (specifically 16,777,216 colors). This is because each of the three color channels (red, green, and blue) can have 256 different values (0-255 in decimal or 00-FF in hexadecimal), and 256 × 256 × 256 = 16,777,216. This is referred to as "24-bit color" because it takes 24 bits to represent all possible combinations.
Can I use hex codes with transparency?
Traditional 6-digit hex codes don't support transparency. However, modern browsers support 8-digit hex codes where the last two digits specify alpha transparency. For example, #FF000080 represents red with 50% transparency. For broader compatibility, especially with older browsers, you can use the rgba() function in CSS, which explicitly includes an alpha value, such as rgba(255, 0, 0, 0.5) for semi-transparent red.
What's the difference between hex codes and RGB values?
Hex codes and RGB values represent the same colors but in different formats. Hex codes use hexadecimal notation (base-16) with values from 00 to FF for each color channel, preceded by a # symbol (e.g., #FF5733). RGB values use decimal notation (base-10) with values from 0 to 255 for each channel (e.g., rgb(255, 87, 51)). Both define colors by specifying red, green, and blue intensities, but they use different number systems to do so. RGB has the advantage of supporting transparency via rgba(), while hex codes are more compact and traditionally more widely used in web development.
Find Your Perfect Hex Codes for Colors
Use our interactive color picker to discover beautiful colors for your web design projects
Start Picking Colors