Convert HEX colour codes to RGB and HSL, including alpha values.
rgb(255, 136, 0)
255, 136, 0
#ff8800
hsl(32, 100%, 50%)
Six-digit HEX
The standard form
#ff8800Shorthand
Three digits expand to six
#f80With alpha
Eight digits include transparency
#4f46e580Six-digit HEX
The standard form
#ff8800Shorthand
Three digits expand to six
#f80With alpha
Eight digits include transparency
#4f46e580With or without the hash, in three, four, six or eight digits. Conversion happens as you type.
Values are given both as separate channels and as a ready-to-paste rgb() or rgba() string.
Take the CSS function for a stylesheet, or the individual numbers for code that works with channels directly.
Three- and four-digit values expand properly, where each digit is doubled rather than padded with zeros.
Eight-digit HEX carries transparency, which is converted to the 0–1 alpha that CSS rgba() expects.
A live swatch confirms the colour, which catches transposed digits immediately.
Turn a hexadecimal colour into its RGB components. Three-digit shorthand, six-digit standard, and the four- and eight-digit forms that carry alpha are all handled, with or without a leading hash. The HSL equivalent is shown alongside, along with a live preview swatch so you can confirm you pasted the colour you meant to.
Keep going
Related pages in Developer Tools, plus what others are using right now.
More developer tools that pair well with this one.
Convert RGB and RGBA colour values into HEX codes.
Pick a colour and get HEX, RGB and HSL values with contrast checking.
Create linear and radial CSS gradients visually and copy the code.
Format and tidy CSS, SCSS and Less with consistent spacing and indentation.
Build CSS box shadows visually and copy the generated code.
Format, validate and minify JSON, with errors that point to the exact line.
Create strong random passwords with full control over length and characters.
Work out any percentage — of a number, as a share, or as a change.
Count words, characters, sentences and paragraphs as you type.
Convert between length, weight, temperature, volume, speed, data and more.
Count characters with and without spaces, against the limits that matter.
Find the mean, median, mode and range of a list of numbers, with the working shown.
Sample and population standard deviation and variance, both shown, with the working.
Turn a logo into favicon.ico, the PNG sizes a site needs, and the HTML to declare them.
Check a downloaded file against its published checksum, without uploading anything.
Stamp text like DRAFT or CONFIDENTIAL across a PDF, in your browser.
Escape text for HTML, or turn entities back into readable characters.
See how savings grow with compounding, including regular contributions.