RGB to HEX
Paste rgb(31, 95, 214) — with commas or spaces, it does not matter — and get #1f5fd6, ready for CSS, a design file or a style guide.
- #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
- Paste the RGB or RGBA value, or pick a colour with the swatch.
- Read the HEX code above the other formats.
- Press «Copy» next to the HEX line.
Good to know
Why designers ask for HEX
HEX is one token instead of three numbers, which makes it easy to paste into a spec, a ticket or a chat message without losing a digit. It is also the notation that design tools show by default, so a palette written in HEX matches what everyone else is looking at.
What happens to the alpha channel
If you pass rgba() with transparency, the result is an eight-digit HEX: the last pair encodes alpha from 0 to 255. Modern browsers read it correctly; older ones do not, so keep rgba() where you need broad support.
Frequently asked questions
Do I have to write rgb(...) around the numbers?
The full notation with commas or spaces is accepted, in both rgb() and rgba() form. Values above 255 are clamped rather than silently wrapped.
Why is my HEX eight characters long?
Because the colour has an alpha channel. Drop the transparency and you get the usual six-digit code.
Is anything sent to a server?
No. The whole conversion happens in the page, so unpublished brand colours stay with you.
Related tools
- Colour Converter Type a colour in any common notation — #1f5fd6, 1f5fd6, #1f5, rgb(31, 95, 214) — and all the ot…
- HEX to RGB Paste a HEX code and read the RGB channels. #1f5fd6 becomes rgb(31, 95, 214) — and if the code…
- 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…