HEX ↔ RGB

3- or 6-digit hex. Output is rgb(r, g, b).

How to use the HEX ↔ RGB

What does the HEX ↔ RGB do?

Convert #RRGGBB hex colors to rgb() and back; It applies this page-specific rule: a six-digit hex color is three bytes: RR, GG, BB in base 16.

Which inputs does this tool use?

To convert #rrggbb hex colors to rgb() and back, enter HEX, RGB; keep every value in the same example; the page then updates the result from the current values; Start with a familiar case covered by this rule - Type in either box - so the expected result can confirm the settings.

How should the tool result be read?

For a result intended to convert #rrggbb hex colors to rgb() and back, type in either box; read rgb together with the original hex rather than as an isolated answer, and confirm that its units or structure match the intended use.

Alpha / #RRGGBBAA?

When the goal is to convert #rrggbb hex colors to rgb() and back, not on this page.

Do I need the hash?

When using the page to convert #rrggbb hex colors to rgb() and back, optional.

Limits and accuracy

When using this tool to convert #rrggbb hex colors to rgb() and back, this page does not do HSL, OKLCH, or alpha (#RRGGBBAA); check the result in its intended destination before relying on it for important work; keep hex until the output has been checked in its intended destination. For a repeatable check when you need to convert #rrggbb hex colors to rgb() and back, record HEX alongside the final output and selected options. A known example using hex can confirm how the page will convert #rrggbb hex colors to rgb() and back. While trying to convert #rrggbb hex colors to rgb() and back, read the status message before copying or downloading because it can identify an incomplete or unsupported RGB.

How this works

A six-digit hex color is three bytes: RR, GG, BB in base 16. #c45c26 is 196, 92, 38. A three-digit hex such as #c52 expands by doubling each digit: #cc5522.

Type in either box. The swatch uses the parsed color. Values outside 0–255 are ignored until they are valid.

This page does not do HSL, OKLCH, or alpha (#RRGGBBAA). Shader-style 0–1 floats have their own converter.

Frequently asked questions

Alpha / #RRGGBBAA?

Not on this page.

Do I need the hash?

Optional. Both c45c26 and #c45c26 work.

Named colors?

Not here. Paste a hex or rgb triple.