๐ŸŽจ HEX to RGB Converter

Convert any HEX colour code to RGB, HSL and CSS values โ€” with a live preview

Enter Colour

#
#4f46e5
RGB
rgb(79, 70, 229)
Copied!
RGBA
rgba(79, 70, 229, 1)
Copied!
HSL
hsl(243, 75%, 59%)
Copied!
HEX (full)
#4f46e5
Copied!
CSS Variable
--color: #4f46e5;
Copied!
RGB values only
79, 70, 229
Copied!

Popular Colours

Embed This Tool

Add this HEX to RGB Color Converter to your website or blog for free โ€” just paste this code:

<iframe src="https://hex-to-rgb.tabutility.com/" width="100%" height="600" frameborder="0" style="border-radius:12px" title="HEX to RGB Color Converter by Tabutility"></iframe> <p style="font-size:12px"><a href="https://hex-to-rgb.tabutility.com/" target="_blank" rel="noopener">HEX to RGB Color Converter</a> by <a href="https://tabutility.com/" target="_blank" rel="noopener">Tabutility</a></p>
Free to use โ€” the credit link helps others find the tool
๐Ÿ›ก๏ธ
Stay private online
Protect your connection with NordVPN โ†’ Get NordVPN
Sponsored ยท Ad

Related Tools

JSON Formatter
Developer Tools
Base64 Encoder / Decoder
Developer Tools
URL Encoder / Decoder
Developer Tools
Password Generator
Developer Tools
Meta Tags Generator
SEO
Schema Markup Generator
SEO

The hex to RGB converter translates a hexadecimal color code such as #3498DB into its red, green, and blue components, giving you a ready-to-paste rgb() value. It is built for web designers, front-end developers, and anyone matching brand colors across CSS, design tools, and style guides where different apps expect different color formats.

How the Hex to RGB Converter Works

A hex color is a six-digit code made of three pairs, one each for red, green, and blue. Each pair is written in base-16 (hexadecimal), where the digits run 0โ€“9 then Aโ€“F. The converter takes each pair and turns it into a decimal number from 0 to 255 โ€” the range RGB uses โ€” so FF becomes 255 and 00 becomes 0.

Three-digit shorthand codes like #0AF are expanded first by doubling each digit to #00AAFF. The result is an rgb(red, green, blue) string you can drop straight into CSS, and adding an alpha channel gives you the rgba() form for transparency. Both hex and RGB describe exactly the same colours, so the choice usually comes down to what a particular tool or codebase expects โ€” designers often think in hex, while dynamic CSS and canvas work often needs RGB.

Example 1: #3498DB splits into 34, 98, DB โ†’ 52, 152, 219, giving rgb(52, 152, 219), a familiar flat-UI blue used in many design systems.
Example 2: Pure red #FF0000 splits into FF, 00, 00 โ†’ 255, 0, 0, giving rgb(255, 0, 0). Add an alpha channel for rgba(255, 0, 0, 0.5) to make it half transparent.

Frequently Asked Questions

How do you convert a hex color to RGB?

Split the six-digit hex code into three pairs โ€” red, green and blue โ€” and convert each pair from base-16 to base-10. For example, FF becomes 255, so #FF0000 is rgb(255, 0, 0).

What is the difference between hex and RGB color values?

They describe the same color in different notations. Hex uses a six-digit base-16 string like #3498DB, while RGB lists three decimal values from 0 to 255. Browsers treat #3498DB and rgb(52, 152, 219) identically.

What does a 3-digit hex code like #FFF mean?

A shorthand hex code doubles each digit, so #FFF expands to #FFFFFF (white) and #0AF expands to #00AAFF. It only works when each color channel uses a repeated digit.

How do I add transparency to an RGB color?

Use the rgba() notation, which adds a fourth alpha value between 0 (fully transparent) and 1 (fully opaque). For example, rgba(52, 152, 219, 0.5) is the same blue at 50% opacity.

Is this hex to RGB converter free to use?

Yes โ€” it is completely free, runs entirely in your browser, and requires no sign-up.