Skip to main content

RGB to HEX Converter

Convert RGB color values to HEX codes and back — with a live color preview. The standard tool for web design and CSS development.

Reviewed October 7, 2026 Runs in your browser — inputs are never stored

HEX code

#3B82F6

This tool provides general unit conversions for everyday and educational use. For regulated, legal, or scientific applications, verify conversion factors against the applicable official standard.

About the RGB to HEX Converter

The RGB to HEX converter turns red, green and blue values from 0 to 255 into a six-digit hex colour code and back. Each channel becomes two hex digits, so rgb(255, 255, 255) is #FFFFFF. A live preview shows the colour as you type.

How to use it

  1. 1Choose RGB → HEX or HEX → RGB.
  2. 2Enter the red, green and blue values (or the hex code).
  3. 3Read the result and check the preview.
  4. 4Copy, share or print the result with the buttons below it.

Worked example

rgb(59, 130, 246) → 59 = 3B, 130 = 82, 246 = F6 → #3B82F6.

How it works

Formula

Each RGB channel (0–255) converts to 2 hex digits. R=255 → FF; R=0 → 00. Combine as #RRGGBB.

Common use cases

  • Converting colours from design tools to CSS
  • Matching brand colours
  • Programming graphics

Frequently asked questions

A:rgb(255,0,0) = #FF0000 (red).

Reviewed for accuracy · Last updated October 7, 2026

Conversion factors are based on internationally defined SI units and standard metric/imperial equivalence tables.

CW

CalcWisee Editorial Team

Calculator development and formula review

CalcWisee is an independent site founded by Ayman. Every calculator is built from a published formula or official definition, tested against hand-worked examples before it goes live, and corrected promptly when a reader reports an issue to ayman@calcwisee.com.

Expertise: Financial mathematics, Health and fitness formulas, Applied mathematics, Unit conversion standards