Color Converter

Convert colors instantly between HEX, RGB, RGBA, HSL, and HSLA entirely in your browser.

No color yet - type, paste, pick, or generate one

Whether you're pulling a brand color out of a design file, tweaking a CSS variable, or just need to know what #FF5733 looks like in hsl(), this tool converts between every common web color format instantly, without sending anything anywhere.

How it works

Type or paste a color in any supported format, use the native picker, or hit "Random Color" - every other format updates immediately. Conversions run entirely in your browser using the standard CSS Color Module formulas for translating between RGB and HSL; nothing you type is ever transmitted anywhere.

HEX vs RGB vs HSL - what's the difference?

  • HEX (#RRGGBB) packs red, green, and blue into a 6-digit base-16 number. It's compact and easy to copy-paste, and it's the default format in most design tools.
  • RGB describes the same three channels as plain numbers from 0-255 - easier to read and hand-edit, and what most color pickers work with internally.
  • HSL describes a color by hue (position on a color wheel, 0-360°), saturation (how vivid), and lightness (how close to black or white) - much more intuitive for adjusting a color by feel, like "make this darker" or "more vivid," without guessing new numbers.

When to use each format

  • Use HEX for CSS shorthand and copying colors between design apps.
  • Use RGB(A) when you need to read or animate individual channels in code, or need transparency alongside plain numbers.
  • Use HSL(A) when picking or tweaking a color by feel - for example, generating a palette of the same hue at a few different lightness values.

Formula overview

  • HEX → RGB: each pair of hex digits (00-FF) is one channel, read as base 16.
  • RGB → HSL: lightness is the average of the highest and lowest channel; saturation and hue come from how far apart the channels are and which one is largest.
  • HSL → RGB: the reverse - hue determines which channel starts out highest, then saturation and lightness scale it back down.

Common mistakes

  • Mixing up the HSL value order - it's always hue, saturation, lightness, in that order.
  • Forgetting the % signs on saturation/lightness - hsl(9, 100, 60) isn't valid CSS; it needs hsl(9, 100%, 60%).
  • Assuming RGB and RGBA are interchangeable - plain RGB has no alpha channel, so pasting an RGBA color into an RGB-only field drops its transparency.
  • Using out-of-range values, like an alpha above 1 or an RGB channel above 255.

Frequently asked questions

What's the difference between RGB and RGBA?

RGBA is RGB plus a fourth value (alpha) controlling transparency, from 0 (fully transparent) to 1 (fully opaque). Plain RGB is always fully opaque.

Can I convert a HEX color with transparency?

Yes - use an 8-digit hex code (#RRGGBBAA), where the last two digits are the alpha channel. This tool reads and writes that format.

Why does my color look different after converting?

It shouldn't - every format above describes the exact same color, just written differently. If it looks off, double-check you copied the whole string, including the alpha value.

Does this tool store or upload my colors?

No. Every conversion happens in your browser; nothing is ever sent anywhere.

What's the shorthand HEX format (#RGB)?

A 3-digit hex code where each digit is doubled - #f53 is shorthand for #ff5533. It only works when each channel's two hex digits match.

Related tools

Browse the rest of the Graphics & Media tools on NeatSize.

Runs entirely in your browser - nothing you enter or upload is sent to a server.