A CSS value from the fields
Add an alpha byte to a hex color
The alpha is a number from 0 to 1. It is written as the last two hex digits.
0 is fully transparent and 1 is fully opaque.
The work stays in this tab.
This tool runs in your browser. Turn on JavaScript to use it.
Hex alpha
The sample is fixed. It uses the same rule as the form.
- Color
- #1e4d3a
- Alpha
- 0.5
- Result
- #1e4d3a80
How to use it
- 1Fill in the fields.
- 2Read the result.
- 3Copy the line you need.
Good to know
- The page does not composite the color onto a background.
- This page does not upload the text.
- Text longer than one hundred thousand characters is rejected.
Questions
Does the result leave this browser?
No. The calculation finishes in the current tab.
What does this page leave out?
The page does not composite the color onto a background.
What if the input is huge?
Past one hundred thousand characters, the page stops and asks you to shorten it.
Related tools
- Convert a color
The same color is written as hex, RGB, or HSL depending on the file. This page parses one of those forms and prints the other two.
- Check the contrast of two colors
The ratio uses the WCAG relative luminance of the two opaque colors.
- Encode text as hexadecimal
Hex is a way to show raw bytes. This page encodes text as UTF-8 first, then prints each byte. Decoding accepts only an even number of digits and rejects bytes that are not UTF-8.