ToolSnap
Color Converter

Hex to RGB

Convert any hex color to RGB and HSL values instantly with a live preview, or pick a color from your screen.

Current

#6366F1

#
RGB → Hex (reverse)
# 6366F1

Quick colors

How to use the Hex to RGB Converter

  1. Type or paste a hex color code (e.g. #6366F1) into the hex input field. The # prefix is optional.
  2. The RGB, HSL and CSS values update instantly with a live color preview.
  3. Alternatively, enter R, G, B values (0–255) directly to convert back to hex.
  4. Use the color picker button to pick any color from your screen using the EyeDropper API (Chrome/Edge only).
  5. Click any swatch in the palette at the bottom to instantly load that color.

Common use cases

  • CSS and design work. Design tools often provide hex codes; CSS frameworks like Tailwind use hex in config files. Convert to rgb() or hsl() when you need to add alpha transparency.
  • Design systems. Brand color palettes are typically defined in hex. Convert to HSL to generate tints and shades by adjusting the lightness value.
  • Accessibility checks. WCAG contrast ratios are calculated using linear RGB values. Knowing the RGB breakdown is the first step in contrast analysis.
  • Print-to-screen handoffs. Print designers work in CMYK; screen designers use RGB/hex. Use this tool to validate the screen equivalent of a brand color.
  • Canvas and SVG programming. JavaScript canvas APIs accept rgb() strings. Convert your hex palette once and use the values directly in code.

Limitations

  • The tool works with the sRGB color space. Wide-gamut formats like Display P3 or Rec. 2020 are not supported.
  • 8-digit hex codes with alpha (e.g. #6366F180) are not accepted. Use the CSS rgba() function for transparency.
  • The EyeDropper (screen color picker) is only available in Chrome and Edge. It won't appear in Firefox or Safari.

Frequently asked questions

What is a hex color code?
A hex color code is a 6-digit hexadecimal number (e.g. #FF5733) representing a color. First two digits = red, next two = green, last two = blue.
How do I convert hex to RGB manually?
Split the hex into three pairs and convert each from base-16 to base-10. E.g. #FF5733: FF=255, 57=87, 33=51 → rgb(255, 87, 51).
What is the difference between RGB and HSL?
RGB defines colors by red, green, and blue intensity (0–255). HSL uses hue (color angle 0–360°), saturation (0–100%), and lightness (0–100%). HSL is more intuitive for humans.
Can I use hex colors in CSS?
Yes. CSS accepts hex colors directly: color: #FF5733 or color: #F53 (shorthand for #FF5533). You can also use rgb() and hsl() functions.

Related tools