DevFiddleDevFiddle
HomeToolsSnippetsArticles
Explore tools
Home>Tools>Hex to RGB converter

Hex to RGB converter

Type a hex code to get its RGB values, or set red, green and blue to get the hex code. The preview updates as you type. Everything runs in your browser.

#004487 equals rgb(0, 68, 135).
#004487rgb(0, 68, 135)
White text has a 9.6:1 contrast ratio, which passes for body text.

Copy in any format

Each value is ready to paste into your CSS.

FormatValueActions
Hex#004487
Hex, lowercase#004487
RGBrgb(0, 68, 135)
HSLhsl(210, 100%, 26%)
CSS variable--color: #004487;

Common colors

Select a color to load it into the converter.

How it works

1

Enter a color

Type a hex code, or set the red, green and blue values.

2

Check the preview

The swatch shows the color and how readable white or black text is on it.

3

Copy the format

Copy the hex, rgb() or hsl() value and paste it into your styles.

Questions

More tools

Px to rem converter

Turn pixel values into rem units and back.

Open tool
Color contrast checker

Check text and background colors against WCAG.

Open tool
JSON formatter

Check JSON for errors and print it in a readable layout.

Open tool
About© DevFiddle 2026