RGB to HEX Converter
Type or slide RGB / RGBA values to instantly get HEX, HSL, HSLA and CMYK — with a live color preview, channel sliders and a built-in color picker. Free and private.
What is the RGB to HEX Converter?
An RGB to HEX Converter takes the RGB triplets used in code or design tools and produces the HEX code most commonly used in CSS and brand guidelines. Toollyz RGB to HEX Converter accepts a wide range of inputs — `rgb(99, 102, 241)`, `rgba(99, 102, 241, 0.5)`, plain `99, 102, 241`, space-separated `99 102 241`, or percentage values — and instantly shows the matching HEX with alpha (where applicable), along with HSL, HSLA, CMYK and a Tailwind-friendly arbitrary-value snippet. A live preview adjusts the background and chooses readable text automatically, and four channel sliders let you fine-tune R, G, B and alpha visually. Everything happens in your browser; nothing is uploaded.
How to use it
- Type or paste RGB values — `rgb(...)`, `rgba(...)` or comma/space separated.
- Watch the live preview update and the HEX appear at the top.
- Drag the R, G, B and Alpha sliders to fine-tune the color.
- Click any row in All formats to copy that value.
Benefits
- Flexible input — rgb(), rgba(), plain numbers, percentages and spaces.
- Live preview with automatic contrast text for readability.
- R, G, B and Alpha sliders for visual fine-tuning.
- Outputs HEX, HEX-with-alpha, RGB, RGBA, HSL, HSLA, CMYK and Tailwind arbitrary.
- Built-in color picker and named presets.
- Alpha channel preserved end-to-end (alpha → #RRGGBBAA).
- Clear error message when input can't be parsed.
- 100% private — colors stay in your browser.
Frequently asked questions
What input formats does it accept?
Standard CSS rgb()/rgba(), plain comma-separated (`99, 102, 241`), space-separated (`99 102 241`), and percentages (`39%, 40%, 95%`). Alpha can be a decimal between 0 and 1 or a percentage.
How does alpha map to HEX?
Alpha 0–1 becomes a hex byte 00–FF appended to the color. So `rgba(99, 102, 241, 0.5)` becomes #6366F180 (the 80 is ~0.502 in 0–1 space).
Should I include alpha in my HEX?
Only when you actually need transparency. The tool shows both forms — six-digit HEX without alpha and eight-digit HEX with alpha — so you can pick whichever your stylesheet expects.
What's a Tailwind arbitrary value?
Tailwind lets you use any color via bracket syntax like `bg-[#6366F1]`. The tool generates this snippet for you so you can paste it straight into a className.
Why does my color look slightly different in HSL?
HSL is a perceptual model with rounded integer channels, so converting RGB → HSL → RGB rarely round-trips byte-for-byte. The HEX/RGB pair is exact; HSL is a close approximation.
Can I use the channel sliders to find a nearby color?
Yes — drag any slider to nudge R, G, B or alpha. The HEX, HSL and CMYK outputs all update in real time, so it's great for tweaking a brand color.
Does it work with percentages?
Yes. `rgb(39%, 40%, 95%)` parses correctly and gets converted to byte values internally.
What's the difference between rgb() and rgba()?
rgba() adds a fourth alpha channel. CSS now also accepts modern syntax like `rgb(99 102 241 / 0.5)` — the tool handles both.
Is any data sent to a server?
No. Toollyz has no server — parsing and conversion happen in your browser. Your last input is saved only in your device's local storage.
Is this RGB to HEX converter free?
Completely free with no signup. Convert as many colors as you like — privately in your browser.
Related tools
See all converters toolsHEX to RGB Converter
Convert HEX colors to RGB, RGBA, HSL, HSV and CMYK.
Random Color Generator
Generate beautiful random palettes, gradients and design-ready colors with live UI preview.
CSS Minifier
Minify, beautify and analyze CSS safely.
Color Picker
9 color formats, WCAG contrast, harmonies and an eyedropper.