FormatterHQ

RGBA to RGB Converter

Strip the alpha channel from rgba() colors and get plain rgb() values. The color channels are kept as they are; see below how to flatten onto a background instead.

Loading tool…
Ready.

How to use the RGBA to RGB Converter

  1. Type or paste a color into the RGBA field, such as rgba(220, 38, 38, 0.2), rgb(220 38 38 / 20%) or 220, 38, 38, 0.2.
  2. The RGB field updates as you type and shows rgb(r, g, b) with the alpha removed.
  3. If you need the color as it appears on a background, apply the flattening formula from this page to the result.

Convert RGBA to RGB

The RGBA to RGB converter removes the alpha channel from rgba() colors and returns plain rgb() values. Use it when a tool, file format or API accepts only opaque colors, or when you want the base color behind a translucent design token.

What this tool does with alpha

The alpha value is dropped. The red, green and blue numbers stay exactly as they are; the color is not blended with white, black or any other background.

rgba(220, 38, 38, 0.2)  →  rgb(220, 38, 38)
rgba(46, 139, 87, 1)    →  rgb(46, 139, 87)

That is the right answer when you want the full-strength color, for example to reuse a brand red that was stored with 20% opacity. It is not what the RGBA color looks like on screen: a 20% red over a white page appears as a pale pink, not a strong red.

Flattening: matching what you actually see

To get the solid color that looks identical to the transparent one over a known background, blend each channel with standard alpha compositing:

result = alpha × color + (1 − alpha) × background

Worked example: rgba(220, 38, 38, 0.2) over white (255, 255, 255).

R = 0.2 × 220 + 0.8 × 255 = 44 + 204  = 248
G = 0.2 × 38  + 0.8 × 255 = 7.6 + 204 = 211.6 → 212
B = 0.2 × 38  + 0.8 × 255 = 7.6 + 204 = 211.6 → 212
→ rgb(248, 212, 212)

Over black (0, 0, 0) the background term disappears and the same color becomes rgb(44, 8, 8), an almost black red. One RGBA input, two very different solid colors. That is why no converter can flatten correctly without knowing the background.

When to drop alpha and when to flatten

  • Drop it when you need the base color: extracting a palette, defining a token, or when opacity will be applied separately, such as through a layer's opacity setting.
  • Flatten it when the result must look the same on a fixed background: email templates, exported images, print, or measuring text contrast against the real composite color.

Contrast checks are a common trap. Contrast is measured on the color as displayed, so test the flattened value, not the dropped one.

Accepted input

Besides rgba(…), you can paste rgb(220 38 38 / 20%), bare numbers like 220, 38, 38, 0.2, or an eight-digit hex code. Fractional channels are rounded to whole numbers. To keep the alpha instead, convert with RGBA to HEX; to add alpha back later, use RGB to RGBA. The RGB to HEX converter gives you a hex code for the flattened color.

Frequently asked questions

Does this tool blend the color with a white background?
No. It removes the alpha and keeps the red, green and blue values unchanged. Use the flattening formula on this page if you need the color as it appears over white or another background.
How do I convert RGBA to RGB on a white background?
For each channel, calculate alpha × channel + (1 − alpha) × 255 and round. For example, rgba(220, 38, 38, 0.2) over white becomes rgb(248, 212, 212).
What does rgba(0, 0, 0, 0.5) look like on white?
Each channel becomes 0.5 × 0 + 0.5 × 255 = 127.5, so it displays as a mid grey of about rgb(128, 128, 128). Over any other background the result is different.
Why does my flattened color differ by 1 from a screenshot?
Rounding. Blending often produces values like 211.6 or 127.5, and browsers, image editors and this formula may round them slightly differently. A difference of one step per channel is not visible.

Last updated October 3, 2026

Related tools

RGB to RGBA Converter Convert RGB colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons. CMYK to RGBA Converter Convert CMYK colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons. HEX to RGBA Converter Convert HEX colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons. HSL to RGBA Converter Convert HSL colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons. HSV to RGBA Converter Convert HSV colour values to RGBA instantly, with a live colour swatch preview, colour picker and copy buttons. RGBA to CMYK Converter Convert RGBA colour values to CMYK instantly, with a live colour swatch preview, colour picker and copy buttons. Tailwind CSS Color Finder Find the closest Tailwind CSS colour class to any HEX, RGB or HSL colour and browse the full default palette with one-click copy. CMYK to Colortone Converter Generate the tints, shades and tones of a CMYK colour as a palette with swatches and ready-to-copy codes. CMYK to HEX Converter Convert CMYK colour values to HEX instantly, with a live colour swatch preview, colour picker and copy buttons. CMYK to HSL Converter Convert CMYK colour values to HSL instantly, with a live colour swatch preview, colour picker and copy buttons. CMYK to HSV Converter Convert CMYK colour values to HSV instantly, with a live colour swatch preview, colour picker and copy buttons. CMYK to RGB Converter Convert CMYK colour values to RGB instantly, with a live colour swatch preview, colour picker and copy buttons.