HEX to RGBA Converter

Client-sideNo sign-upFree

Convert a HEX color to an rgba() value, supporting both a separate alpha input and 8-digit #RRGGBBAA hex.

Quick facts

Category
Converters
Best for
Getting an rgba() CSS value from a HEX color, with an explicit or embedded alpha channel
HEX input
Alpha (0-1 or 0%-100%)
✓ Converted below
RGBA
rgba(255, 0, 0, 0.5)
A 6-digit HEX uses the separate alpha field above (0-1, or a percentage). An 8-digit #RRGGBBAA HEX carries its own alpha as the last byte pair, following the CSS Color 4 convention - not the ARGB byte order some other ecosystems use - and takes priority over the field.
In-content slot
Was this tool helpful?
On this page

Overview

Convert a HEX color into an rgba() CSS value, supporting two ways of specifying transparency: a plain 6-digit HEX (or 3-digit shorthand) paired with a separate alpha value you enter directly (0-1, or a percentage from 0%-100%), or an 8-digit #RRGGBBAA HEX where the last two hex digits are the alpha channel itself. The 8-digit format follows the CSS Color 4 convention (alpha as the trailing byte) - not the ARGB byte order some other ecosystems (like Android or some image-editing tools) use, which would put the alpha byte first. When an 8-digit hex is entered, its embedded alpha takes priority over the separate alpha field. Runs entirely client-side.

Best for: Getting an rgba() CSS value from a HEX color, with an explicit or embedded alpha channel

How to use this tool

  1. Enter your HEX color. A 6-digit HEX like #FF0000, or an 8-digit HEX like #FF000080 that already includes alpha.
  2. Set alpha (if not using 8-digit hex). Enter alpha as 0-1 (e.g. 0.5) or as a percentage (e.g. 50%).
  3. Get the rgba() value. The RGB channels and resolved alpha are combined into a ready-to-copy rgba() string.

Frequently asked questions

Close - the last hex byte pair, 0x80 (128 in decimal), divided by 255 gives an alpha of approximately 0.502, not exactly 0.5. Exactly 50% alpha as an 8-digit hex byte is 0x80 by convention (128/255 ≈ 0.502), since 255 isn't evenly divisible by 2.

This tool follows the CSS Color 4 convention: alpha is the last byte pair (#RRGGBBAA). Some other ecosystems, like Android's color integers, use ARGB order (alpha first) instead - if you're pasting a hex value from one of those, move the alpha byte pair to the end first, or it will be misread as part of the blue channel.

The 8-digit hex's own embedded alpha takes priority, and the separate alpha field is disabled - since the hex string already fully specifies the color including transparency, there is no ambiguity to resolve from the field.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools