代码、数据与二维码工具

RGBA转HEX转换器

在浏览器中处理或呈现RGBA转HEX转换。

优先本地处理无需注册隐私说明 ↗

COLOR VALUE CONVERTER

Turn RGBA into copy-ready HEX

Use a CSS color or numeric channels. The converter validates every boundary, rounds channels explicitly, and keeps the alpha rule visible.

Examples: rgba(39, 54, 42, 0.24), rgb(39 54 42), or 39, 54, 42, 24%.

CONVERSION RESULT

HEX
RGB
CSS

Enter a color to begin.

使用步骤

如何使用

  1. Paste a CSS rgba(), rgb(), or comma-separated numeric value, or enter channels directly.
  2. Choose six digit HEX for opaque color or eight digit HEX when you need alpha.
  3. Copy the HEX, RGB, or CSS result and use it in your stylesheet or design token.

Accepted color input

Use rgb(r, g, b), rgba(r, g, b, a), or four numeric fields. RGB channels accept integers or decimals from 0 to 255 and are rounded to the nearest integer. Alpha is optional and defaults to 1; use a decimal from 0 to 1 or a percentage from 0% to 100%.

HEX and alpha rules

Six digit HEX always contains only red, green, and blue. Eight digit HEX appends alpha as two hexadecimal digits in CSS #RRGGBBAA order. Alpha is converted with round(alpha × 255), so 0.24 becomes 61 and 3D.

Local and bounded

Parsing and conversion run in this browser. Input is limited to 200 characters, RGB channels must stay within 0–255, and alpha must stay within 0–1 or 0–100%. No color profile or named-color lookup is applied.

常见问题

你可能还想知道

What does an omitted alpha value mean?

It means fully opaque: alpha is 1, or 255 in an eight digit HEX value.

How is decimal RGB rounded?

Each channel is rounded to the nearest integer, then clamped only after validating that it is within 0–255.

Which HEX alpha order does this tool use?

The output follows CSS #RRGGBBAA order, with alpha in the final two hexadecimal digits.

Does the converter upload my color?

No. Conversion, copying, and validation happen locally in your browser.