HEX to RGB Converter
Convert HEX to RGB and back, get the HSL equivalent, and see the contrast ratio against white and black for accessibility checks.
A HEX to RGB converter translates a colour between the two notations CSS accepts - #2563eb and rgb(37, 99, 235) describe exactly the same colour. This one also returns HSL and the contrast ratio against white and black, which is what accessibility checks need.
Runs entirely in your browser · no signup · nothing is uploaded · updated 2026-09-26
- HEX
- #2563eb
- RGB
- rgb(37, 99, 235)
- HSL
- hsl(221, 83%, 53%)
- Contrast on white
- 5.17:1
- Contrast on black
- 4.06:1
- Alice Blue hex code
- Antique White hex code
- Aquamarine hex code
- Azure hex code
- Beige hex code
- Bisque hex code
- Black hex code
- Blanched Almond hex code
- Blue hex code
- Blue Violet hex code
- Brown hex code
- Burlywood hex code
- Cadet Blue hex code
- Chartreuse hex code
- Chocolate hex code
- Coral hex code
- Cornflower Blue hex code
- Cornsilk hex code
- Crimson hex code
- Cyan hex code
- Dark Blue hex code
- Dark Cyan hex code
- Dark Goldenrod hex code
- Dark Gray hex code
- Dark Green hex code
- Dark Khaki hex code
- Dark Magenta hex code
- Dark Olive Green hex code
- Dark Orange hex code
- Dark Orchid hex code
- Dark Red hex code
- Dark Salmon hex code
- Dark Sea Green hex code
- Dark Slate Blue hex code
- Dark Slate Gray hex code
- Dark Turquoise hex code
- Dark Violet hex code
- Deep Pink hex code
- Deep Sky Blue hex code
- Dim Gray hex code
- Dodger Blue hex code
- Firebrick hex code
- Floral White hex code
- Forest Green hex code
- Gainsboro hex code
- Ghost White hex code
- Gold hex code
- Goldenrod hex code
- Gray hex code
- Green hex code
- Green Yellow hex code
- Honeydew hex code
- Hot Pink hex code
- Indian Red hex code
- Indigo hex code
- Ivory hex code
- Khaki hex code
- Lavender hex code
- Lavender Blush hex code
- Lawn Green hex code
- Lemon Chiffon hex code
- Light Blue hex code
- Light Coral hex code
- Light Cyan hex code
- Light Goldenrod Yellow hex code
- Light Gray hex code
- Light Green hex code
- Light Pink hex code
- Light Salmon hex code
- Light Sea Green hex code
- Light Sky Blue hex code
- Light Slate Gray hex code
- Light Steel Blue hex code
- Light Yellow hex code
- Lime hex code
- Lime Green hex code
- Linen hex code
- Magenta hex code
- Maroon hex code
- Medium Aquamarine hex code
- Medium Blue hex code
- Medium Orchid hex code
- Medium Purple hex code
- Medium Sea Green hex code
- Medium Slate Blue hex code
- Medium Spring Green hex code
- Medium Turquoise hex code
- Medium Violet Red hex code
- Midnight Blue hex code
- Mint Cream hex code
- Misty Rose hex code
- Moccasin hex code
- Navajo White hex code
- Navy Blue hex code
- Old Lace hex code
- Olive hex code
- Olive Drab hex code
- Orange hex code
- Orange Red hex code
- Orchid hex code
- Pale Goldenrod hex code
- Pale Green hex code
- Pale Turquoise hex code
- Pale Violet Red hex code
- Papaya Whip hex code
- Peach Puff hex code
- Peru hex code
- Pink hex code
- Plum hex code
- Powder Blue hex code
- Purple hex code
- Rebecca Purple hex code
- Red hex code
- Rosy Brown hex code
- Royal Blue hex code
- Saddle Brown hex code
- Salmon hex code
- Sandy Brown hex code
- Sea Green hex code
- Seashell hex code
- Sienna hex code
- Silver hex code
- Sky Blue hex code
- Slate Blue hex code
- Slate Gray hex code
- Snow hex code
- Spring Green hex code
- Steel Blue hex code
- Tan hex code
- Teal hex code
- Thistle hex code
- Tomato hex code
- Turquoise hex code
- Violet hex code
- Wheat hex code
- White hex code
- White Smoke hex code
- Yellow hex code
- Yellow Green hex code
- Burgundy hex code
- Sage Green hex code
- Mint Green hex code
- Baby Blue hex code
- Baby Pink hex code
- Emerald Green hex code
- Rose Gold hex code
- Cream hex code
- Mustard Yellow hex code
- Neon Green hex code
- Hunter Green hex code
- Periwinkle hex code
- Lilac hex code
- Mauve hex code
- Champagne hex code
- Terracotta hex code
- Charcoal hex code
- Off White hex code
- Cobalt Blue hex code
- Electric Blue hex code
- Wine hex code
- Peach hex code
- Scarlet hex code
- Metallic Gold hex code
How to use it
- 1.Enter a HEX value such as #2563eb, or three numbers from 0 to 255.
- 2.Read the RGB, HSL and preview swatch.
- 3.Check the contrast ratios if the colour will carry text.
Embed this color converter on your site
Free to use on any blog, class page or wiki. Paste the snippet and keep the credit line under it.
<iframe src="https://rankcert.com/embed/hex-to-rgb" title="Color Converter" width="100%" height="600" style="border:0;border-radius:12px" loading="lazy"></iframe> <p style="font-size:13px">Free <a href="https://rankcert.com/tools/hex-to-rgb">color converter</a> by RankCert</p>
Frequently asked questions
How do I convert HEX to RGB by hand?
Split the six digits into three pairs and read each as base 16. 25 is 37, 63 is 99, eb is 235.
What does the third pair of a hex colour mean?
Blue. The six digits are red, green and blue, two hex digits each, giving 256 levels per channel and 16.7 million colours.
What is an eight-digit hex colour?
The last pair is alpha - opacity from 00 to ff. #2563eb80 is that blue at roughly 50% opacity.
When is HSL more useful than HEX?
When building a palette. Keeping hue and saturation fixed and varying only lightness gives consistent tints and shades, which is nearly impossible to do by eye in HEX.
What contrast ratio do I need?
4.5:1 for body text and 3:1 for large text or UI components, under WCAG AA. AAA asks for 7:1, which is difficult with brand colours.
Do three-digit hex codes work?
Yes. #f00 expands to #ff0000 - each digit is doubled. It only reaches 4,096 colours, so it is a shorthand for simple values.
Why does my colour look different in a design tool?
Colour profile. Design tools often work in Display P3 or Adobe RGB; the web is sRGB. The hex value is the same but the rendered result differs.
Is RGB the same as RGBA?
RGBA adds an alpha channel from 0 to 1. Modern CSS also accepts rgb(37 99 235 / 50%), which does the same thing.
The guide behind this tool
Tools that pair with this one

Image Color Picker
Click anywhere on an image to read the exact colour as HEX, RGB and HSL, and keep a palette of everything you picked. Nothing is uploaded.
Images
PNG to PDF
Turn a PNG, JPG or screenshot into a PDF in your browser. No upload, no signup, no watermark - the file never leaves your device.
Images
PDF to PNG
Render every page of a PDF as a high-resolution PNG in your browser. Nothing is uploaded, there is no page limit and there is no watermark.
Images
PNG to JPG
Convert a PNG to JPG in your browser with a quality slider, and see exactly how much smaller the result is before you download it.
Images