RGB to HEX Converter

Turn rgb() values into hex colour codes. Paste one colour or a list, and get 6-digit or shortened codes.

Processed on your device. Files are not uploaded

How to convert RGB to hex

  1. Paste your RGB colours

    Paste or type it into the box, or press Try an example.

  2. Pick the options

    Capital letters, or shortened codes like #fff.

  3. Copy or download

    Paste the codes into your CSS.

Worked example

This is what RGB to HEX Converter gives for its own sample values. Open the tool above and change anything to try your own.

RGB colours, one per line

rgb(15, 118, 110)
255 255 255
rgba(255, 153, 0, 0.5)
15,23,42
Capital letters (#0F766E)
No
Shorten when possible (#ffffff to #fff)
No

Hex colours

#0f766e
#ffffff
#ff990080
#0f172a

About RGB to HEX Converter

Turn RGB values into hex colour codes. Write rgb(15, 118, 110), just the three numbers, or a list with one colour per line. Colours with transparency become eight-digit hex.

FAQs

Do I need to write rgb()?

No. Plain numbers such as 15, 118, 110 or 15 118 110 work too.

When can a hex code be shortened?

When each pair repeats, such as #ffffff, which becomes #fff.

Can I go the other way?

Use HEX to RGB Converter.

Related tools