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 —
HSL —

RGB to HEX

HEX —
HSL —

How to use the converter

  1. Type a HEX value (with or without the #) into the HEX field, or
  2. Enter Red, Green, and Blue values from 0 to 255 into the RGB fields.
  3. The other format updates instantly — no button press needed.
  4. 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.

Related tools