All Tools490+

RGB to HEX Converter – Sliders, Live Preview and Steps

Free RGB to Hex Converter Online - Advanced Color Space Studio | VectraTools

RGB to Hex Studio

Transform color channels into dynamic hex codes with live layout previews

rgb(37, 99, 235)
Red (R)
Green (G)
Blue (B)
Copy Code
Calculated Hex Representation
#2563EB
Base-16 Translation Steps:
RGB to HEX Converter online tool by VectraTools

Quick answer

To convert RGB to HEX, change each channel (0–255) into a two-digit hexadecimal number and join them after a # sign. For rgb(20, 184, 166): 20 = 14, 184 = B8, 166 = A6, so the hex code is #14B8A6. Values below 16 get a leading zero, so 5 becomes 05.

Our free rgb to hex converter lets you drag a slider or type a number for each channel and watch the color update live. One click gives you the hex code, a Copy button and the base-16 working for each channel. It is handy for CSS, HTML emails, design handoffs and matching brand colors.

How RGB to HEX Conversion Works

Screens mix red, green and blue light. Each channel has 256 levels, from 0 (off) to 255 (full). Hexadecimal can write any of those 256 levels in just two characters (00 to FF), so a whole color fits in six characters. To convert one channel, divide by 16: the whole number is the first hex digit and the remainder is the second.

ChannelDecimal÷ 16Hex
Red201 remainder 414
Green18411 (B) remainder 8B8
Blue16610 (A) remainder 6A6

How to Use the RGB to HEX Converter

Step 1: Set the Red, Green and Blue Values

Drag each slider or type a value from 0 to 255 in the box next to it. The slider and the box stay in sync. We set Red 20, Green 184 and Blue 166.

RGB to HEX converter with red 20, green 184 and blue 166 entered

Step 2: Check the Live Swatch Preview

The Real-Time Swatch Matrix Preview shows the color as you adjust it, along with its rgb() value. Tweak the channels until the swatch looks right.

Live swatch preview showing teal rgb 20 184 166

Step 3: Click Convert Channels

Press Convert Channels to run the rgb to hex conversion. Use Reset to return to the default color.

Clicking the Convert Channels button

Step 4: Copy the HEX Code

The result shows #14B8A6 with a Copy Code button. The Base-16 Translation Steps list each channel's hex value so you can check the rgb to hex maths.

RGB to HEX result showing 14B8A6 with base-16 translation steps

Common RGB to HEX Values

ColorRGBHEX
Black0, 0, 0#000000
White255, 255, 255#FFFFFF
Red255, 0, 0#FF0000
Green0, 255, 0#00FF00
Blue0, 0, 255#0000FF
Gray128, 128, 128#808080
Royal blue37, 99, 235#2563EB
Teal20, 184, 166#14B8A6
Orange red255, 87, 51#FF5733
Amber245, 158, 11#F59E0B

Decimal to Hex Quick Reference

DecimalHexDecimalHex
00012880
100A160A0
1610192C0
3220200C8
6440224E0
10064255FF

Common Mistakes to Avoid

  • Dropping the leading zero. rgb(5, 10, 15) is #050A0F, not #5AF.
  • Using values above 255. Each channel only goes from 0 to 255.
  • Swapping channel order. The order is always red, green, blue.
  • Forgetting transparency. A plain rgb to hex result has no alpha. For see-through colors, use rgba() in CSS.

To go from a hex code back to RGB or RGBA, use our HEX to RGB converter.

Frequently Asked Questions

How do I convert RGB to HEX?

Convert each channel from decimal to a two-digit hex number and join them: rgb(37, 99, 235) becomes 25, 63 and EB, so #2563EB.

What is rgb(255, 255, 255) in hex?

It is #FFFFFF, pure white.

What is rgb(0, 0, 0) in hex?

It is #000000, pure black.

Why do some hex codes have only 3 digits?

When each pair has two identical digits, CSS lets you shorten it. #FFFFFF can be written #FFF.

Can I type values instead of using sliders?

Yes. Type any number from 0 to 255 in the box beside each slider and the slider moves to match.

Is this rgb to hex converter free?

Yes. It is free, needs no sign-up, and runs entirely in your browser.

MH

Written and tested by Muhammad Hasnain

Founder of VectraTools. Every color value in this guide was checked against the tool's own output. Last reviewed: October 2026.