How to get a HEX code
- 1Drag in the color square or type a HEX code such as
#2596BEor2596bein the HEX field. - 2Adjust the opacity slider if you need transparency — the HEX value becomes 8 digits (#RRGGBBAA).
- 3Click the copy button next to HEX to copy the code.
How HEX color codes work
A HEX color code is an RGB color written in hexadecimal (base 16). #RRGGBB uses two digits each for red, green and blue, from 00 (none) to FF (full, 255). So #FF0000 is pure red, #FFFFFF white and #000000 black.
Short forms double each digit: #2BE equals #22BBEE. An optional fourth pair sets opacity: #2596BE80 is about 50% opaque. HEX codes are not case-sensitive.
| HEX | Meaning |
|---|---|
#RGB | 3-digit short form (each digit doubled) |
#RGBA | 4-digit short form with alpha |
#RRGGBB | Standard 6-digit code |
#RRGGBBAA | 8-digit code with alpha (00 transparent – FF opaque) |
Frequently asked questions
How many HEX colors are there?
16,777,216 — that's 256 values for each of red, green and blue (256³).
How do I convert a HEX code to RGB?
Each pair of digits is a number from 0 to 255 in base 16. Use the RGB values shown on this page, or the color converter for many colors at once.
What is the HEX code for transparent?
Any 8-digit HEX ending in 00 is fully transparent, for example #00000000.