Hex to RGB Color Converter – Free & Instant

Convert any hex color code to RGB values instantly. Free, browser-based, no sign-up. Also shows HSL, HSV & CMYK with a live color swatch.

RGB

rgb(26, 115, 232)

All formats

HEX#1A73E8
RGBrgb(26, 115, 232)
HSLhsl(214, 82%, 51%)
HSVhsv(214, 89%, 91%)
CMYKcmyk(89%, 50%, 0%, 9%)

Converts instantly in your browser. Accepts #hex, rgb(…), hsl(…), hsv(…) and cmyk(…).

Convert any hex color code to RGB values instantly

Paste a hex color code and get the exact RGB values in one click — no math, no guessing. The tool also shows you the color in HSL, HSV, and CMYK, along with a live color swatch so you can confirm it looks right.

How to convert hex to RGB

  1. Type or paste your hex code into the input field above (with or without the # symbol).
  2. The RGB values appear immediately — no button needed.
  3. Click the copy icon next to any value to grab it for your code or design tool.
  4. The live swatch updates as you type, so you can spot-check the color at a glance.

Worked example: converting a hex code to RGB

Say your designer hands you the hex code #1A73E8 — Google's signature blue. Here is what the converter gives you:

FormatValue
Hex#1A73E8
RGBrgb(26, 115, 232)
HSLhsl(217, 80%, 51%)
HSVhsv(217, 89%, 91%)
CMYKcmyk(89%, 50%, 0%, 9%)

The three RGB numbers represent Red (26), Green (115), and Blue (232) — each on a scale of 0 to 255. A higher number means more of that color channel. So this blue has very little red, some green, and a lot of blue.

How to do this in code

If you need to convert hex to RGB inside your own project, here are minimal, copy-pasteable snippets:

JavaScript

function hexToRgb(hex) {
  const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
  return result ? {
    r: parseInt(result[1], 16),
    g: parseInt(result[2], 16),
    b: parseInt(result[3], 16)
  } : null;
}

console.log(hexToRgb('#1A73E8'));
// { r: 26, g: 115, b: 232 }

Python

def hex_to_rgb(hex_color):
    hex_color = hex_color.lstrip('#')
    return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))

print(hex_to_rgb('#1A73E8'))
# (26, 115, 232)

Both snippets split the hex string into three two-character pairs (one for each channel) and convert each from base-16 to a regular 0–255 integer.

How it works

A hex color code like #1A73E8 is just three pairs of hexadecimal (base-16) digits written back to back: 1A = red, 73 = green, E8 = blue. The converter parses each pair and translates it into a decimal (base-10) number from 0 to 255 — the standard range for an RGB channel.

The conversion is pure arithmetic and happens entirely in your browser. Nothing you type is sent to a server, so your colors stay completely private.

The W3C CSS Color Level 4 specification defines how browsers interpret hex codes and RGB values — this tool follows that same standard.

When to use hex vs. RGB

  • Use hex in HTML, CSS, and design tools like Figma or Sketch — it's compact and widely supported.
  • Use RGB when you need to manipulate individual color channels in code, apply CSS functions like rgba() for transparency, or pass color data to a canvas or WebGL API.
  • Use HSL if you want to programmatically lighten or darken a color — it's much easier to reason about than either hex or RGB.

When this tool won't help

  • 4-digit and 8-digit hex codes (which include an alpha/transparency channel) — use the rgba() format instead and note that the alpha channel is a separate value from 0 to 1.
  • CSS named colors like cornflowerblue — look those up in the MDN named color reference to get their hex equivalents first.
  • Pantone or RAL print colors — those don't map to screen RGB in a standardized way.

Quick snippet bait: #FF4500 in RGB

The hex code #FF4500 (OrangeRed) converts to rgb(255, 69, 0). That means maximum red (255), a little green (69), and no blue at all (0) — which is exactly why it looks like a vivid flame orange on screen.

No sign-up, no ads, no upload — just paste your hex code above and your RGB values are ready to copy.

Frequently asked questions

Is my color data uploaded to a server?+
No. The conversion runs entirely in your browser using JavaScript. Nothing you type ever leaves your device, so your palette and brand colors stay completely private.
Do I need the # symbol when I paste a hex code?+
No. The tool accepts both #1A73E8 and 1A73E8. It also handles lowercase letters, so #1a73e8 works fine too.
What is the difference between hex and RGB?+
They describe exactly the same color — just written differently. Hex uses two base-16 digits per channel (like E8), while RGB uses plain decimal numbers (like 232). Browsers understand both.
How do I convert hex to RGB in CSS?+
You don't need to — browsers accept hex codes directly in CSS. But if you want RGB so you can add transparency, use rgba(26, 115, 232, 0.5) — the fourth number is opacity from 0 (invisible) to 1 (fully opaque).
How do I convert hex to RGB in Python?+
Use tuple(int(hex.lstrip('#')[i:i+2], 16) for i in (0, 2, 4)). That strips the #, splits the string into three pairs, and converts each from base-16 to a regular integer.
How do I convert hex to RGB in JavaScript?+
Parse each two-character hex pair with parseInt(pair, 16). The worked example in the page above shows the full three-line function you can copy straight into your project.
Is this tool free? Do I need to create an account?+
Completely free, no account needed, no usage limits. Just open the page and start converting.
Can I also get HSL or CMYK from the same hex code?+
Yes — the tool shows the color in every common format at once: hex, RGB, HSL, HSV, and CMYK. A live color swatch updates as you type so you can visually confirm the result.