Convert RGB & RGBA to Hex
Turn RGB triplets (0–255), percentages, or CSS rgba() strings into clean #RRGGBB and #RRGGBBAA hex codes immediately.
0 bytes sent
- 100% browser-local
- Zero server transfers
- CSS Color 4 precision
or drop a color string, CSS/JSON snippet, or file here · Ctrl V to paste · Paste Hex, RGB, HSL, OKLCH or use Screen Eyedropper
Instant Before & After Specimen
6-digit & 8-digit Alpha HEXrgb(37, 99, 235)#2563EB| Property | Source: RGB | Target: HEX |
|---|---|---|
| Gamut scope | sRGB (Standard Web) | sRGB (Standard Web) |
| Perceptual uniformity | No | No |
| Alpha channel support | Yes | Yes |
| Human readability | Medium | Medium |
| Extension / Token | .css / .json | .css / .txt |
| Best for | Pixel buffers, Canvas 2D shaders, and programmatic alpha opacity blending | Compact copy-paste handoff in sRGB brand guidelines and legacy CSS |
How to use RGB to Hex
RGB to Hex — cleanly inside your local browser with zero server transfers.
- Enter or pick a colorType Hex, RGB, HSL, OKLCH, or Lab — or click Screen Eyedropper and live sliders.
- Inspect math & gamutReview exact CSS Color 4 readouts, sRGB vs Display P3 status, and profile options.
- Copy, chain, or exportCopy ready CSS/JSON snippets, download binary swatch files, or pipe directly to related Colr tools.
Frequently asked questions
How are non-100% alpha values encoded into Hex?
Alpha [0, 1] maps to a rounded 00–FF byte appended as digits 7 and 8 (#RRGGBBAA).
Can I toggle uppercase vs lowercase Hex output?
Yes — switch case formatting directly in the converter toolbar.