HEX to RGB Converter

Convert HEX color codes to RGB and HSL — live preview as you type

HEX Color
#
HEX
RGB
HSL
Reverse: RGB to HEX

Free Online HEX to RGB Converter

Convert any HEX color code to RGB and HSL values instantly with our free online HEX to RGB converter. The live color preview swatch updates as you type, so you can see your color in real time. All conversion is 100% client-side — your data never leaves your browser.

How to Use

  1. Type or paste a HEX color code in the input field (e.g., #FF5733 or FF5733)
  2. The color preview swatch updates instantly, showing your color
  3. Copy HEX, RGB, or HSL values individually with one click
  4. Use the RGB to HEX section to convert from RGB back to HEX
  5. All formatting uses the standard 6-character HEX format (e.g., #1A2B3C)

Features

HEX Color Codes Explained

A HEX color code is a 6-character hexadecimal representation of a color, prefixed with #. Each pair of characters represents the intensity of one of the three RGB color channels:

HEX to RGB Example

HEX color input:

#FF5733

RGB output:

rgb(255, 87, 51)

Common Colors Reference

RGB vs HEX: What's the Difference?

RGB (Red, Green, Blue) represents colors as three numbers between 0 and 255, indicating how much of each primary color to mix. It's the native format for CSS and many design tools.

HEX (Hexadecimal) is a compact string representation using base-16 numbers. It encodes the same RGB values but in a single string: #RRGGBB. HEX is commonly used in design systems, CSS, and as a compact color identifier.

Both formats represent the same color. This tool converts between them instantly, so you can use whichever format your project requires.

What is HSL?

HSL (Hue, Saturation, Lightness) represents colors using three values:

HSL is often easier to work with for design because adjusting saturation or lightness is more intuitive than tweaking RGB values. Many CSS variable systems use HSL for theming.

Frequently Asked Questions

What is a HEX color code?
A HEX color code is a 6-character hexadecimal string prefixed with # that represents an RGB color. Each pair of characters (00–FF) represents the intensity of red, green, and blue. For example, #FF5733 means red=255, green=87, blue=51.
How do I convert HEX to RGB?
Type your HEX color code in the input field above. This tool converts it to RGB and HSL instantly and shows a live color preview. No button press needed — conversion happens as you type.
Can I use short-form HEX codes like #FFF?
Yes. Short-form HEX codes like #FFF or #ABC are automatically expanded to their full 6-character form (#FFFFFF and #AABBCC respectively) before conversion.
Is this tool free to use?
Yes, completely free. All conversion happens in your browser using JavaScript — your input is never sent to any server. Works offline too.
What's the difference between RGB and HEX?
RGB and HEX represent the same color information differently. RGB uses three numbers (0–255) for red, green, and blue. HEX uses a single 6-character string (#RRGGBB) in base-16. RGB is more human-readable; HEX is more compact and commonly used in CSS and design tools.