inyourbrowser.com

HEX to RGB Converter

Enter a HEX color code like #3b82f6 and get the RGB values instantly. All conversion happens in your browser.

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

A HEX code is three bytes written in base 16. The converter splits #3b82f6 into 3b, 82 and f6 and reads each pair as a number: 3 × 16 + 11 = 59, 8 × 16 + 2 = 130 and 15 × 16 + 6 = 246, giving rgb(59, 130, 246). A 3-digit code is expanded first by doubling each digit, so #f80 becomes #ff8800, rgb(255, 136, 0). 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 is a HEX color code?
A HEX color code is a 6-digit hexadecimal number prefixed with # that represents RGB values. #ff0000 is red (255, 0, 0).
Do I need to include the #?
The # is optional. The tool accepts codes with or without it, typed or pasted.
Can I convert a 3-digit HEX code?
Yes. Each digit is doubled first, so #f80 is read as #ff8800 and converts to rgb(255, 136, 0).
Does it accept 8-digit HEX codes with alpha?
The converter reads 3 or 6 digits. For an 8-digit code, drop the last two digits (the alpha channel) to convert the opaque color.

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.