Hex to RGB

Convert hex color codes to CSS rgb() or rgba() values. Supports 3-, 6-, and 8-digit hex.

Runs in your browser Instant No signup, no tracking

About this tool

Paste a hex color code (with or without the leading `#`) to get its CSS `rgb()` or `rgba()` equivalent. Shorthand three-digit hex (`#f0a`) is expanded to `#ff00aa`. Eight-digit hex includes an alpha byte and is converted to `rgba()`, with alpha normalized to the 0–1 range CSS expects. Handy when you need to pipe a design token through an opacity change or feed a color into a JS animation library that expects rgb triplets.

Example

Paste the input on the left and you will get output like this:

Sample Hex color

#3B82F6CC

Resulting rgb() / rgba()

rgba(59, 130, 246, 0.8)

How to use Hex to RGB

  1. Paste or type your Hex color into the left pane.
  2. The rgb() / rgba() appears instantly in the right pane. Conversion runs in your browser — nothing is uploaded.
  3. Copy the result to your clipboard or download it as a file.

FAQ

Which hex formats are supported?
3, 6, and 8 characters — with or without a leading `#`. Case doesn't matter.
Why doesn't my alpha value look right?
CSS alpha ranges from 0 to 1. The 8-digit hex byte 00–FF is divided by 255 and rounded.
Do you support HSL?
Not yet. Convert hex → rgb here, then use a design tool for HSL if you need it.