💻 Developer Tools

HEX to RGB Converter

Convert HEX colors to RGB or RGB channels back to HEX with a live preview.

Ready to use · Runs in your browser · No signup
Loading tool…

How to use the HEX to RGB Converter

Convert three- or six-digit hexadecimal colors to decimal RGB channels, or enter RGB channels to create a six-digit HEX value.

Convert CSS hexadecimal colors to RGB values and convert RGB channels back to a hex code. A live preview helps catch transposed digits or channels before copying the result.

Input stays in the browser and is not sent to Fieldlet. Do not treat a formatting, encoding, test, or generated value as a substitute for security review.

  1. Choose HEX-to-RGB or RGB-to-HEX mode.
  2. Enter a valid HEX code, 0–255 RGB channels, or use the shared visual color picker.
  3. Fieldlet converts each channel between base 16 and decimal and provides copy-ready output.

Last reviewed for accuracy:

Worked examples

Convert an accent color

Scenario: The CSS color #3366CC is entered.

Result: The RGB value is rgb(51, 102, 204).

Each hexadecimal pair converts to a decimal channel: 33₁₆ = 51, 66₁₆ = 102, and CC₁₆ = 204.

How the result is produced

Six-digit hex stores red, green, and blue as two base-16 digits per channel. Three-digit shorthand duplicates each digit, so #3AC expands to #33AACC.

  • RGB channels range from 0 through 255
  • Two hexadecimal digits represent each full channel
  • Alpha transparency requires an additional channel or compatible notation

Convert in either direction

HEX-to-RGB mode accepts three- or six-digit CSS hexadecimal values. RGB-to-HEX mode clamps each whole-number channel to the 0–255 range and writes two hexadecimal digits per channel, while the shared color picker keeps a visual reference available.

  • Use three-digit HEX only when each channel pair repeats.
  • Keep RGB channels between 0 and 255.
  • Evaluate text contrast separately from color conversion.

Limitations and common mistakes

  • A numeric color conversion does not evaluate contrast or accessibility.
  • Display profiles, transparency, blending, and color spaces can change perceived output.

Common questions

Does this support three-digit HEX codes?

Yes. CSS shorthand such as #3AC expands to #33AACC before the RGB channels are calculated.

Does #fff mean the same as #ffffff?

Yes. Three-digit CSS shorthand duplicates each digit, so #fff expands to #ffffff.