HEX
#3366cc
RGB
rgb(51, 102, 204)
HSL
hsl(220, 60%, 50%)
CMYK
cmyk(75%, 50%, 0%, 20%)
As text on white
5.37:1 · Passes for body text
As text on black
3.91:1 · Large text and buttons only
HEX -> RGB · Local tool
Hex to RGB Converter
Convert a hex colour to RGB, HSL and CMYK, and check its contrast.
Last updated
How do I convert a hex colour to RGB?
Split the six digits into three pairs and read each pair as a number from 0 to 255: #3366cc is rgb(51, 102, 204). A three digit hex repeats each digit first, so #abc means #aabbcc. filetity does the conversion in your browser and writes the colour out in hex, RGB, HSL and CMYK at once, keeping the alpha if the hex had eight digits, and accepts input in any of those notations so it converts in both directions. It also gives the WCAG contrast ratio against white and black, calculated from the specification's own luminance formula, so you can see whether the colour is readable as text before shipping it.
01 / Your device
the file stays here
02 / Browser memory
the work runs locally
03 / Back to you
saved on this device
When you would use this
Situations, not settings.
- A brand hex that has to go into a tool wanting RGB
- Android, After Effects, Excel and half the print world ask for three numbers. This gives them, plus the alpha if the hex carried one.
- Checking a colour is readable before shipping it
- The contrast ratio against white and black comes from the WCAG formula, so it matches what an accessibility audit will say.
- A hex that came out of a design file with eight digits
- The last pair is opacity, not part of the colour. It is kept and shown as the fourth number rather than silently dropped.
How it works / no cloud
A conversion engine, not an upload form.
Type a colour in any notation and every other one is written out beside it. Hex with three, four, six or eight digits, rgb() and hsl() with commas or with spaces and a slash for alpha, all read the same way a browser reads them, which is the part most converters get wrong: a three digit hex repeats each digit, so #abc is #aabbcc and not #0a0b0c. The WCAG contrast ratio against white and black is calculated from the specification's own luminance formula, so the numbers agree with an accessibility audit rather than approximating one.
- Offline ready
- Installable app
- No file limit queue
Straight answers
No accordion. Nothing hidden.
- Is it free?
- Yes, with no watermark and no page limit.
- Does it need an account?
- No. There is no account system.
- Is my file processed on my device?
- Yes. The file is read by your browser and never uploaded. There is no server to send it to.
- What formats are supported?
- Hex, RGB, RGBA, HSL and HSLA in. Hex, RGB, HSL and CMYK out, with the alpha kept.
- What are the 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.
- Does it work on mobile?
- Yes, on any modern mobile browser. Large files are limited by the memory the phone gives the browser.
- Does it work offline?
- Yes, once the page has loaded. The tool keeps working with no network connection.
- 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.
Keep working locally
3 available · more coming