← All tools

Design & developer tools · Runs in your browser

HEX, RGB & HSL Color Converter

Convert common web color formats and preview the result instantly. All calculations run locally in your browser.

Enter a supported color value to convert.

HEX

—

RGB

—

HSL

—

Understand HEX, RGB, and HSL color values

Web colors are often written in several interchangeable formats. HEX expresses red, green, and blue channels as hexadecimal pairs, as in #818cf8. Each pair ranges from 00 to ff, or zero to 255 in decimal. The shortened three-digit form, such as #3af, is a shorthand for repeating each digit and is expanded to #33aaff. HEX is compact and common in stylesheets, design systems, and asset specifications.

RGB describes the same additive red, green, and blue channels using decimal numbers. For example, rgb(45, 212, 191) represents the same turquoise as #818cf8. HSL describes a color by its hue, saturation, and lightness: hue is an angle around a color wheel, while saturation and lightness are percentages. HSL can be easier to reason about when creating hover shades, muted tones, or consistent palettes because hue is separated from vividness and brightness.

How to convert a color

Type a three- or six-digit HEX value, an RGB value such as rgb(45, 212, 191), or a comma-separated HSL value such as hsl(174, 65%, 50%). The leading hash on HEX is optional. Choose Convert color or press Enter to display all three representations and a preview. You can also use the native color picker, which updates the text field and converted values immediately. Each output has its own Copy button, which places just that format on the clipboard.

The converter checks that RGB channels are whole numbers from 0 through 255 and that HSL percentages are between 0 and 100. Hue values range from 0 through 360 degrees. Empty, malformed, unsupported, or overly long input receives an explanatory message; it is not guessed or silently corrected. HSL values are rounded for readable display, so repeatedly converting rounded outputs can create a small difference in the last channel.

Common uses and accessible color decisions

Developers use color conversion when translating a design file into CSS, comparing existing theme tokens, tuning a palette, or communicating a color to a teammate who uses another format. Designers can use HSL to make small lightness adjustments while keeping the approximate hue. RGB and HEX values are convenient when pasting colors into a stylesheet, a graphics program, or a component configuration. The preview is a quick visual check, but it does not replace testing the actual interface in context.

Color alone should not be the only way important information is conveyed. Check text contrast against its real background, include labels or icons where needed, and test interactive states. This page performs conversion only; it does not estimate accessibility contrast or manage alpha transparency. All parsing, calculation, and preview updates happen locally, with no external API calls or upload. Continue your workflow with the CSS Box Shadow Generator, CSS Minifier, or SVG Formatter.

Frequently asked questions

Which color formats does this converter support?

It converts six- or three-digit HEX values, integer RGB values, and comma-separated HSL values with percentage saturation and lightness.

Can I enter a color without the hash sign?

Yes. Both #3b82f6 and 3b82f6 are accepted as HEX input. Short three-digit HEX values are expanded before conversion.

Are the displayed RGB and HSL values exact?

RGB channels are whole numbers from 0 to 255. HSL values are rounded for readability, so converting a rounded result back can differ by a small amount.

Does the converter upload or save my color input?

No. Parsing and conversion happen in your browser. The tool makes no external API calls and does not save your input.