HEX: Hexadecimal sRGB Notation
Eight-bit base-16 red, green, blue (and optional alpha) notation (#RRGGBB or #RRGGBBAA) anchored to IEC 61966-2-1 sRGB.
| Extension / Token | .css / .txt |
|---|---|
| MIME / Media type | text/css |
| Gamut scope | sRGB (Standard Web) |
| Human readability | Medium |
| Perceptual uniformity | No |
| Alpha channel support | Yes |
| Best for | Compact copy-paste handoff in sRGB brand guidelines and legacy CSS |
HEX
CSS / .TXT#2563EB / #2563EBCCStrengths
- Universally supported across every browser, design app, and OS since the 1990s.
- Extremely short 7-character string ideal for copy-paste and URL slugs.
- Supports 8-digit #RRGGBBAA alpha channel in all modern CSS engines.
Trade-offs
- Opaque to human eyes — adjusting lightness or saturation requires converting to HSL or OKLCH.
- Strictly limited to 8-bit sRGB; cannot express wide-gamut Display P3 tones.
Convert & inspect HEX locally
Related color engineering guides
- Hex to OKLCH: Migrating Design Tokens to Tailwind CSS v4Step-by-step guide to upgrading Hex and HSL Tailwind v3 themes into CSS Color 4 @theme oklch() scales with perceptual brightness and Display P3 support.
- WCAG 2.2 Contrast Ratio vs APCA (Lc): Complete Color GuideCompare WCAG 2.2 relative luminance ratios (4.5:1) against modern APCA perceptual lightness contrast (Lc 60/75/90), dark-mode polarity, and CVD.
- W3C Design Tokens (DTCG 2025.10): Figma Variables to CSSStructure vendor-neutral color tokens with W3C DTCG 2025.10 JSON ($type, $value colorSpace & components), aliases, and export to CSS & Tailwind v4.
HEX frequently asked questions
Should new design systems still use Hex for primary tokens?
Keep Hex for legacy brand handoff and 100% sRGB compatibility, or convert scales to OKLCH while outputting Hex sRGB fallbacks for older tools.
Does Hex support transparency?
Yes. CSS Color 4 standardizes 4-digit (#RGBA) and 8-digit (#RRGGBBAA) hex notations with an 8-bit alpha channel.