Skip to content
MixTool

RGB to HEX converter

Dial in red, green and blue values and get the HEX code instantly — with alpha, contrast and other formats included.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Turn RGB values into a HEX code

Enter red, green and blue values from 0 to 255 — or drag the sliders — and the converter shows the matching HEX code in large type with a copy button. Add an alpha value below 1 to get an 8-digit HEX (like #3b82f6cc) for semi-transparent colors.

The same color is also shown in HSL, OKLCH, HSV, CMYK and decimal, with a live swatch and a WCAG contrast check for white and black text.

How to convert RGB to HEX

  1. 1

    Enter the R, G and B values

    Each from 0 to 255, or use the sliders.

  2. 2

    Set the alpha if needed

    1 is fully opaque.

  3. 3

    Copy the HEX code

    Or any other format below.

Key features

  • Sliders and inputs

    Type exact values or explore visually.

  • Alpha channel

    Outputs 8-digit HEX and rgba().

  • Every format

    HSL, OKLCH, HSV, CMYK and decimal as well.

  • Contrast check

    WCAG ratios for white and black text.

Common uses

  • Design handoff: Convert RGB values from Photoshop or Figma into HEX for CSS.
  • Brand guidelines: Document colors in both formats.
  • Data visualization: Turn RGB palettes into HEX codes for charting tools.

Tips and good to know

  • Each HEX pair is one channel in base 16: 255 is FF and 0 is 00.
  • Starting from a HEX code? Use the HEX to RGB Converter.

Frequently asked questions

How do you convert RGB to HEX by hand?

Convert each channel to a two-digit hexadecimal number and join them: rgb(59, 130, 246) → 3B, 82, F6 → #3B82F6.

Is HEX uppercase or lowercase?

Both are valid in CSS and mean the same color. This tool outputs lowercase, the most common style in code.

What is an 8-digit HEX code?

The last two digits store opacity. #3b82f680 is the same blue at about 50% opacity.