HEX to RGB color converter
A HEX color is three pairs of base-16 digits for red, green and blue, so #1E90FF is rgb(30, 144, 255). Type a HEX code or an rgb() value to get every CSS form of the same color, including its alpha if the code has one.
RGB
rgb(30, 144, 255)
#1E90FF · hsl(210, 100%, 56%)
- HEX
- #1E90FF
- rgb()
- rgb(30, 144, 255)
- rgba()
- rgba(30, 144, 255, 1)
- hsl()
- hsl(210, 100%, 56%)Rounded to whole degrees and percents
- CSS Color 4 syntax
- rgb(30 144 255)Space-separated, alpha after a slash
| Channel | HEX | Value | Percent of full |
|---|---|---|---|
| Red | 1E | 30 | 11.8% |
| Green | 90 | 144 | 56.5% |
| Blue | FF | 255 | 100% |
How do you convert HEX to RGB?
A six-digit HEX code is three pairs of base-16 digits for red, green and blue. Each pair runs from 00 to FF, which is 0 to 255: the first digit times 16 plus the second. In #1E90FF, 1E = 1 × 16 + 14 = 30, 90 = 9 × 16 + 0 = 144 and FF = 15 × 16 + 15 = 255, so the color is rgb(30, 144, 255). The letters can be upper or lower case.
Three- and four-digit codes are shorthand in which each digit is doubled, so #F80 is #FF8800. A fourth digit, or a fourth pair, is alpha: 00 is fully transparent and FF fully opaque, so #1E90FF80 is 128 ÷ 255, about 50.2% opaque.
rgb() and rgba() are the same function in current CSS: MDN calls rgba() an alias of rgb() and recommends writing rgb(). CSS Color 4 also allows spaces between the channels and the alpha after a slash, as in rgb(30 144 255 / 50%), and this converter reads and writes both forms.
HSL describes the same color as a hue angle, a saturation and a lightness, converted with the sample code in CSS Color 4. The tool rounds HSL to whole degrees and percents, so converting the rounded HSL back can land a step or two away in a channel: hsl(210, 100%, 56%) is rgb(31, 143, 255), next to #1E90FF's rgb(30, 144, 255).
channel = first digit × 16 + second digit (00 → 0, FF → 255) alpha = alpha pair ÷ 255 (80 → 128 ÷ 255 ≈ 0.502)
What are the HEX, RGB and HSL values of common CSS color names?
| Name | HEX | rgb() | hsl() |
|---|---|---|---|
| black | #000000 | rgb(0, 0, 0) | hsl(0, 0%, 0%) |
| white | #FFFFFF | rgb(255, 255, 255) | hsl(0, 0%, 100%) |
| dodgerblue | #1E90FF | rgb(30, 144, 255) | hsl(210, 100%, 56%) |
| rebeccapurple | #663399 | rgb(102, 51, 153) | hsl(270, 50%, 40%) |
| tomato | #FF6347 | rgb(255, 99, 71) | hsl(9, 100%, 64%) |
| coral | #FF7F50 | rgb(255, 127, 80) | hsl(16, 100%, 66%) |
| crimson | #DC143C | rgb(220, 20, 60) | hsl(348, 83%, 47%) |
| orange | #FFA500 | rgb(255, 165, 0) | hsl(39, 100%, 50%) |
| gold | #FFD700 | rgb(255, 215, 0) | hsl(51, 100%, 50%) |
| seagreen | #2E8B57 | rgb(46, 139, 87) | hsl(146, 50%, 36%) |
| teal | #008080 | rgb(0, 128, 128) | hsl(180, 100%, 25%) |
| slategray | #708090 | rgb(112, 128, 144) | hsl(210, 13%, 50%) |
How to convert a HEX color to RGB
- 1Enter a colorType or paste a HEX code such as #1E90FF, 1e90ff, #F80 or #1E90FF80, or an rgb(), rgba(), hsl() or hsla() value.
- 2Check the swatchThe swatch shows the color. A color with alpha is shown twice: with its transparency and fully opaque.
- 3Copy the form you needEach line has its own copy button: HEX, rgb(), rgba(), hsl() and the CSS Color 4 space syntax.
Frequently asked questions
What is #FFFFFF in RGB?
How do I convert RGB to HEX?
How do I add transparency to a HEX color?
What is the difference between rgb() and rgba()?
Why does converting HSL back to HEX give a slightly different color?
Sources
- CSS Color Module Level 4: hex notation (§5.2), rgb() and hsl() syntax, named colors, HSL conversion (§7) (checked 20 Oct 2026)
- MDN: <hex-color> (checked 20 Oct 2026)
- MDN: rgb() (rgba() is an alias) (checked 20 Oct 2026)
- MDN: hsl() (hsla() is an alias) (checked 20 Oct 2026)
Need this, but tailored to your brand?
We design UI, UX, and interfaces that feel as good as they look.
Built by CountryDevs · No signup · No ads · We count visits, never what you enter