Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
RGB to HEX Converter

RGB to HEX Converter

Convert RGB color values to HEX codes instantly. Perfect for web development and design.

RGB to HEX Converter

The RGB to HEX converter turns RGB values like rgb(59, 130, 246) into hexadecimal codes like #3B82F6. RGB is how screens describe color and how most design tools output it, while HEX is the compact, copy-friendly format CSS and HTML use most often.

HEX is just RGB in base-16. Each channel (0–255) becomes a two-character pair (00–FF), so 59 becomes 3B and 246 becomes F6.

When You Need It

Writing CSS

Turn a tool's RGB output into a clean HEX code that drops straight into a stylesheet or theme variable.

Sharing Colors

A single HEX string is far easier to copy, message, or document than three separate numbers.

Design Handoff

Convert picked RGB values to HEX for brand guides, design tokens, and developer specs.

How to Convert RGB to HEX

1

Enter the RGB Values

Type your three channels — for example 59, 130, 246. You can separate them with commas or spaces, and you may wrap them in rgb(...) if you prefer.

2

Read the HEX Output

The HEX code is generated instantly as you type, and the live swatch updates so you can confirm the color at a glance.

3

Or Pick a Color

Click the preview swatch to open the native color picker and select a color visually — both the RGB and HEX fields fill in automatically.

4

Copy & Reuse

Press the copy button to grab the HEX code. The panel below also shows the same color as RGB, HSL, HSV, and CMYK.

Features

Real-Time Output

HEX updates as you type, entirely in your browser — no waiting, no reloads.

Flexible Input

Accepts comma- or space-separated values, with or without the rgb() wrapper.

Visual Preview & Picker

A live swatch verifies the result, and the picker lets you choose a color visually.

All Formats at Once

See HEX, RGB, HSL, HSV, and CMYK together for every color you enter.

Standard output: HEX codes are returned in uppercase (e.g. #3B82F6), the common convention — though HEX is case-insensitive when used in CSS.

Frequently Asked Questions

What RGB values are valid?

Each channel must be an integer between 0 and 255. Values are clamped or flagged if they fall outside that range, since RGB has no meaning beyond it.

Why use HEX instead of RGB?

HEX is more compact and easier to copy and share as one string. Both formats are fully supported in CSS, so the choice is mostly about convenience and team conventions.

How do I enter the RGB values?

Enter the three numbers separated by commas or spaces — for example 59, 130, 246 or 59 130 246. Wrapping them in rgb(...) also works.

Is the output uppercase or lowercase?

The converter outputs uppercase HEX (e.g. #3B82F6), which is the most common convention. CSS treats #3b82f6 and #3B82F6 identically.

Is the conversion exact?

Yes. RGB to HEX is a direct, lossless mapping — each 0–255 channel becomes exactly one 00–FF pair, so the same RGB input always yields the same HEX code with no rounding.

Click to pick
rgb(59, 130, 246)
Click to pick
#3B82F6
Click to pick
hsl(217, 91%, 60%)
Click to pick
#3B82F6
Click to pick
hsl(217, 91%, 60%)
Click to pick
cmyk(76%, 47%, 0%, 4%)
Enter RGB as r, g, b or rgb(r, g, b)
Values must be between 0 and 255
Spaces and commas are both accepted
Want to learn more? Read documentation →
1/4
Can't find it? Build your own tool with AI
Start typing to search...
Searching...
No results found
Try searching with different keywords