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-02
- HEX
- #2563eb
- RGB
- rgb(37, 99, 235)
- HSL
- hsl(221, 83%, 53%)
- Contrast on white
- 5.17:1
- Contrast on black
- 4.06:1
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.
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.
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.
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.
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.
Built something?
RankCert is a weekly launch board where products rank on domain control we verify ourselves - not upvotes. Listing is free and the link is dofollow whether or not you display our badge.