# RGB to HEX

> Convert RGB values (0–255) into a HEX color code.

URL: https://uttir.com/rgb-to-hex
Categories: color-tools
Privacy: Conversion runs locally in your browser.

## About

Enter red, green, and blue channel values from 0 to 255 and get the matching HEX code, ready to paste into CSS or a design tool. A live swatch shows the color as you type.

Out-of-range or non-numeric channels are flagged instead of silently clamped, so you always know what you are copying.

## How to use

1. **Enter R, G, B values** — Whole numbers from 0 to 255.
2. **Copy the HEX** — The code appears next to the preview swatch.

## Examples

### A familiar indigo

Common channel values map to a tidy code.

Input:

```
79, 70, 229
```

Output:

```
#4f46e5
```

## FAQ

### Why 0 to 255?

Each RGB channel is one byte, giving 256 possible intensities from 0 (none) to 255 (full).

### How do I add transparency?

Output the 8-digit HEX form (#RRGGBBAA) where the last two digits are the alpha (00 = transparent, FF = opaque). Most modern CSS supports this directly.

### Can I paste a CSS color and get the hex?

Yes — paste any valid CSS color (hex, rgb, rgba, hsl, named) and the output is the matching hex. The picker also accepts HSL inputs and converts to hex.

### What about RGBA inputs?

Paste rgba(255, 136, 0, 0.5) and the tool extracts the RGB part (#FF8800) and shows the alpha as a percentage (50%). It also accepts hsla() and named colors like "tomato".

## Related tools

- [HEX to RGB](https://uttir.com/hex-to-rgb) — Convert any HEX color code to its RGB and HSL equivalents.
- [Color Picker](https://uttir.com/color-picker) — Pick any color and copy it as HEX, RGB, or HSL.

---

For the full HTML page with the live tool, visit https://uttir.com/rgb-to-hex.
This file is the markdown rendering at https://uttir.com/rgb-to-hex.md. See https://uttir.com/llms.txt for a site-wide summary.
