Moving a colour into code
A hex value from a design tool converts to the RGB channels a graphics library or a calculation needs.
Convert a hex colour to RGB in your browser, accepting both three and six digit forms.
Maintained by Roshan.
Converts hex colour to rgb in this tab, with nothing sent anywhere.
During the latest release check, #3366CC returned the RGB channels 51, 102, 204 in the browser. The result was checked from the rendered output rather than inferred from the page copy.
Find related browser-local tools for nearby tasks without starting another search.
Browse all general convertersHex and RGB are two ways of writing the same colour, and converting between them is a constant small task in design and front-end work. A hex code packs the three colour channels into six digits - two for red, two for green, two for blue - which is compact and what CSS and design tools use by default. RGB spells the same three channels out as numbers from 0 to 255, which is the form you need when a value has to go into code that does arithmetic on colours, into a graphics API, or into a tool that only takes decimal channels. This converter reads a hex code, including the three-digit shorthand where each digit is doubled, and returns the equivalent RGB, so a colour picked in one place drops straight into another.
A hex value from a design tool converts to the RGB channels a graphics library or a calculation needs.
Convert to rgb first, then add the alpha you want - the channels are the hard part.
Yes. A three-digit code like #3bf is expanded by doubling each digit before conversion.
No. It is optional and stripped, so codes with or without it work.
Eight-digit hex with alpha is not handled here. Use an opaque six-digit code, or a colour tool that supports alpha.
No. Hex and RGB are two notations for the same colour; only the way it is written changes.
Convert an RGB colour to a hex code in your browser, from any common RGB format.
Convert a hex colour to HSL in your browser, the model that makes colours easy to adjust.
Convert text to hexadecimal in your browser. Each character becomes its UTF-8 bytes in hex.