🔒 100% private — runs in your browser, nothing is uploaded

Color Converter (HEX ↔ RGB)

Convert HEX to RGB and back, with live preview.

HEX (#4f46e5) and RGB (79, 70, 229) are two notations for the same color — HEX is compact for CSS, RGB is explicit for design tools.

How to use

  1. Type a HEX code or RGB values — the other updates live.
  2. See the color preview instantly.
  3. Click "Random color" for inspiration, "Copy HEX" to grab it.

About this tool

Designers constantly convert between them when moving colors from mockups to code.

Conversion happens instantly in your browser.

How it works

In #RRGGBB, each pair of hex digits is one color channel: #FF5733 means red = FF (255), green = 57 (87), blue = 33 (51). Converting HEX to RGB is just base-16 to base-10, done three times — and back again is base-10 to base-16, padded to two digits.

HSL is a third view built for humans: hue (0–360°, position on the color wheel), saturation (0–100%, gray to vivid), lightness (0–100%, black to white). Designers reach for HSL because 'make it a little darker' is simply lowering the lightness number, while in RGB the same tweak means recalculating all three channels.

The numbers are exact — #FF5733 is always rgb(255, 87, 51) on every screen — but the live preview still helps, because the same values render slightly differently across displays.

Worked examples

From design tool to CSS: Figma hands you #3B82F6. Convert it to rgb(59, 130, 246) for a box-shadow, or to hsl(217, 91%, 60%) when you want hover states — just raise the lightness for a lighter variant.

Checking text contrast: White text (#FFFFFF) on a #FF5733 button: convert both to RGB, compute relative luminance, and you can verify the WCAG contrast ratio before the design ships.

Quick reference

FormatExampleBest for
HEX#FF5733CSS values, design tools
RGBrgb(255, 87, 51)CSS functions, canvas code
HSLhsl(11, 100%, 60%)Tweaking lightness and saturation

Frequently asked questions

What is the difference between HEX and RGB?

None in meaning — #FF0000 and rgb(255,0,0) are the same red. HEX is shorter; RGB is more readable.

Why do I see 3 or 6 digit HEX codes?

#F00 is shorthand for #FF0000 — each digit is doubled. This tool uses the full 6-digit form.

Is anything uploaded?

No — everything runs locally.

📦 Embed this tool on your site

<iframe src="https://verystep.com/embed/color/" title="Color Converter (HEX ↔ RGB)" width="100%" height="520" loading="lazy" style="border:0"></iframe>

Free to use. The embed shows a small "Powered by Verystep" link.

More free tools