Peregrine falcon logoPeregrine Dev

Hex to RGB Converter — Color Code Converter

Convert between hex and RGB color formats in real time. Preview colors and copy values instantly.

Hex to RGB

RGB
rgb(255, 87, 51)
RGBA
rgba(255, 87, 51, 1)
HSL
hsl(11, 100%, 60%)
HSLA
hsla(11, 100%, 60%, 1)

RGB to Hex

Hex
#FF5733

How to hex to rgb

  1. 1Enter a hex color code (e.g. #FF5733) in the hex input field
  2. 2View the converted RGB, RGBA, HSL, and HSLA values in real time
  3. 3Use the RGB inputs to convert in the reverse direction (RGB to hex)
  4. 4Click any copy button to copy a value to your clipboard

About This Tool

Converting between hex and RGB color codes is one of the most common tasks in front-end development and design. Hex codes are compact and widely used in CSS, while RGB values are often needed for JavaScript, design tools, and accessibility calculations. This converter handles both directions instantly.

In addition to RGB, the tool converts to RGBA (with adjustable alpha), HSL, and HSLA formats. HSL is particularly useful for designers because it maps directly to human perception of hue, saturation, and lightness, making it easier to create harmonious color palettes.

All processing happens entirely in your browser. No color data is sent to any server. The live preview swatch updates as you type, so you can visually confirm the color before copying the value into your code.

Frequently Asked Questions

No. The tool automatically adds the # prefix if you omit it. You can type FF5733 or #FF5733 and both will work.

The tool supports 3-character shorthand (e.g. #F00), 6-character standard (e.g. #FF0000), and 8-character hex with alpha (e.g. #FF0000FF). Shorthand values are automatically expanded.

HSL values are calculated from the RGB components using the standard conversion algorithm. Hue is expressed in degrees (0-360), while saturation and lightness are percentages (0-100%).

Yes. If you enter an 8-character hex code, the alpha channel is extracted and applied to the RGBA and HSLA outputs. You can also manually adjust the alpha slider.

Related Tools