HEX ↔ RGB ↔ HSL

All tools

How to convert HEX to RGB or HSL

Compare a design colour with its CSS values. This converts numeric HEX, RGB and HSL, not colour profiles or physical paint.

Steps

Paste the input into the form and choose a mode if one is offered. Check the result before copying or saving it.

Use this tool: HEX ↔ RGB ↔ HSL

Example

#ff0000 → rgb(255, 0, 0)
#00ff00 → hsl(120, 100%, 50%)

What to check

HEX, RGB and HSL express a color in different ways. Check opacity separately: #FF0000 by itself does not specify transparency.

Common tasks and examples

Start with a small sample. Compare the structure before and after a format conversion, or check that only the intended characters changed in a text operation.

  • #fff → rgb(255,255,255)
  • rgb(0,0,255) → #0000ff
  • hsl(0,100%,50%) → #ff0000

Task reference

HEX → RGB
Settings: Input: #fff · What to expect: rgb(255,255,255)
HEX → HSL
Settings: Input: #ff0000 · What to expect: hsl(0,100%,50%)
RGB → HEX
Settings: Input: rgb(0,0,255) · What to expect: #0000ff
RGB → HSL
Settings: Input: rgb(0,255,0) · What to expect: hsl(120,100%,50%)
HSL → RGB / HEX
Settings: Input: hsl(0,100%,50%) · What to expect: rgb(255,0,0) · #ff0000

More tools