๐ŸŽจ HEX to RGB Converter

Convert between HEX and RGB color codes instantly, in both directions, with a live preview and the matching HSL value.

#RGB, #RGBA, #RRGGBB or #RRGGBBAA (an rgb()/rgba() value can also be pasted)

HEX#2563EB
RGBrgb(37, 99, 235)
HSLhsl(221, 83%, 53%)

Support TinyToolWeb

Help us keep these tools free and ad-free! Your support allows us to create more useful tools.

About HEX to RGB Converter

This converter turns a hexadecimal color code into its red, green and blue values (0-255) and back. It also shows the equivalent CSS hsl() value, so you can copy the color in the format your stylesheet or design tool expects.

Key Features

  • All HEX forms: #RGB, #RGBA, #RRGGBB and #RRGGBBAA (with or without #)
  • Transparency: the alpha channel is converted to rgba()/hsla() and back
  • Exact values: HEX โ†” RGB conversion is lossless; HSL is rounded to whole numbers
  • Live preview: the color updates as you type

How to Use the Tool

  • HEX to RGB: type or paste a HEX code; the RGB fields update automatically
  • RGB to HEX: enter R, G, B (0-255) and optionally the alpha (0-1)
  • Paste rgb(): an rgb(โ€ฆ) or rgba(โ€ฆ) value pasted in the HEX field is converted too
  • Copy: use the ๐Ÿ“‹ buttons to copy the HEX, RGB or HSL value

Common Use Cases

  • Converting brand colors from a design mockup into CSS
  • Adding transparency to a color (#RRGGBBAA or rgba())
  • Checking the RGB values of a color for print or office software

Tips & Best Practices

  • #abc is shorthand for #aabbcc: each digit is doubled
  • In #RRGGBBAA, the last two digits are the opacity: FF = opaque, 80 โ‰ˆ 50 %, 00 = transparent
  • An alpha given in rgba() is stored on 8 bits in HEX, so 0.5 becomes 80 (128/255 โ‰ˆ 0.502)

Privacy & Security

All conversions run locally in your browser. Nothing you type is sent to a server.