Image & Design Tools

Hex to RGB & HSL Color Converter

Convert color codes between Hex, RGB, HSL, and CSS color representations with interactive live color preview.

Color Input

#

Converted Formats

Active Color Preview
RGB CSS
rgb(5, 150, 105)
HSL CSS
hsl(161, 93%, 30%)
Red Channel
5
Green Channel
150
Overview

About the Hex to RGB & HSL Color Converter

Web design and software engineering require working with diverse color formats—from 6-digit Hex codes in CSS stylesheets to RGB integer channels in canvas manipulation and HSL degrees for dynamic UI theming.

Our Hex to RGB Converter translates any color input into clean, copy-paste-ready Hex, RGB, RGBA, HSL, and CMYK color strings.

Mathematical Method

How the Calculations Work

Hexadecimal pairs (00-FF) translate into 8-bit integers (0-255) for Red, Green, and Blue channels.

R = Hex(1,2), G = Hex(3,4), B = Hex(5,6)

Variables & Definitions

  • Hex: #RRGGBB base-16 string
  • RGB: rgb(r, g, b) base-10 integers 0-255
Plain-English Worked Example

#059669 converts to Red = 5, Green = 150, Blue = 105 -> rgb(5, 150, 105).

Terminology

Key Terms Explained

Hex Color

A six-digit hexadecimal representation of RGB values preceded by a pound sign.

HSL

Hue (degrees on the color wheel), Saturation (%), and Lightness (%).

Best Practices

Practical Tips & Pitfalls to Avoid

1

Use CSS variables

Store RGB channel integers as variables to easily declare semi-transparent colors via rgba(var(--rgb), 0.5).

Q&A

Frequently Asked Questions

Take each 2-digit hex pair and convert from base 16 to decimal: (First digit * 16) + Second digit.

Calculator Directory
Categories 60 Tools