HEX ↔ RGB Converter
Convert a HEX color code to RGB, or three RGB channel values to a HEX code. Both sides update instantly as you type, with HSL shown alongside for reference.
HEX to RGB
RGB to HEX
How to use the converter
- Type a HEX value (with or without the #) into the HEX field, or
- Enter Red, Green, and Blue values from 0 to 255 into the RGB fields.
- The other format updates instantly — no button press needed.
- Copy any value with the copy icon next to it.
What the output means
HEX is the six-digit code used throughout CSS and design tools (e.g. #5B4CF0). RGB describes the same color as three 0–255 channel values for red, green, and blue. HSL — shown as a secondary output — describes hue (0–360°), saturation, and lightness, which is often more intuitive when adjusting a color by feel.
Common use cases
Paste a HEX value from a design file to get its RGB equivalent for canvas or shader code, or convert RGB values from an image-editing tool back into a HEX code for your stylesheet.
Frequently asked questions
What HEX formats are accepted?
Six-character HEX with or without a leading #, and three-character shorthand like #FFF, which is automatically expanded to six characters.
What happens if I enter an out-of-range RGB value?
Values below 0 or above 255 are flagged with an inline error and the conversion pauses until you enter a valid number.
Does the converter store anything I type?
No. Conversion happens instantly in your browser and nothing you enter is saved or transmitted.