Tools / Color converter and contrast checker / Calculators

HEX to RGB

Convert HEX to RGB (and HSL) in your browser. Type a color code like #4f46e5 and copy rgb(79, 70, 229). Free and instant.

Report a problem

How to use it

  1. Type a color in HEX, RGB or HSL, or pick one.
  2. Copy the format you need.
  3. In the contrast checker, enter a text color and a background to see if they pass.

About hex to rgb

To convert hex to rgb, type a color code such as #4f46e5 in the box and copy the result: rgb(79, 70, 229). A hex code is three pairs of digits for red, green and blue, each from 00 to FF, which is 0 to 255 in RGB. Short codes such as #fff work too. The same box also reads rgb() and hsl() values, so you can convert in either direction.

Questions

How do you convert hex to rgb by hand?

Split the code into three pairs and turn each from base 16 to a number. For 4f it is 4 x 16 + 15 = 79.

What is the RGB of #ffffff?

rgb(255, 255, 255), which is white.

Can it convert back to hex?

Yes. Type an rgb() or hsl() value and the HEX code is shown.

Which color formats can I type?

HEX such as #4f46e5 or #fff, RGB such as rgb(79, 70, 229), and HSL such as hsl(243, 75%, 59%).

Related tasks

Last updated: 2026-10-25

Other tools