# Hex to RGB Converter

Convert a hex colour to RGB, HSL and CMYK, or go the other way, and see the contrast ratio against white and black. Everything runs in your browser.

Canonical page: https://filetity.com/hex-to-rgb

## Capabilities

- Free: Yes, with no watermark and no page limit.
- Account required: No. There is no account system.
- Processed on device: Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- Formats: Hex, RGB, RGBA, HSL and HSLA in. Hex, RGB, HSL and CMYK out, with the alpha kept.
- Limits: Named CSS colours are not accepted, deliberately. CMYK is the plain formula rather than a colour managed conversion, which a press profile would change.
- Mobile: Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Offline: Yes, once the page has loaded. The tool keeps working with no network connection.

## Questions

### Why is #abc the same colour as #aabbcc?

Because the short form repeats each digit rather than padding it with a zero. That is the CSS rule, and it is why #abc is a light blue-grey and not the near-black that #0a0b0c would be. Getting this wrong is the single most common bug in a hand-written colour parser.

### What is the eighth pair of digits in a hex colour?

Alpha, the opacity, from 00 for invisible to ff for solid. It is a relatively recent addition to CSS and design tools export it freely, so a colour arriving with eight digits is normal. The value is kept here and shown as the fourth number in rgba() and hsla().

### Can I trust the CMYK numbers for print?

For getting close and for filling in a field that demands four numbers, yes. For matching a printed sample, no. The conversion here assumes ink behaves like a screen, and a real press works from an ICC profile for that specific paper and ink, which produces different numbers. Ask your printer, not a web page.

### What does the contrast ratio mean?

How readable this colour is as text on white or on black, on the scale WCAG uses. 4.5:1 is the bar for body text and 3:1 for large text, headings and interface parts, and 21:1 is pure black on pure white, which is the maximum possible. The figures come from the specification's own luminance formula, so they match what an audit will report.

## Related tools

- [Image Compressor](https://filetity.com/image-compressor): Compress an image to a size you name, or to a quality you pick, and see the real result before downloading.
- [Invert image colors](https://filetity.com/invert-image-colors): Flip every colour in an image to its opposite.
