RGB to HEX Converter

Convert any RGB color to a HEX code instantly. Click any result to copy it.

Try These Example Colors

Click any color to load it into the converter.

#C2541A
rgb(194, 84, 26)
#E8A045
rgb(232, 160, 69)
#7B9EB8
rgb(123, 158, 184)
#1A2B4A
rgb(26, 43, 74)
#F5C8A0
rgb(245, 200, 160)
#8B2500
rgb(139, 37, 0)
#4A7CB8
rgb(74, 124, 184)
#9090B8
rgb(144, 144, 184)
#F0A090
rgb(240, 160, 144)
#A0D8C8
rgb(160, 216, 200)
#B87333
rgb(184, 115, 51)
#C4956A
rgb(196, 149, 106)
#3D5A70
rgb(61, 90, 112)
#D4956A
rgb(212, 149, 106)
#6080A0
rgb(96, 128, 160)

What is RGB to HEX Conversion?

What is RGB?

RGB stands for Red, Green, Blue. Each channel is a number from 0–255 that controls how much of that color is mixed. For example, rgb(255, 87, 51) is a vivid orange-red.

What is a HEX color?

A HEX color is a 6-character code (e.g. #FF5733) used in CSS and design tools. Each pair of characters represents the Red, Green, and Blue channels in base-16 (hexadecimal).

How to convert?

Convert each RGB channel (0–255) to a 2-digit hexadecimal value and concatenate them with a # prefix. For example, R=255 → FF, G=87 → 57, B=51 → 33 → #FF5733.

How It Works

Three steps to convert any RGB color to HEX, HSL, and CMYK.

1

Enter your RGB values

Type the Red, Green, and Blue values (each 0–255) into the input fields. You can also click any example color below to load it automatically.

2

Get HEX, HSL, and CMYK instantly

The tool converts as you type — no button to press. You get six outputs at once: HEX code, RGB string, CSS rgb(), HSL, CSS hsl(), and CMYK. A live color swatch updates in real time so you can visually confirm the color before copying.

3

Click any result to copy

Click any result box to copy it to your clipboard. Paste directly into CSS, Figma, Tailwind, Adobe XD, or any tool that accepts color values.

Need to go the other way? Use the HEX to RGB converter to convert a HEX code back to RGB, HSL, and CMYK.

Common Questions About RGB to HEX

Answers to what people search for most.

How do I convert RGB to HEX?
Convert each channel (R, G, B) from decimal (0–255) to a 2-digit hexadecimal value, then join them with a # prefix. For example, rgb(255, 87, 51) → #FF5733. This tool does it instantly as you type.
What is the HEX code for an RGB color?
Every RGB triplet maps to a unique HEX code. rgb(0, 0, 0) is #000000 (black). rgb(255, 255, 255) is #FFFFFF (white). Enter any RGB values above to see the HEX code immediately.
Can I use HEX in CSS instead of RGB?
Yes. CSS accepts both formats. color: rgb(255, 87, 51) and color: #FF5733 produce identical results. HEX is more compact and widely used in design tools and stylesheets.
What design tools accept HEX color codes?
Figma, Adobe Photoshop, Illustrator, XD, Canva, Sketch, CSS, Tailwind CSS, and virtually every design or development tool supports HEX. Copy the HEX value from this tool and paste it directly into your color picker.
How do I convert RGB to HSL?
Normalize each RGB channel to 0–1, then derive Hue (0–360°), Saturation (0–100%), and Lightness (0–100%). For example, rgb(255, 87, 51) → hsl(11, 100%, 60%). This tool outputs the HSL value and CSS hsl() string automatically.
How do I convert RGB to CMYK?
Normalize each RGB channel to 0–1, find the Key (Black) value as 1 minus the max channel, then derive Cyan, Magenta, and Yellow. CMYK is used in print design. For example, rgb(255, 87, 51) → cmyk(0%, 66%, 80%, 0%).
Why does my RGB color look different in print?
RGB is an additive color model for screens (mixing light), while print uses CMYK (mixing inks). Some vivid RGB colors fall outside the CMYK gamut and will appear less saturated when printed. Use the CMYK output from this tool to check your print values.
What is the difference between RGB and HEX?
They represent the same color space — both describe Red, Green, and Blue channels. RGB uses decimal numbers (e.g. 255, 87, 51) while HEX uses base-16 notation (e.g. FF5733). HEX is more compact; RGB is more readable for calculations.
Does this tool also convert RGB to HSL and CMYK?
Yes. Enter any RGB value and you instantly get six outputs: HEX, RGB, CSS rgb(), HSL, CSS hsl(), and CMYK. No extra steps — all formats appear together so you can copy whichever one your tool requires.
How do I convert HEX back to RGB?
Use the HEX to RGB converter. Enter any HEX code and it outputs RGB, HSL, and CMYK instantly — the exact reverse of this tool.
Copied!