⇄

HEX to RGB

Convert hex to rgb using the available input and format options.

Choose a file or fill the fields, then click Run tool.

About HEX to RGB

Brand guidelines and CSS files list colors as hex codes, but some tools, such as image editors, code libraries and email builders, want separate red, green and blue values. Designers and developers use this to split a hex code into RGB numbers. It is also useful for checking contrast calculations, which usually start from RGB channel values.

How it works

You enter a hex code with or without the hash sign. The code removes the first hash, expands a three-digit code such as #abc to #aabbcc, then reads the value as a hexadecimal integer. It extracts red, green and blue with bit shifts and returns a CSS-style rgb() string. Eight-digit codes with alpha are not handled correctly. Nothing is sent to a server; the result is plain text you can copy.

How to use HEX to RGB

  1. Complete the available fields: HEX. Use the field labels and examples shown in the workspace.
  2. Select “Run tool” and check the result before copying or downloading it.

Worked example

Enter #2563eb. The tool shows rgb(37, 99, 235). Entering #fff gives rgb(255, 255, 255). A brand orange of #ff6600 gives rgb(255, 102, 0). The hash sign is optional, so ff6600 gives the same result. A pure black #000 expands to #000000 and gives rgb(0, 0, 0).

Tips for a better result

  • Paste the code without spaces. Extra characters can make the result wrong without any warning.
  • Use six-digit or three-digit codes only. An eight-digit code with alpha will produce misleading numbers.
  • Copy the full rgb() string directly into CSS. It is valid syntax as shown.

Frequently asked questions

What happens with an invalid code?

If the text cannot be read as hex, the tool may show rgb(0, 0, 0) or wrong values. It does not warn you, so check the input.

Does it support #RRGGBBAA?

No. Only three and six digit codes are converted correctly.

Can it give HSL values?

No. It outputs RGB only.

What to check

Some measures vary by region or date and may not have a universal equivalent.

Read the Privacy Policy for information about local processing, connected services and advertising.