Color Converter

Convert between HEX, RGB, and HSL color values with an immediate preview.

How to use

These are example steps; replace the values for your task.

  1. Enter one color code.
  2. Check the HEX, RGB and HSL values and the preview.
  3. Use a notation accepted by the destination.

Enter values

Converted color

—

Match one screen color across CSS formats

Paste a HEX, RGB, or HSL value to see equivalent numeric formats beside the preview. This is useful when a design file provides HEX but a stylesheet or animation uses RGB or HSL.

Alpha is preserved when supplied through four- or eight-digit HEX, rgba(), or hsla(). Named colors and CMYK are not converted.

About this tool

Enter values such as #ff0000, rgb(255, 0, 0), or hsl(0, 100%, 50%) and see all three formats. Short HEX and alpha values are supported.

Named colors and every CSS Color 4 syntax are outside this tool's scope. Use the displayed numeric values for reliable comparison.

Continue this task

Try a use case and check the result

Use a translucent short HEX value and HSL blue to compare color components and alpha notation.

Example buttons replace the inputs and settings above and calculate. Restore previous input steps back one example at a time. After trying multiple examples, repeat restore to return to your original input. This history is lost when the page closes.

The last digit of four-digit HEX is alpha

Input and settings

Color: #0f08

Expected result

HEX: #00ff0088
RGBA: rgba(0, 255, 0, 0.533)
HSLA: hsla(120, 100%, 50%, 0.533)

HSL hue 240° produces blue

Input and settings

Color: hsl(240, 100%, 50%)

Expected result

HEX: #0000ff / RGB: rgb(0, 0, 255)
HSL: hsl(240, 100%, 50%)

How to read the result

Short HEX repeats each digit, so #0f08 expands to #00ff0088. Alpha 88 is opacity 136/255, displayed as 0.533. HSL lightness 50% does not mean every RGB component is half its maximum. A translucent color’s appearance also depends on the background underneath.

Scope and limits

Supported forms are 3/4/6/8-digit HEX and comma-separated RGB(A)/HSL(A). Color names, modern space-separated CSS, OKLCH, CMYK and print color management are unsupported. Some values are clamped, so this is not strict CSS validation. RGB rounds to integers, HSL to two decimals and alpha to three; conversions are not fully lossless.

Verification: independent checks cover repeated HEX digits, 136/255 and an HSL primary color. Browser checks compare all three formats, the preview and original-input restoration.

Continue with the next task

Check the same red in three formats

Example input

#ff000080

Result

#ff000080
rgba(255, 0, 0, 0.502)
hsla(0, 100%, 50%, 0.502)

Displayed alpha values are rounded. When converting eight-digit HEX, check the alpha number as well as the preview.

Alpha 80 does not mean 80 percent

The final 80 is hexadecimal 128. Dividing 128 by 255 gives an alpha of about 0.502. CSS alpha is 0 for transparent and 1 for opaque. The background affects the appearance, so contrast also requires a background color.

Frequently asked questions

Is alpha supported?

Yes. Four- and eight-digit HEX, rgba, and hsla are supported.

Is the color saved?

No. Input is not stored.

Can it convert to CMYK?

No. This tool focuses on screen colors in the RGB family.

Related tools

Inputs and storage

Keep any content you need before clearing. This tool does not autosave inputs or results. Reloading or closing the page, clearing inputs or resetting may discard your work.

Favorites and language preferences are stored separately and may be lost when site data is cleared. Tool resets and site-data deletion do not delete files already downloaded to your device.

Explore tools & games

All 120 tools · 16 games

All 120 tools · 16 games

Text & writing 26

Calculators & converters 22

Date & time 12

Images & PDF 26

Data & web 28

Random & handy 6

Games 16