Studio › Creator Tools › HEX → RGB

HEX → RGB

Converts a hex color code to RGB and HSL.

This tool runs on JavaScript. To use it, turn on JavaScript in your browser and reload the page.

FROM #HEX TO RGB, INSTANTLY.

HEX → RGB converts a hexadecimal color code into RGB and HSL values. You can write the code with or without the hash; the three-digit short form (#f00), the six-digit standard form (#ff0000) and the eight-digit form carrying transparency (#ff0000cc) are accepted. The moment you type, the color preview updates and the results appear: RGB, RGBA if there is transparency, HSL, and a CSS variable you can paste straight into a style sheet.

The result list also tells you whether dark or light text should be put on this color; that suggestion is worked out from the perceived brightness of the color. If you want, you can pick a color from the color picker and take its code too. The tool works in both directions: when you change the RGB fields the HEX updates as well, which is why it shares a screen with “RGB → HEX”. It is used to take a code from a design program into code, to convert a brand color into different forms, or to work out whether a color is light or dark. The calculation is done entirely in your browser.

The code can have 3, 4, 6 or 8 digits; the four-digit short form (#f00c) is also expanded by doubling each digit, to #ff0000cc. Codes with 5 or 7 digits and letters outside base 16 (g to z) are treated as invalid and a warning appears. The transparency byte is converted from the 0–255 range to 0–1 with three decimals: cc, that is 204, becomes 0.800; 80, that is 128, becomes 0.502. A transparent color is previewed on a checkered background, so you can see how transparent it is. The dark or light text suggestion is based on brightness calculated with ITU-R BT.601 weights (0.299 × R + 0.587 × G + 0.114 × B); above 0.6, dark text (#111) is suggested, otherwise white text (#fff). #1a73e8 stays at 0.40 and gets white text, while #ff8800 reaches 0.61 and gets dark text. This is a quick rule; for an accessibility check, measure the WCAG contrast ratio separately.

From start to finish

  1. Write the HEX code. For example #1a73e8, 1a73e8, or #17e in the short form.
  2. Look at the preview. The color box and all the values update the moment you type.
  3. Copy the value. Copy the RGB, HSL or CSS variable line and use it.

Frequently asked questions

What does #1a73e8 come to in RGB?

rgb(26, 115, 232). The first two digits give red, the next two green and the last two blue, in base sixteen.

What does an eight-digit HEX mean?

The last two digits are the transparency: ff is fully opaque, 00 fully transparent. #1a73e880 is a half-transparent blue and appears as RGBA in the result.

How is a short HEX (#f00) expanded?

Each digit is written twice: #f00 becomes #ff0000. The tool does that by itself.

Is the data I enter sent to the server?

No. This tool runs entirely in your browser; nothing you type or add is sent to the RUPO Studio server. It keeps working while the page is open even if your internet connection drops. No account needed. It is free to use: there is no hourly or daily limit, and we don't make you watch an ad before you see the result.

Other Creator Tools tools

About us · Contact · Privacy & KVKK · Cookie Policy · Terms of use

Edit your file. Preview the result. Download when it's ready.Preparing your workspace…