inyourbrowser.com

RGB to HEX Converter

Enter RGB values (0–255 each) and get the HEX color code instantly. Runs entirely in your browser. Our servers are not involved.

Input
All formats
HEX#3b82f6
RGBrgb(59, 130, 246)
HSLhsl(217, 91%, 60%)

CONVERT

All three formats are shown simultaneously regardless of mode.

Runs entirely in your browser

How it works

Each channel from 0 to 255 is written as two base-16 digits, and the three pairs are joined behind a #. 59 is 3 × 16 + 11, so it becomes 3b; 130 becomes 82 and 246 becomes f6, giving #3b82f6. Values below 16 get a leading zero, so rgb(0, 128, 0) becomes #008000. All conversion runs in JavaScript in your browser.

Processing runs in your browser

All computation happens inside your browser tab. Our servers are not involved at any point.

Related operations

To check whether two colours meet WCAG legibility, try the contrast checker. For building a coordinated set from one base colour, use the colour palette generator. To craft smooth multi-stop blends in CSS, see the CSS gradient generator.

Frequently asked questions

What range can RGB values be?
Each channel (red, green, blue) is a whole number from 0 to 255.
What format is the HEX output?
A 6-digit lowercase hex code prefixed with #, for example #3b82f6.
What happens if a value is above 255?
The converter shows no result until R, G and B are all numbers from 0 to 255. It does not clamp or guess a value.
Can I paste rgb(59, 130, 246)?
Type the three numbers into the R, G and B fields. The converter does not read rgb() strings.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Contrast checker
Check WCAG AA/AAA contrast ratios between two colours. Live pass/fail results.
Color palette generator
Generate complementary, analogous, triadic, and monochromatic color palettes. Copy hex values or all colors as CSS variables.
Tints & shades generator
Generate 5, 10, or 20 tints and as many shades from any base color. Click any swatch to copy the hex code.
Image color picker
Pick any color from an image you open. Hex, RGB, and HSL output. Runs in your browser.
Number base converter
Convert numbers between binary, octal, decimal, and hex. All bases shown at once.