Saltar al contenido principal
Tools Star Hub

Hex a RGB

Convierte colores hexadecimales de 3, 6 y 8 dígitos a RGB, RGBA y HSL en tu navegador.

Cargando herramienta…

Esta herramienta funciona en tu navegador. Los datos, archivos y valores generados se quedan en este dispositivo. Los favoritos y las herramientas recientes, si los usas, solo guardan nombres de herramientas en el almacenamiento local, nunca contraseñas, documentos ni contenido de códigos QR. Consulta la política de privacidad.

Por ahora, la guía detallada de esta herramienta (cómo usarla, ejemplos y preguntas frecuentes) está en inglés.

What this tool does

Type a 3-digit, 6-digit, or 8-digit hex color and see RGB and HSL. Designers copying a color from CSS use it when they have a hex value and need the other writings. #336699 is rgb(51, 102, 153), and a word such as red is not accepted.

How to use

  1. Type a hex color, with or without #. 3-digit, 6-digit and 8-digit values are accepted.
  2. RGB, RGBA (when alpha is present), normalized HEX and HSL appear automatically.
  3. Copy any format, try an example, or reset the field.

Examples

  • #336699

    rgb(51, 102, 153). HSL is hsl(210, 50%, 40%).

  • #fff

    3-digit hex expands to #ffffff, which is rgb(255, 255, 255).

  • #336699cc

    8-digit hex includes alpha. The extra pair is about 80% opacity, shown as RGBA.

How it works

HEX writes red, green and blue as base-16 pairs. A 3-digit value doubles each digit. An 8-digit value adds an alpha pair. RGB uses 0–255 per channel. HSL describes the same color as hue, saturation and lightness. Conversion is arithmetic in the browser; it does not call a color API.

Limitations

Only 3-digit, 6-digit, and 8-digit hex is accepted, with or without #. A word such as red, or an rgb() string, is not converted. HSL on the page is calculated from that hex. It is not a second field you can edit.

See the disclaimer for what these tools do not cover.

FAQ

Is the Hex to RGB converter free?
Yes. Converting hex to RGB and HSL is free, and no account is required.
Do I need the #?
No. FFFFFF and #FFFFFF are treated the same.
Is my input sent to a server?
No. The hex string is converted in this tab. It is not sent to a server or saved in local storage.
How do I convert a hex color to RGB?
Split the six digits into three pairs and convert each pair from hexadecimal to a number from 0 to 255. #FF8000 is red 255, green 128, blue 0.
What does an 8-digit hex color mean?
The last two digits are the alpha channel, which sets opacity. #FF000080 is red at about 50% opacity.