Home › Developer Tools › Hex Opacity Calculator

Hex Opacity Calculator

Type an opacity percentage to get the two-digit HEX alpha suffix, the complete 8-digit #RRGGBBAA color and the matching rgba() value. Works the other way too: paste an alpha pair like CC to see what opacity it means.

Last updated:

Convert
%

0% = fully transparent, 100% = fully opaque

Two hex digits like 80 or CC, or a full #RRGGBBAA code

3- or 6-digit HEX; used for the 8-digit code and preview

Enter your values to see the result.
Advertisement
Advertisement

How to use the Hex Opacity Calculator

  1. Choose the direction: opacity to HEX, or HEX alpha to opacity.
  2. Enter the opacity (0-100%) or the two-digit alpha pair.
  3. Add your base color to get the full 8-digit code and a preview.
  4. Copy the result or download the full 0-100% table as CSV.

HEX opacity formula

A HEX alpha value is the opacity written on a 0-255 scale in base 16:

alpha = round(opacity% × 255 ÷ 100), then convert alpha to two hex digits (pad with a leading 0 below 16).

Going back: opacity% = alpha ÷ 255 × 100. For example CC = 12 × 16 + 12 = 204, and 204 ÷ 255 = 80%.

HEX opacity table

Every 5% step, shown on black (#000000). Swap the first six digits for any color you like; the tool above lists every single percent.

OpacityHEX alpha0-255Black example
100%FF255#000000FF
95%F2242#000000F2
90%E6230#000000E6
85%D9217#000000D9
80%CC204#000000CC
75%BF191#000000BF
70%B3179#000000B3
65%A6166#000000A6
60%99153#00000099
55%8C140#0000008C
50%80128#00000080
45%73115#00000073
40%66102#00000066
35%5989#00000059
30%4D77#0000004D
25%4064#00000040
20%3351#00000033
15%2638#00000026
10%1A26#0000001A
5%0D13#0000000D
0%000#00000000

Tips for transparent colors

  • Use 8-digit HEX for overlays, borders and shadows where only the color should be see-through; use the opacity property to fade a whole element.
  • Design tools often show opacity as a percent while code needs HEX, which is why values like 1A (10%), 33 (20%), 80 (50%) and CC (80%) are worth remembering.
  • Android XML colors put alpha first (#AARRGGBB), so #802F6B4F there equals #2F6B4F80 in CSS.
  • Text placed on a translucent color should still meet contrast guidelines against the real background behind it.

Frequently asked questions

What is the HEX code for 50% opacity?

50% opacity is 80 in HEX. 50% of 255 is 127.5, which rounds to 128, and 128 in hexadecimal is 80. Black at 50% opacity is therefore #00000080.

How do I convert opacity to a HEX alpha value?

Multiply the opacity percentage by 255, divide by 100, round to the nearest whole number and convert it to two hexadecimal digits. For 75%: 75 × 255 ÷ 100 = 191.25, rounded to 191, which is BF.

Where does the alpha go in an 8-digit HEX color?

In CSS the alpha pair comes last: #RRGGBBAA. So #2F6B4FCC is the color #2F6B4F at 80% opacity. Android color resources use the opposite order, #AARRGGBB, with the alpha first.

Do all browsers support 8-digit HEX colors?

Yes. #RRGGBBAA and the 4-digit #RGBA shorthand are part of CSS Color Level 4 and work in all current versions of Chrome, Edge, Firefox and Safari. For very old browsers use rgba() instead.

Why is my opacity not exact?

The alpha channel has only 256 steps (00 to FF), so most percentages fall between two steps. 33% becomes 54, which is really 32.94%. The difference is far too small to see.

What is the difference between opacity and transparency?

They are opposites. 80% opacity means the color covers 80% and lets 20% of the background show through, which is 20% transparency. HEX alpha always stores opacity.

Is HEX alpha the same as the CSS opacity property?

Not quite. A HEX alpha only makes that one color translucent, for example a background, while the opacity property fades the whole element including its text and children.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

HEX to RGBAConvert HEX color codes to CSS rgba() with an opacity slider and one-click copy.RGBA to HEXConvert rgba() colors to 8-digit HEX, or flatten transparency onto any background.Color Code ConverterConvert a color between HEX, RGB, HSL, HSV, CMYK, LAB, LCH and OKLCH with a live swatch.CSS Color Filter GeneratorTurn a HEX color into a CSS filter that recolors black icons and SVGs, with an accuracy score.Image Opacity ChangerMake an image semi-transparent with an opacity slider or fade, and save a transparent PNG.Password GeneratorCreate strong passwords and passphrases.Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.MD5 Hash GeneratorGenerate MD5 hashes of text, lines or files and verify checksums.SHA-256 Hash GeneratorSHA-256 and HMAC-SHA256 hashes of text, lines or files, in hex or Base64.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTML Entity Encoder / DecoderEscape and unescape HTML entities, named or numeric.Bcrypt Hash Generator & CheckerCreate bcrypt password hashes and check a password against a hash.Binary TranslatorConvert text to binary, hex, octal and back.HMAC GeneratorGenerate and verify HMAC signatures with SHA-256, SHA-512, SHA-1 or MD5.CRC32 Checksum CalculatorCalculate CRC-32, CRC-32C, CRC-16 and Adler-32 checksums of text or large files.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.JWT GeneratorCreate and sign HS256, HS384 or HS512 JSON Web Tokens in your browser and verify them.Password Strength CheckerSee how strong a password really is, how long it takes to crack and how to improve it.Caesar CipherEncode and decode Caesar shift ciphers and crack unknown shifts with a ranked brute force.Vigenère CipherEncrypt and decrypt Vigenère and Autokey ciphers, and crack unknown keys with frequency analysis.Atbash CipherEncode and decode Atbash ciphers (A↔Z, B↔Y) in Latin or Hebrew, with a live letter mapping table.ASCII TableFull ASCII code chart 0–255 in decimal, hex, octal, binary and HTML, with search and copy.Unicode Character LookupFind Unicode characters by name or code point and copy them with UTF-8, HTML and code escapes.Punycode ConverterConvert international domain names, emails and URLs between Unicode and xn-- Punycode, in bulk.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.Binary to HexConvert binary to hex instantly with steps and signed mode.Hex to BinaryConvert hex to binary instantly with steps and signed mode.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.Hex CalculatorHexadecimal + − × ÷ and AND, OR, XOR, NOT, shifts with decimal and binary equivalents.Base32 Encoder / DecoderEncode and decode Base32 (RFC 4648), Base32hex, Crockford and z-base-32 from text, hex or files.Base58 Encoder / DecoderEncode and decode Base58 and Base58Check (Bitcoin alphabet) from text or hex, with checksum verification.Unicode Escape / UnescapeConvert text to \uXXXX, \u{...}, \x, &#...; or CSS escapes and decode them back.File Hash CheckerGet MD5, SHA-1, SHA-256 and SHA-512 checksums of files and verify them against a hash.TOTP GeneratorGenerate 2FA one-time codes from a secret key, create otpauth QR codes and verify codes.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.SSL Certificate DecoderDecode PEM SSL/X.509 certificates: subject, issuer, expiry, SANs, key and fingerprints.Text Encryption ToolEncrypt and decrypt text with a password using AES-256-GCM, entirely in your browser.Pwned Password CheckerCheck if a password appeared in data breaches; only 5 characters of its SHA-1 hash are sent.RSA Encryption ToolEncrypt text with an RSA public key and decrypt it with the private key using RSA-OAEP in your browser.SAML DecoderDecode SAMLRequest and SAMLResponse messages to readable XML, attributes and validity times.SSL Certificate ConverterConvert SSL certificates and keys between PEM, DER, PFX/P12 and P7B in your browser.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.PBKDF2 Hash GeneratorDerive PBKDF2 keys from a password, salt and iteration count with SHA-1, SHA-256 or SHA-512.Protobuf DecoderDecode raw Protocol Buffers hex or Base64 without a schema, or add a .proto for field names.XML Escape / UnescapeEscape & < > " ' for XML text and attributes, unescape entities back, or wrap text in CDATA.Binary Search Tree VisualizerInsert, delete and find in BST, AVL and red-black trees with animated rotations and traversals.Argon2 Hash GeneratorHash passwords with Argon2id, Argon2i or Argon2d and verify them against an encoded hash.Base64 to PDFDecode a Base64 string to a PDF with preview and download, or encode a PDF to Base64.Bitwise CalculatorCalculate AND, OR, XOR, NOT and bit shifts at 8–64 bits with a bit grid and all bases.CSR GeneratorCreate a certificate signing request (CSR) and private key with SANs, RSA or ECDSA, in your browser.MongoDB ObjectId to TimestampDecode a MongoDB ObjectId to its creation date, or build ObjectIds from dates for range queries.PGP Encrypt / DecryptEncrypt, decrypt, sign and verify PGP messages with your armored keys, entirely offline.PGP Key GeneratorGenerate an OpenPGP key pair (Curve25519, NIST ECC or RSA) with passphrase and expiry, offline.Quoted-Printable Encoder / DecoderEncode or decode quoted-printable email text (MIME) with UTF-8 and 76-character soft line breaks.Self-Signed Certificate GeneratorCreate a self-signed SSL certificate and key for localhost or dev servers, as PEM or PFX.SHA-1 Hash GeneratorSHA-1 and HMAC-SHA1 of text or files in hex or Base64, plus Git blob hashes and verify.SHA-512 Hash GeneratorSHA-512 and SHA-384 hashes of text or files in hex or Base64, HMAC and hash verification.SRI Hash GeneratorCreate Subresource Integrity hashes (sha256/384/512) and ready <script> or <link> tags.SSH Key GeneratorGenerate Ed25519 or RSA SSH key pairs in your browser: OpenSSH public key plus private key.String Escape / UnescapeEscape or unescape strings for JavaScript, Java, C#, Python, C, SQL, regex, CSV and shell.UTF-8 Encoder / DecoderConvert text to UTF-8 bytes in hex, decimal, binary, \x or % and decode bytes back to text.UUID Decoder & ValidatorDecode any UUID: version, variant, v1/v6/v7 timestamp and MAC node, plus bulk validation.Base64 to FileDecode Base64 or a data URI to a downloadable file; detects the real file type and previews it.File Encryption ToolEncrypt and decrypt any file with a password using AES-256-GCM, entirely in your browser.Passphrase GeneratorMake strong, memorable diceware passphrases from a 7,776-word list, with entropy in bits.CSR DecoderDecode a PEM certificate signing request: subject, SANs, key size, signature and CA readiness checks.Enigma Machine SimulatorEncrypt and decrypt with a virtual Enigma I, M3 or M4: rotors, rings, plugboard and lampboard.
See all 65 Encoders, Hashes & Crypto →