What is color converter?
Designers and developers move between color formats all the time. CSS accepts HEX, RGB and HSL, design tools often show different ones, and brand guides might list only one.
This converter also tests contrast. A ratio of 4.5 to 1 or higher is the common minimum for body text in accessibility guidelines, so you can see at once whether white or black text works on your color.
How to use the color converter
- Enter a HEX value with or without the hash sign. Three digit shortcuts work.
- Look at the swatch and the converted values.
- Check the two contrast ratios to choose readable text.
How the color converter works
HEX is split into red, green and blue pairs and read as base 16 numbers from 0 to 255. HSL is derived from RGB. Contrast follows the WCAG formula using relative luminance of the color compared with white and black.
Worked example
Common uses of the color converter
- Matching a brand color from a design file to CSS.
- Checking if text is readable on a colored background.
- Finding a lighter or darker shade by changing HSL lightness.
- Translating a color between tools that use different formats.
- Teaching color theory to students.
Tips and common mistakes
Do not rely on color alone to carry meaning. Add text or icons for colorblind users.
WCAG asks for 4.5 to 1 for normal text and 3 to 1 for large text.
Background: what to know before you rely on it
Screens make colors by mixing red, green and blue light, which is the RGB model. HEX is just RGB written in base 16. HSL describes a color in the way people think about it, as a hue on the color wheel, a saturation and a lightness, which makes it easy to build tints and shades. Accessibility rules, the WCAG guidelines, set minimum contrast ratios so people with low vision can read text. Normal text should reach 4.5 to 1 and large text 3 to 1. About one in twelve men has some color vision deficiency, so never use color alone to carry meaning.
Private, free and fast
This tool runs entirely in your browser. What you type or choose is not uploaded to a server and is not saved after you close the page, which keeps it fast and private. It is free to use as often as you like. See more in all converters, or browse the full list of tools.
Frequently asked questions
How do I convert HEX to RGB?
Split the code into three pairs and convert each pair from base 16 to decimal.
What contrast ratio is needed?
4.5 to 1 for normal text under WCAG AA.
Does it support transparency?
No. It converts solid colors.
Related tools
Unit Converter
Pick a category, choose the unit you have and the unit you want, then enter a value. The converter also...
ConvertersTemperature Converter
To convert Celsius to Fahrenheit, multiply by 9/5 and add 32. To convert Fahrenheit to Celsius, subtract...
ConvertersRoman Numeral Converter
Roman numerals use the letters I, V, X, L, C, D and M for 1, 5, 10, 50, 100, 500 and 1000. Enter a...
ConvertersNumber to Words Converter
Enter a number and the tool writes it in English words, for example 1,250 becomes One thousand two...
CalculatorsPercentage Calculator
Use it for three jobs: find a percentage of a number, find what percent one number is of another, or...
Text ToolsWord Counter
Paste or type your text and the counter shows words, characters, sentences, paragraphs, reading time and...
Results are for information and education. For legal, financial, medical or security decisions, check with a qualified professional. Check critical conversions with an official source.