🌈

HEX ↔ RGB Converter

Convert HEX to RGB or RGB to HEX instantly

⚡ Instant & free🔒 Runs in browser100% private
Loading tool…

About HEX ↔ RGB Converter

HEX and RGB are the two most common color code formats in web development. CSS accepts both, but APIs, design tools and frameworks often require one specific format. This free HEX to RGB Converter instantly converts any HEX color code to its RGB equivalent and vice versa. Supports full 6-digit HEX codes and 3-digit shorthand codes, with one-click copy for each value.

How to Use HEX ↔ RGB Converter

  1. 1To convert HEX to RGB: enter a hex color code (with or without #) in the HEX field.
  2. 2To convert RGB to HEX: enter the red, green and blue values (0–255) in the RGB fields.
  3. 3The converted values appear instantly.
  4. 4Click "Copy" next to any value to copy it to your clipboard.

Common Use Cases

CSS color value conversionDesign tool format switchingReact Native color valuesCanvas API color inputPython color librariesSVG fill/stroke attributes
💡
Pro Tip

HEX colors are shorthand (6 hex digits) — #FF5733 = RGB(255, 87, 51). Some tools use 0–1 range for RGB (e.g. Three.js) — divide each value by 255.

⭐ Popular Free Tools

Frequently Asked Questions

How do I convert HEX to RGB manually?

Split the 6-digit HEX code into 3 pairs and convert each pair from hexadecimal to decimal. For #FF5733: FF = 255, 57 = 87, 33 = 51, giving RGB(255, 87, 51). Each hex digit represents 0-15, so "FF" = 15×16 + 15 = 255.

What is a 3-digit HEX color code?

A 3-digit HEX code is shorthand for 6-digit codes where each pair of digits is identical. #FFF is shorthand for #FFFFFF (white), #000 for #000000 (black), #F60 for #FF6600. CSS accepts both 3-digit and 6-digit HEX codes.

What is RGBA and how is it different from RGB?

RGBA adds a fourth channel — Alpha — for transparency. Alpha values range from 0 (fully transparent) to 1 (fully opaque). CSS syntax: rgba(255, 87, 51, 0.5) creates a semi-transparent color. Modern CSS also supports 8-digit HEX codes with alpha: #FF573380 (the last two digits are the alpha).