RGB-Hex Converter

Switch between RGB and Hex color codes instantly, copy either result and view a live preview of the shade.

RGB to Hex

Enter red, green and blue channel values (0–255) to generate the matching Hex code.

Each channel must be a whole number between 0 and 255.

Hex to RGB

Paste a 3- or 6-digit Hex color to see the RGB representation.

Use #RRGGBB or #RGB format. Letters are case-insensitive.

What this tool does

This converter changes RGB channels into a Hex color code and converts Hex values back to RGB. A live preview displays the calculated color in the browser.

How to use the tool

  1. Enter the red, green, and blue channels or provide a Hex color code.
  2. Review the automatically calculated counterpart and the preview.
  3. Copy the RGB or Hex value for CSS, design work, or documentation.

Useful applications

  • Moving colors from a design application into CSS or HTML.
  • Splitting a Hex value into RGB channels for technical calculations.
  • Preparing color values for contrast or accessibility checks.

Notes and limitations

  • RGB channels are handled as values from 0 to 255, and the Hex input must use the format accepted by the tool.
  • The preview is a screen representation and not a color-accurate proof.

Frequently asked questions

What is a Hex color code used for?

A Hex code is a compact representation of RGB values and is commonly used in CSS, HTML, and design systems.