HEX to RGB
Paste a HEX code and read the RGB channels. #1f5fd6 becomes rgb(31, 95, 214) — and if the code carries an alpha channel, you get rgba() with the transparency intact.
- #1f5fd6 HEX
- rgb(31, 95, 214) RGB
- hsl(219, 75%, 48%) HSL
Contrast:
- Free
- Files never leave your device
- No sign-up
- No file limit
How to use
Good to know
What the six digits actually mean
HEX is a base-16 way of writing three numbers. The first pair is red, the second green, the third blue, each from 00 to FF — that is 0 to 255 in the decimal you see in RGB. A three-digit code like #1f5 is shorthand: each digit is doubled, so it expands to #11ff55.
Where RGB is required instead of HEX
Canvas and SVG APIs, Android and iOS colour objects, and anything that computes a colour rather than writing it out all speak in channels. RGB is also the only way to add transparency without an eight-digit HEX that older browsers misread.
Frequently asked questions
Does it handle an eight-digit HEX with transparency?
Yes. The last pair is the alpha channel; it appears as the fourth value in rgba(), converted from 0–255 into the 0–1 scale CSS expects.
Is the hash required?
No. «1f5fd6» and «#1f5fd6» are both accepted, as is a three- or four-digit shorthand.
Does anything leave my browser?
No. The conversion is arithmetic done on the page — nothing is uploaded or logged.
Related tools
- Colour Converter Type a colour in any common notation — #1f5fd6, 1f5fd6, #1f5, rgb(31, 95, 214) — and all the ot…
- RGB to HEX Paste rgb(31, 95, 214) — with commas or spaces, it does not matter — and get #1f5fd6, ready for…
- Password Generator A new password is generated the moment this page loads, using your browser's cryptographic rand…
- QR Code Generator Type a link or any text and the code appears as you type. Download it as a PNG for a screen or…
- UUID Generator Press the button and get identifiers you can paste straight into a database, a config or a test…
- Wi-Fi QR Code Type the network name and password, and the code appears. A guest points the camera at it and j…
- URL QR Code Paste the link and the code appears as you type. It points straight at your address — no shorte…