Convert RGB color to hex
Enter rgb() / rgba() or comma-separated channels. Get a #RRGGBB or #RRGGBBAA hex code with a live color preview—handy for CSS and design handoff.
Use the swatch to pick a color. RGB also accepts Chinese commas (,).
100%
Preview
ChannelsClick to copy
Private · Fast · Free
Examples
Click a row to fill the input and convert
| Input | Output | — |
|---|---|---|
RGB from props or legacy CSS often needs Hex for other tools. Multiple input styles are accepted with a live swatch.
How to convert RGB to Hex
- Enter rgb()/rgba() or comma-separated channels
- Non-opaque alpha yields 8-digit #RRGGBBAA
- Copy the Hex and confirm against the preview
Good for
- rgb() → #RRGGBB / #RRGGBBAA
- Flexible separators
- Fast local color checks
Common uses
- Push CSS rgb back into Hex palettes
- Export 8-digit Hex for mobile UI
- Cross-check with Hex to RGB
Tips
- Alpha can be 0–1 or 0–255
- For HSL workflows see HSL to Hex / Hex to HSL
FAQ
- What RGB formats are accepted?
- rgb(255, 87, 51), rgba(...), or plain 255, 87, 51. Alpha can be 0–1 or 0–255.
- When do I get an 8-digit hex?
- When alpha is present and not fully opaque, the output uses #RRGGBBAA.