RGB to HEX Color Converter

Convert RGB to HEX instantly — free, in your browser.

Processed locally — files never leave your device

Type the red, green and blue values (0–255 each), or use the color picker. The result updates as you type.

Works offline once loaded Uploaded: 0 bytes

A HEX code is just three RGB channels written in base 16: each channel becomes two hexadecimal digits, joined after a # sign. This free converter gives you the exact RGB to HEX values instantly, with a live swatch so you can see the color as you type — no tables to look up, no guessing.

It runs entirely in your browser, so nothing is uploaded and it works offline once the page loads. Designers use it to translate brand colors between tools: copy a HEX from a style guide, get the RGB for CSS, the HSL for a color picker, or the CMYK for print. For image work, pair it with the Image Compressor or the Background Remover.

How to use

  1. Type or paste your RGB color value into the box above — or pick a color with the color picker.
  2. The result updates live, with a swatch showing the exact color.
  3. Check the breakdown: every channel is shown separately.
  4. Press Copy to copy the converted value for your CSS, design tool or print file.

Why use Toolsvine

RGB is how screens store color, and HEX is how the web writes it — the same three numbers, one in decimal and one in base 16. Translating by hand means dividing by 16 and remembering that 10 is A, 11 is B and 15 is F, and one slip turns a forest green into a swamp brown. A converter that runs locally, shows the swatch live and copies the answer in one click turns a chore into a second — free, with no account and no upload.

How does the RGB to HEX conversion work?

Take each channel — red, green and blue, each from 0 to 255 — and write it as a two-digit hexadecimal number (0–9 then A–F), padding with a leading zero when the value is below 16. Then join them after a # sign: #RRGGBB.

So 255 becomes FF, 165 becomes A5, and 0 becomes 00. Hexadecimal is base 16, so each digit is worth sixteen times the next: a channel of 165 is 10 × 16 + 5, which is A5. Channels below 16 need the leading zero — 5 becomes 05, not 5 — so the code always has exactly six digits after the # sign.

Worked example: forest green rgb(34, 139, 34)

Forest green rgb(34, 139, 34) is #228B22. Each channel converts separately: 34 is 22 in hexadecimal, 139 is 8B and 34 is 22 again, so the three pairs join as #228B22. The converter shows the same result with a live swatch, so you can check the green against your design before you copy it.

RGB to HEX worked example showing forest green rgb 34 139 34 converted to hex code 228B22
rgb(34, 139, 34) converts to #228B22 — 34 is 22, 139 is 8B.

Common colors

ColorValue
rgb(255, 0, 0)#FF0000
rgb(0, 255, 0)#00FF00
rgb(0, 0, 255)#0000FF
rgb(255, 165, 0)#FFA500
rgb(128, 128, 128)#808080

Values are rounded for display: RGB channels are whole numbers from 0 to 255, HSL and HSV use degrees and percentages, and OKLCH lightness runs from 0 to 1. The converter itself keeps full precision and only rounds what it shows you.

When do I need HEX instead of RGB?

Use HEX when a tool asks for a six-digit code: brand guides, design tokens, Figma fills and most color inputs on the web all expect #RRGGBB. RGB is clearer when you are editing channels by hand or adding opacity with rgba(). The two notations name the same color, so pick whichever the tool in front of you accepts.

Design tools like Figma and Canva accept HEX in their color fields, and CSS accepts both. For the reverse trip, the HEX to RGB Color Converter turns a six-digit code back into channel values.

Frequently asked questions

How do I convert RGB to HEX?

Type the value in the box above — the result appears instantly, with a swatch showing the exact color. Press Copy to use it in your CSS or design file. The converter accepts rgb(34, 139, 34) or plain 34, 139, 34, and it pads any channel below 16 with a leading zero automatically.

Is my color data uploaded anywhere?

No. The conversion runs in your browser with JavaScript. Nothing leaves your device, and the page works offline after it loads. Your brand colors and client palettes never leave your computer, which is the whole point of a local converter.

Why do the same colors have different values in different tools?

Every color model describes the same color differently: HEX and RGB store red, green and blue amounts; HSL stores hue, saturation and lightness; CMYK stores ink. They are translations, not different colors. The swatch never changes — only the numbers that describe it do.

How do I convert RGB to HEX by hand?

Divide each channel by 16: the quotient is the first hex digit and the remainder is the second, with 10–15 written as A–F. For 139, 139 ÷ 16 = 8 remainder 11, which is 8B. Values below 16 get a leading zero — 5 becomes 05, not 5 — so the code always has six digits after the #.

Can I use the result in CSS?

Yes — copy the value straight into your stylesheet. Modern browsers accept rgb(), hsl() and oklch() directly, and HEX works everywhere. HEX is the shortest form for a solid color, so it is the usual choice for design tokens, variables and brand guides.