Home Color to HEX

Color to HEX

Pick a color or enter RGB values and get the HEX code instantly — 100% in your browser.

Input

Output

What is a HEX color?

A HEX color is a way of representing a color using a hexadecimal (base-16) notation, most commonly seen in web design and CSS. A HEX code starts with a hash symbol # followed by six digits, where the first two digits represent the red component, the middle two the green, and the last two the blue — for example, #0EA5E9 is a sky blue made of red 14, green 165 and blue 233. Each pair ranges from 00 (0 in decimal) to FF (255 in decimal), giving over 16.7 million possible colors.

The HEX format was introduced alongside HTML and CSS as a compact, human-readable way to specify RGB colors. It is supported by every browser, design tool and image editor, making it the lingua franca of digital color. A three-digit shorthand (e.g. #0E9) is also valid and expands to #00EE99 by doubling each digit.

When to use HEX colors

HEX is the most widely used color format in web development and digital design. Common scenarios include:

  • CSS styling. color, background, border-color and other properties accept HEX values directly.
  • Design systems. Brand palettes and theme tokens are typically defined in HEX for consistency across teams.
  • Image editing. Photoshop, Figma and Sketch all display and accept HEX codes in their color pickers.
  • Accessibility audits. Contrast checkers and WCAG tools expect HEX inputs when evaluating color pairs.
  • Marketing assets. Email templates, social media graphics and PDF generators use HEX to ensure brand-accurate colors.
  • Sharing colors. A HEX code is the shortest, most unambiguous way to communicate a specific color to another person.

Although CSS now also supports rgb(), hsl() and oklch(), HEX remains the default in most codebases because of its brevity and universal support.

HEX vs RGB vs HSL

HEX, RGB and HSL are three ways of describing the same color. HEX encodes the red, green and blue channels as hexadecimal pairs. RGB expresses the same channels as decimal numbers from 0 to 255, optionally with an alpha channel (e.g. rgba(14, 165, 233, 0.5)). HSL describes a color by its hue (angle on the color wheel), saturation and lightness, which is often more intuitive for designers because it maps to how humans perceive color.

HEX and RGB are mathematically equivalent and trivially convertible. HSL requires a conversion through the RGB color space but is invaluable when you need to create shades, tints or harmonious palettes, because adjusting the lightness or saturation produces visually consistent variations.

Common HEX colors

The table below lists frequently used HEX colors and their RGB equivalents.

NameHEXRGB
Black#0000000, 0, 0
White#FFFFFF255, 255, 255
Red#FF0000255, 0, 0
Green#00FF000, 255, 0
Blue#0000FF0, 0, 255
Sky Blue#0EA5E914, 165, 233
Yellow#FFFF00255, 255, 0

Brand colors are usually distributed as HEX codes in style guides so that developers, designers and printers all reference the exact same value.

How to convert a color to HEX

Converting a color with this tool takes only a second and happens entirely inside your browser. No upload, no sign-up, and no installation are required. Follow these steps:

  1. Pick a color. Use the color picker, or type red, green and blue values (0–255) into the RGB inputs.
  2. See the result. The HEX code updates in real time in the output box, and the preview swatch shows the current color.
  3. Copy the HEX. Click "Copy HEX" to copy the value, then paste it into your CSS, design tool or documentation.

Because every step runs locally in your browser using JavaScript, your color choices are never uploaded to a server. This makes the conversion completely private and instant.

Is this Color to HEX converter free?

Yes, completely free with no sign-up, no watermarks and no limits.

Does it support 3-digit shorthand?

The output always uses the full 6-digit form for maximum compatibility, but you can shorten it manually where valid.

Can I enter RGB values?

Yes. Type red, green and blue values (0–255) into the R, G, B inputs and the HEX code updates instantly.

Is there an alpha channel?

This tool outputs the 6-digit RGB HEX. For transparency, prepend an 8-digit form (e.g. #0EA5E980) in your CSS.

Are my inputs uploaded?

No. All processing is local. Your color never leaves your browser.