Free Online RGB to Hex
RGB-to-hex conversion packs three 0–255 channels (and optional alpha) into a compact hex string for CSS, design tools and code editors.
Your data is processed entirely in your browser and never sent to any server.
#3B82F6Formula
Each channel (0–255 decimal) is written as two base-16 digits: 0 → 00, 255 → FF, 128 → 80. The three pairs are concatenated and prefixed with #.
How to Use This Tool
- Drag each channel slider — Red, Green, Blue — or type a value 0–255 into the number input.
- Tick "Include alpha" and drag the Alpha slider if you need an 8-digit hex.
- Read the resulting hex string in the result panel.
- Click the copy icon to copy the hex to your clipboard.
What Is a RGB to Hex?
Going from `rgb(255, 87, 51)` to `#FF5733` is mechanical: each decimal channel becomes a two-digit base-16 number, the three pairs are joined, and a `#` is prefixed. With an alpha channel you get the 8-digit form CSS Color Module Level 4 accepts as `#RRGGBBAA`. The model itself is the additive sRGB space defined by IEC 61966-2-1.
The direction matters for workflow. Image editors and color-pickers in screenshot apps usually output RGB or rgb(); CSS, Tailwind, design-system tokens, JSON theme files and most code editors prefer hex. This converter is the bridge.
It accepts sliders, comma-separated values or three number fields, with an optional alpha slider for transparent overlays. The hex preview updates as you change any input.
Frequently Asked Questions
What RGB input is accepted?
Is the output with or without the # prefix?
How is RGB converted to hex?
Published by the WeGotEveryTool team. We build and test every tool in-house and update pages when the underlying spec, formula, or recommendation changes.
Reviewed: May 2026. Disclaimer: this tool is provided as-is for general informational use. For decisions with material consequences (medical, legal, financial, security) verify results against a qualified professional source.
Related Color & Design
Convert hex color codes to RGB values. Supports 3-, 6- and 8-digit hex (with alpha) for CSS and design workflows.
Convert HSL (hue, saturation, lightness) to RGB. Adjust sliders to see the change live, then copy hex or RGB.
Convert CMYK percentages (cyan, magenta, yellow, key) to RGB and hex for screen use. Print-to-digital workflow.
Pick any color with an interactive picker. See hex, RGB and HSL values update live, then copy in one click.
Generate complementary, analogous, triadic, tetradic and monochromatic color schemes from any seed color.