RGBA to Hex Converter screenshot

RGBA to Hex Converter

Convert rgb(), rgba(), hsl() or hsla() to a hex code, short or with the alpha byte, and see the normalised rgba() value beside it. No upload.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Instant
No signup

What the RGBA to hex converter accepts

rgb(), rgba(), hsl() and hsla() are four ways to spell one colour, and this page reads all of them plus hex and the common colour names. Hue goes through the standard HSL-to-RGB formula with saturation and lightness taken as percentages, so hsl(210, 80%, 50%) becomes #1a80e6. The hex length control decides how many digits come back: three when every channel repeats a nibble, six otherwise, and eight when you ask to keep the alpha byte — four if the alpha repeats a nibble too. Anything that cannot be read is refused by name rather than guessed at, and the normalised rgba() line below the hex shows the value the browser will actually paint.

How to use it

RGBA to Hex Converter: paste the colour into the box above, set Hex length (default "long"), and press Run to get the hex code below.

Worked example

Input:

rgba(37, 99, 235, 0.8)

Output:

#2563eb
rgba(37, 99, 235, 0.8)

Why it runs in your browser

The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads colour and returns hex code; reloading the page discards both.

rgb(), rgba(), hsl() and hsla() are four ways to spell one colour, and this page reads all of them plus hex and the common colour names. Hue goes through the standard HSL-to-RGB formula with saturation and lightness taken as percentages, so hsl(210, 80%, 50%) becomes #1a80e6. The hex length control decides how many digits come back: three when every channel repeats a nibble, six otherwise, and eight when you ask to keep the alpha byte — four if the alpha repeats a nibble too. Anything that cannot be read is refused by name rather than guessed at, and the normalised rgba() line below the hex shows the value the browser will actually paint.

Convert rgb(), rgba(), hsl() or hsla() to a hex code, short or with the alpha byte, and see the normalised rgba() value beside it. No upload.

How to use it

RGBA to Hex Converter: paste the colour into the box above, set Hex length (default "long"), and press Run to get the hex code below.

Why it runs in your browser

The conversion happens on this page with JavaScript. Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere. The page reads colour and returns hex code; reloading the page discards both.

What to Expect

Best for

  • Converting colour to hex code when the data is already on screen.

What this tool keeps

  • Your input is not posted to a server, so it works offline after the page loads and nothing is retained anywhere.

Sample input

rgba(37, 99, 235, 0.8)

Sample output

#2563eb rgba(37, 99, 235, 0.8)

Frequently asked questions

How do I use the rgba to hex converter?

RGBA to Hex Converter: paste the colour into the box above, set Hex length (default "long"), and press Run to get the hex code below.

Is my input uploaded?

No. The text is parsed on this page with JavaScript and is never posted to a server.

Is there a size limit?

Yes: 5 MB per run. Larger input is refused with a message rather than freezing the tab.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.