Color Converter

Convert colors between HEX, RGB and HSL formats instantly for web design and CSS. No signup. Ideal for designers and developers working with color codes.

Remove Ads
Remove Ads

Result

HEX
RGB
HSL
Remove Ads

Share on Social Media:

A color converter translates a color between the HEX, RGB and HSL formats — free, with no account. Paste a HEX code or RGB values, click Convert, and get the same color in all three formats, with a preview swatch so you can confirm it is the color you meant. Everything runs in your browser: nothing is uploaded or stored.

On this page

  1. How to Convert a Color Step by Step
  2. What HEX, RGB and HSL Are
  3. When to Use Each Color Format
  4. Who Uses a Color Converter
  5. Pro Tips for Working With Color Formats
  6. Common Color Conversion Mistakes to Avoid
  7. Related Tools You May Need Next
  8. Frequently Asked Questions

How to Convert a Color Step by Step

  1. Type or paste your color into the input box — a HEX code such as #3498db (the # is optional, and 3-digit codes such as #fff work too) or RGB values such as 52, 152, 219.
  2. Click Convert. The tool shows the same color as HEX, RGB and HSL, plus a preview swatch.
  3. Check the swatch. It shows the actual color, so you can confirm it is the one you intended before you copy anything.
  4. Click the Copy button next to the format you need — HEX for a quick CSS value, RGB for working with the channels, or HSL for adjusting the color.
  5. Use the code in your stylesheet, design tool or wherever you specify colors. Do not paste an HSL value into the input: HSL is output only — the tool accepts HEX or RGB input only.

Colour picker with RGB sliders set to 32, 178 and 170, a teal swatch and a hex field showing #20B2AA

What HEX, RGB and HSL Are

There are several standard ways to represent a color in digital design, and the three most common are HEX, RGB and HSL. They all describe the same colors but in different notations, each with its own strengths.

HEX is a compact six-character code: a hash followed by three pairs of hexadecimal digits for the red, green and blue values. It is widely used in CSS for its brevity — #3498db is easier to paste into a stylesheet than three separate numbers.

RGB expresses the same three components as decimal numbers from 0 to 255. Some find it more readable, and it is convenient when you want to work with the individual channel values directly — for example, raising the red channel alone.

HSL describes a color by its hue (0–360 degrees around the color wheel), saturation and lightness (both percents). It is a more intuitive approach for adjusting colors: shift the hue to change the color family, raise saturation to make it more vivid, or lower lightness to darken it, without touching the other two.

Worked examples — every one checked against the tool:

You typeHEXRGBHSL
#3498db#3498DBrgb(52, 152, 219)hsl(204, 70%, 53%)
#ff0000#FF0000rgb(255, 0, 0)hsl(0, 100%, 50%)
#fff#FFFFFFrgb(255, 255, 255)hsl(0, 0%, 100%)
#000000#000000rgb(0, 0, 0)hsl(0, 0%, 0%)
52, 152, 219#3498DBrgb(52, 152, 219)hsl(204, 70%, 53%)
abc#AABBCCrgb(170, 187, 204)hsl(210, 25%, 73%)

The HEX output is always uppercase, and the HSL hue, saturation and lightness are rounded to whole numbers. The HEX and RGB lines are exact; only the HSL line is rounded.

When to Use Each Color Format

FormatBest forStrengthWatch out for
HEXFixed color values in CSSCompact, copy-paste friendlyHard to read the channels at a glance
RGBWorking with light channels, rgba opacityChannels are plain decimal numbersLonger than HEX in a stylesheet
HSLAdjusting a color — lighter, darker, more vividIntuitive: hue, saturation, lightnessRounded to whole numbers here, so not exact

The tool outputs all three formats every time, so you do not have to choose before converting — paste the color once, then pick the line your task needs. A designer who has a color in one format but needs it in another converts it in one click, with a preview to confirm the color.

Who Uses a Color Converter

Web designers and developers. A developer has a brand color as a HEX code but the design tool wants RGB — or the reverse — and converts it without retyping three numbers.

UI designers. A designer matches a color from a mockup to code, checking the swatch to be sure the converted value is the same color they saw on screen.

Anyone moving colors between tools. A color copied from one tool often arrives in the wrong format for the next one. The converter translates it so it can be pasted straight in.

Students learning digital color. A student types a color in one format and sees the same color in the others, learning how HEX, RGB and HSL relate.

Pro Tips for Working With Color Formats

The # is optional. 3498db works just as well as #3498db — paste the code however you copied it.

3-digit HEX expands by doubling each digit. abc becomes #AABBCC, and fff becomes #FFFFFF. Short codes are handy for greys and whites.

RGB values can be typed with commas, spaces or the rgb(...) wrapper. The tool reads the three numbers either way, so paste them in whatever form you have.

Always check the swatch before copying. It shows the actual color — a quick glance catches a mistyped digit that similar blues and greys would otherwise hide.

Use the HEX or RGB line when exactness matters. The HSL line is rounded to whole numbers, so it can be off by a little; HEX and RGB are exact.

Keep one format as your source of truth per project. Converting back and forth between formats can introduce tiny rounding differences, so store the color once and convert from that copy.

Common Color Conversion Mistakes to Avoid

Pasting an HSL value into the input. HSL is output only. The tool accepts HEX or RGB input — paste the HEX code or the three RGB numbers instead.

Typing a color name such as "red". The tool only accepts HEX or RGB numbers. A name shows an error toast; use the code for that color instead.

Using RGB values above 255. Each channel must be 0 to 255. A value such as 300 is rejected with an error toast.

Assuming the result appears as you type. It does not. You must click Convert — typing alone converts nothing.

Copying the rounded HSL line and expecting the exact original HEX back. Rounding can shift a channel by 1, so a round trip through HSL may not return the identical HEX code. Copy the HEX line when you need the exact color.

Expecting an alpha or transparency value. The tool has no alpha support — it converts opaque colors only, with no CMYK, no color names and no 8-digit HEX.

Related Tools You May Need Next

Color Contrast Checker. Check text against a background for readability.

Random Hex Color Generator. Pick a brand-new color.

CSS Gradient Generator. Build a blend between two colors.

3D illustration of colour tools with a colour wheel, sliders and swatches

Frequently Asked Questions

How do I convert a color between formats?

Type or paste a HEX code such as #3498db, or RGB values such as 52, 152, 219, and click Convert. The tool shows the same color as HEX, RGB and HSL, plus a preview swatch. Copy the format you need.

What formats can I paste into the tool?

HEX or RGB only. HEX works with or without the # and in 3-digit or 6-digit form (#fff, fff, #3498db, 3498db). RGB works as three numbers separated by commas, spaces or the rgb(...) wrapper. Each RGB value must be 0 to 255.

Can I paste an HSL value to convert it?

No — HSL is output only on this tool. If you paste an HSL value, the tool will not recognise it as HSL and will give you a wrong color. Convert from the HEX or RGB numbers instead.

What are HEX, RGB and HSL?

They are three standard ways to represent a color digitally. HEX is a compact six-character code, a hash followed by hexadecimal digits for the red, green and blue components, common in CSS. RGB expresses the same red, green and blue components as decimal numbers from 0 to 255. HSL describes a color by its hue, saturation and lightness, a more intuitive approach for adjusting colors.

When should I use each color format?

Use HEX for compact, fixed color values in CSS, where its brevity and ubiquity make it the default. Use RGB when you want to work with the individual light channels, or with opacity in rgba. Use HSL when you want to adjust a color — make it lighter, darker or more vivid — without touching the other properties.

Why is HSL good for adjusting colors?

Because its three values match how people think about color: hue is the color family, saturation is how vivid it is, and lightness is how light or dark it is. Changing one does not disturb the others, so a small tweak does what you expect.

Do HEX and RGB describe colors the same way?

Yes. Both describe a color by its red, green and blue components — HEX in hexadecimal pairs, RGB in decimal numbers. #3498DB and rgb(52, 152, 219) are the same color in two notations.

Will converting a color change it slightly?

Between HEX and RGB, no — the conversion is exact. The HSL line is rounded to whole degrees and percents, so converting back from HSL can shift a channel by 1. Use the HEX or RGB line when you need the exact color.

Can I convert a color name like "red"?

No. The tool only accepts HEX codes or RGB numbers. A color name shows an error message. Look up the HEX or RGB code for the color and paste that instead.

Is the color converter free?

Yes, it is completely free with no account and no usage limit. It runs entirely in your browser, so your color is never uploaded or stored.