Web design and CSS
Turn a color from a design file or a screenshot picker into the hex code your stylesheet needs.
Enter red, green and blue numbers, pick a color, or paste a hex code and see every format at once: HEX, RGB and HSL. A live preview and a contrast check show which text color works best. Everything runs in your browser.
–––Learn how color codes work and how to pick readable color pairs.
Screens make every color by mixing red, green and blue light. RGB writes the mix as three numbers from 0 to 255. HEX writes the same three numbers in base 16 as a short code such as #1F3A5F, which is what CSS, design tools and brand guides usually use.
Enter the three numbers, pick a color with the picker, or paste a hex code. All formats update together, and you also get an HSL version and a check of which text color reads best on it.
Turn a color from a design file or a screenshot picker into the hex code your stylesheet needs.
Keep a brand color consistent between a logo file, a slide deck and a website.
Check which text color works on a background and see the contrast ratio before you publish.
Each of the three numbers is turned into a two-digit base-16 value, then the three pairs are joined.
Base 16 uses the digits 0-9 and the letters A-F, where A is 10 and F is 15. A short code like #FA0 is shorthand: each digit is doubled, so it means #FFAA00.
| Color | RGB | HEX |
|---|---|---|
| Black | 0, 0, 0 | #000000 |
| White | 255, 255, 255 | #FFFFFF |
| Red | 255, 0, 0 | #FF0000 |
| Green | 0, 255, 0 | #00FF00 |
| Blue | 0, 0, 255 | #0000FF |
| Yellow | 255, 255, 0 | #FFFF00 |
| Orange | 255, 165, 0 | #FFA500 |
| Gray | 128, 128, 128 | #808080 |
Your colors are converted in your browser. Nothing is sent to our server or stored. Only the lowercase choice is remembered on your device.
The tool works with standard 8-bit sRGB colors, 0 to 255 per channel. It does not handle transparency (RGBA or 8-digit hex), CMYK for print, or wide-gamut color spaces.
Enter the red, green and blue values, each from 0 to 255. The tool converts each number to two base-16 digits and joins them, so 31, 58, 95 becomes #1F3A5F.
Paste the hex code into the Hex field. The three RGB numbers fill in at once. For example, #FF8800 is 255, 136, 0.
No. You can type it with or without the #, and short codes such as #FA0 work too. The result always includes the # so it is ready for CSS.
They are the amount of red, green and blue light, from 0 (none) to 255 (full). 0, 0, 0 is black and 255, 255, 255 is white.
HSL describes a color as hue, saturation and lightness. It is often easier to adjust by hand, for example to make a color a little lighter, and it works directly in CSS.
It shows how well black or white text stands out on your color. A ratio of 4.5 : 1 or more is the usual minimum for normal text under the WCAG accessibility guidelines.
Not here. This tool handles opaque colors only, with no alpha channel. For transparency, add an alpha value yourself in rgba() in your CSS.
No. The conversion runs in your browser and nothing leaves your device. Only your lowercase choice is remembered for next time.
The homepage features dozens more free tools that don't require an API key.
No matching question.
Share your thoughts on this tool with other visitors.