Hex Color Codes: A Developer's Complete Reference Guide
Everything about hex color codes. How they work, common colors, and converting between hex, RGB, and HSL.
Try it now - free
Use BriskTool's free tool for this task
Hex color codes are six-digit codes that define colors on the web. #FF0000 is red, #00FF00 is green, #0000FF is blue. Here's everything you need to know about them.
How Hex Codes Work
A hex code is three pairs of hexadecimal numbers: RR GG BB. Each pair ranges from 00 (none) to FF (maximum). So #FF0000 means: max red, no green, no blue = pure red.
You can also use shorthand: #F00 = #FF0000, #333 = #333333.
Most-Used Hex Codes
- #000000 - Black
- #FFFFFF - White
- #333333 - Dark gray (great for body text)
- #666666 - Medium gray
- #F5F5F5 - Light gray (backgrounds)
- #FF0000 - Red
- #3B82F6 - Blue (Tailwind blue-500)
- #22C55E - Green (Tailwind green-500)
- #EAB308 - Yellow (Tailwind yellow-500)
Converting Between Formats
Sometimes you need RGB for CSS, or HSL for adjusting saturation. The Hex to RGB Converter converts instantly between all formats with live preview. Type a hex code and get RGB, HSL, and CSS values with one click to copy.
Choosing Accessible Colors
The WCAG standard requires a contrast ratio of at least 4.5:1 for normal text. Dark gray (#333) on white (#FFF) passes. Light gray (#999) on white fails. Use the Color Contrast Checker to verify your color combinations meet accessibility standards.