PERMARKET
Tools › Image › Hex to RGB
RGB

Hex to RGB

Convert HEX to RGB and HSL, or RGB back to HEX — entirely on your device.

Type a HEX code or change R/G/B.
Ad · Large Rectangle (336×280)

How to use Hex to RGB

Convert HEX to RGB and HSL, or RGB back to HEX, with copy-to-clipboard.

  1. Open Hex to RGB on toolpermarket, then enter the values you want to work with.

  2. In the Hex color field, enter a six-character hex value such as 397aac, with or without the leading #. Three-digit shortcuts like 39a are also accepted and expanded automatically.

  3. Press Convert to compute the result. The output appears immediately below the form. Tweak any field and run it again to check a different scenario.

  4. Read the result and use it as needed. If the number looks off, re-check your inputs and run it again — the math is deterministic, so the same entries always return the same answer.

Worked example. Converting 397aac returns RGB(57, 122, 172) and HSL(203, 50%, 45%), the lake-blue used across this site.

Tips for accurate results.

  • Drop the # if you prefer; the converter adds it back in the output.

  • Copy the RGB result straight into CSS rgb() or a design tool color field.

  • If a value looks wrong, check for a typo — every character in hex is a digit or a-f.

When to use Hex to RGB. Turning a brand hex into RGB for canvas or image code. Sharing a color with someone who needs the rgb() form. Debugging why a CSS color does not match a design file.

When you actually reach for this

  • You have a hex code from CSS and need the RGB numbers for a tool or API.
  • You got RGB values and need the shorter hex form for styles.

Where this tool stops being accurate

  • Hex and RGB describe the same color, just in different notation; converting changes nothing visually.
  • An 8-digit hex (#RRGGBBAA) carries alpha (opacity) that plain RGB cannot show without a fourth value.

Frequently asked questions

Why do I get RGB and HSL at once?

Designers and developers use different notations, so the converter shows all three — HEX, RGB and HSL — from a single input. You simply copy the one your stylesheet or code editor expects, and ignore the rest.

What happens with an invalid hex like 39g?

The converter rejects characters outside 0 to 9 and a to f and tells you the input is not valid hex. It will not guess or return a wrong color, so you always know the output matches what you typed.

Is the conversion exact?

Yes. Hex, RGB and HSL are lossless ways to name the same color, so converting back and forth returns the identical color every time with no rounding drift in the displayed values.

What does #RRGGBBAA mean?

The last pair is alpha, or opacity, from 00 (fully transparent) to FF (solid). Plain six-digit hex has no transparency.