Color & CSS
Runs 100% locally in your browserRGB to HEX Converter
Dial red, green, blue, and alpha channels to convert RGB values to exact HEX codes and CSS variables.
Live color swatch
7.49:1
2.80:1
Converted color formats
Copy any CSS-ready representation with a single click.
HEX (6-digit)
#f97315
HEX (8-digit)
#f97315ff
RGB
rgb(249, 115, 21)
RGBA
rgba(249, 115, 21, 1)
HSL
hsl(25, 95%, 53%)
OKLCH
oklch(70.48% 0.1869 47.69)
CSS custom property
--brand-color: #f97315;
How to convert RGB and RGBA values to HEX color codes
How RGB channels convert to hexadecimal codes
Each integer channel from 0 to 255 maps to two base-16 digits from 00 to FF. When alpha is below 100%, the converter also emits an 8-digit HEX code (#RRGGBBAA) supported across all modern browsers.
Pasting CSS rgb() and rgba() strings directly
Adjust individual red, green, blue, and alpha sliders or paste a full CSS snippet such as rgb(50, 134, 220) or rgb(50 134 220 / 50%) directly into the input field to get HEX and HSL immediately.
RGB to HEX frequently asked questions
- Are uppercase and lowercase HEX codes identical in browsers?
- Yes. CSS treats #F97315 and #f97315 identically; toggle uppercase formatting to match your style guide.
- How is alpha converted into the last two HEX digits?
- Opacity between 0 and 1 is multiplied by 255, rounded to the nearest integer, and formatted as two hexadecimal digits.
- Does this RGB to HEX tool send my colors to a server?
- No. Everything runs locally in your browser with zero network requests.
Related tools
More browser utilities that run locally with zero uploads.
- HEX to RGB ConverterTranslate hexadecimal color codes to RGB, RGBA, and HSL with live preview and WCAG contrast ratios.
- CSS Grid GeneratorInteractive visual CSS Grid layout builder with column/row spans, responsive breakpoints, and Tailwind export.
- Placeholder Image GeneratorCreate exact-size PNG, WebP, or SVG wireframe mockups with custom labels, colors, grids, and copy-ready HTML.
Instant AI
Launching a site with these assets?
Find a clean domain name and connect AI agents through Instant AI to research availability and launch faster.