Color Code Converter

Convert HEX, RGB(A), and HSL(A) formats, inspect alpha, and preview the color live.

Color Code Converter

Convert HEX, RGB(A), and HSL(A) color values in one field and inspect the live preview.

Examples: `#1D4ED8`, `rgb(29, 78, 216)`, `hsl(221, 76%, 48%)`

Preview

Valid color
Red
29
Green
78
Blue
216
Alpha
1

Conversions

HEX
#1D4ED8
HEX + alpha
#1D4ED8FF
RGB
rgb(29, 78, 216)
RGBA
rgba(29, 78, 216, 1)
HSL
hsl(224.28, 76.33%, 48.04%)
HSLA
hsla(224.28, 76.33%, 48.04%, 1)

Share this calculation

The link keeps basic share tracking.

What does it do?

The tool parses common CSS color formats such as HEX, RGB(A), and HSL(A), then shows equivalent outputs in one place.

Live preview, alpha display, and copy-ready values make it easier to move colors between design and frontend implementation.

When is it useful?

It helps in design systems, component documentation, theme variables, and quick CSS checks.

When a brand color arrives as HEX but an RGB or HSL token is needed, conversion reduces manual transcription errors.

How formats relate

HEX and RGB express the same sRGB red, green, and blue channels using different notation.

HSL describes hue, saturation, and lightness, which can be easier to reason about during design adjustments.

What alpha means

The alpha component represents opacity and affects how much of the backdrop is visible through the color.

Semi-transparent colors can appear different on different backgrounds, so the preview should also be checked in the target UI.

Quality tips

Color conversion does not decide visual accessibility; contrast ratio needs a separate check.

Choosing one source format for design tokens helps prevent uncontrolled variants of the same color.

Limitations

The tool provides practical conversion for common CSS color formats, not a guarantee for every wide-gamut, device-profile, or color-management scenario.

For critical brand, print, or accessibility work, verify against CSS documentation, the design system, and real device tests.

Official References