HEX to RGB Converter

Convert HEX to RGB

Convert HEX codes like #FF5733 into CSS rgb(255, 87, 51)—fast, private, and right in your browser.

  • Paste a single HEX color or a whole palette
  • Use one color per line for batch conversion
  • Copy your RGB results instantly

Quick start

  1. Paste your HEX color(s) into the input.
  2. Use one color per line.
  3. Copy the RGB results.

Single color

Input:

#22D3EE

Output:

rgb(34, 211, 238)

Palette / design tokens (batch)

Input:

#FF0055
#22D3EE
#111827

Output:

rgb(255, 0, 85)
rgb(34, 211, 238)
rgb(17, 24, 39)

What HEX means

HEX is a compact way to write RGB values using hexadecimal (base‑16).

Most commonly, HEX appears as:

  • #RRGGBB

Each pair is one channel:

  • RR = red
  • GG = green
  • BB = blue

Example:

  • #FF5733 means:
    • FF (red)
    • 57 (green)
    • 33 (blue)

Shorthand HEX

You’ll also see 3-digit shorthand:

  • #fff expands to #ffffff

It’s the same color—just a shorter notation.

HEX is widely used for:

  • CSS variables and theme tokens
  • Tailwind / design system configs
  • storing palettes in JSON/YAML
  • quick copy/paste across tools

What RGB means

RGB stands for Red, Green, Blue—the three light channels used by screens.

  • Each channel is an integer from 0 to 255.
  • rgb(0, 0, 0) is black.
  • rgb(255, 255, 255) is white.

RGB is especially useful when you need to:

  • do math with colors (mixing, gradients, interpolation)
  • use canvas / WebGL APIs
  • animate colors or generate tints/shades programmatically

How HEX → RGB conversion works

Conceptually, the converter does this for each line:

  1. Read the HEX pairs for red/green/blue
  2. Convert each pair from base‑16 to base‑10
  3. Format the result as rgb(r, g, b)

A small example:

  • #22D3EE
    • 22 → 34
    • D3 → 211
    • EE → 238

So #22D3EE becomes rgb(34, 211, 238).


Common mistakes (and quick fixes)

Extra spaces at the start/end of a line

This variant does not trim lines.

If a line has extra whitespace, try removing it:

#FF0055

🚫 #FF0055

Missing the #

Use standard CSS-style HEX with the leading #:

#111827

🚫 111827

Invalid length

HEX should be either 3 or 6 hex digits (plus the #):

#fff, #ffffff

🚫 #ffff, #fffffff

Non-hex characters

HEX digits must be 0–9 or A–F:

#12ABEF

🚫 #12ABEG


Practical uses

  • Turn design tokens into RGB for color math and generation
  • Use rgb(…) in code when building gradients, animations, or UI states
  • Convert documentation palettes from HEX into a more readable numeric format
  • Work with canvas / image tools that expect RGB channel values

If you’re doing anything programmatic with color, RGB is often the easiest format to manipulate—then you can always convert back to HEX for final tokens and CSS.

Frequently Asked Questions

Use standard HEX color codes like #FF5733 or shorthand like #fff. Paste one color per line for batch conversion.

This variant outputs CSS-style RGB in the form rgb(r, g, b) with integer channels from 0 to 255.

Yes. This variant is batch-first: paste one HEX value per line and you’ll get one RGB result per line.

No—this variant outputs opaque RGB (rgb(...)) only. If you need alpha conversion, use the full Color Converter tool.

Each line must be a valid HEX color code. Also note that this variant does not trim lines—extra spaces at the start/end of a line can cause parsing issues.

Try one of our format-specific converters below

Explore Our Tools

Read More From Our Blog