Something wrong with this tool?

About RGB To HEX Converter Online

This tool converts RGB color values (rgb(255, 87, 51)) into hexadecimal notation (#FF5733). Most modern color-picker tools output RGB; CSS and many design platforms expect hex — this conversion bridges the gap.

Hex codes are the most common way to specify colors in CSS, in HTML attributes, in JSON theme files, and across the web. They're shorter than RGB strings and slightly more readable once you learn the format.

The converter accepts standard rgb(r, g, b) and modern rgb(r g b / a) syntax. Output is in 6-digit or 8-digit hex (when alpha is present) format, ready to paste into stylesheets or design tools.

How to use this tool

How to convert RGB to a hex color

  1. Two ways to enter the colour

    Either type/paste an RGB string into "RGB code" (e.g. `rgb(255,128,0)` or three numbers like `200 180 90`), or set the R, G, and B sliders directly. A non-empty "RGB code" field overrides the sliders.

  2. Accepted RGB string formats

    The parser handles `rgb(r, g, b)`, `rgba(r, g, b, a)` (alpha is read but discarded for this tool), and bare whitespace-separated triplets like `255 128 0`. Commas and parentheses are optional.

  3. Press Run

    Result returns `r`, `g`, `b` (each integer 0–255), `hex` (the 6-digit `#rrggbb` form), and `rgbCss` (the ready-to-paste `rgb(r, g, b)` string).

  4. Sliders for fine-tuning

    Defaults are 128/128/128 — neutral grey. Use the sliders to nudge channels one step at a time; pair this tool with hex-to-rgb-converter for a round-trip workflow.