~/rgb-to-hex 200 OK

Last updated: 2026-06-19

RGB to Hex Color Converter

Turn R, G, B values into a hex color code instantly.

An RGB to hex converter turns red, green, and blue channel values (each 0–255) into a six-digit hex color code like #00FF80. Hex color codes are the standard way to specify colors in CSS and HTML. Enter your R, G, and B values below to get the hex code.

How to convert RGB to hex

  1. Enter the Red, Green, and Blue values (each from 0 to 255).
  2. The hex color code appears instantly in the Hex color field.
  3. Use the copy button to paste it into your CSS or design tool.

Worked example: rgb(0, 255, 128)

Each channel is converted to two hex digits: 0 → 00, 255 → ff, 128 → 80. Joined together they form #00ff80.

Reference table

Common colors in RGB and hex
ColorRGBHex
Black0, 0, 0#000000
White255, 255, 255#ffffff
Red255, 0, 0#ff0000
Green0, 128, 0#008000
Blue0, 0, 255#0000ff
Yellow255, 255, 0#ffff00
Orange255, 165, 0#ffa500
Gray128, 128, 128#808080

Frequently asked questions

How do I convert RGB to hex?
Convert each channel (0–255) to a two-digit hexadecimal number, then join them in red-green-blue order with a leading #. This tool does it instantly.
What is rgb(255, 0, 0) in hex?
rgb(255, 0, 0) is #ff0000, which is pure red.
Why are hex color codes six digits?
Each of the three channels (red, green, blue) needs two hex digits to cover the range 0–255, so 3 × 2 = 6 digits.
Can I use hex colors in CSS?
Yes. Hex codes like #00ff80 are a standard color format in CSS and HTML.

Related tools

Learn more