⇄

RGB to HEX

Convert rgb to hex using the available input and format options.

Choose a file or fill the fields, then click Run tool.

About RGB to HEX

Design tools and screenshots often give a color as red, green and blue values, but CSS, brand guides and many web builders want a hex code. Web designers and developers use this to turn three RGB channel values into a hex color they can paste directly. It also helps when a client sends RGB values from a print proof and the website theme needs hex.

How it works

You enter R, G and B values. Each is limited to the range 0 to 255, converted to two hexadecimal digits with a leading zero where needed, and joined after a hash sign. The output is lowercase, such as #2563eb. Alpha transparency is not supported. Decimal values are not rounded, so they produce an invalid code. The result appears as text you can copy, and the calculation runs in your browser.

How to use RGB to HEX

  1. Complete the available fields: R, G, B. Use the field labels and examples shown in the workspace.
  2. Select “Run tool” and check the result before copying or downloading it.

Worked example

Enter R 37, G 99, B 235. The tool shows #2563eb. Entering 255, 255, 255 gives #ffffff, and 0, 0, 0 gives #000000. A soft gray of 128, 128, 128 becomes #808080, and pure red 255, 0, 0 becomes #ff0000.

Tips for a better result

  • Use whole numbers only. A value like 12.5 produces a broken hex code because fractions are not rounded.
  • Values above 255 are clamped to 255, so check your input if a color looks too bright.
  • If your design tool gives percentages, multiply by 2.55 and round before entering.

Frequently asked questions

Can I include transparency?

No. Only three channels are accepted, and the output is a six-digit code without alpha.

Does case matter in hex codes?

Browsers treat uppercase and lowercase the same. This tool outputs lowercase.

Does it show a preview?

No. It returns the hex text only. Paste it into a design tool to see the color.

What to check

Some measures vary by region or date and may not have a universal equivalent.

Read the Privacy Policy for information about local processing, connected services and advertising.