Tools / Calculators
Color converter and contrast checker
Use this color converter to switch between HEX, RGB and HSL, and check text contrast against the WCAG accessibility rules.
How to use it
- Type a color in HEX, RGB or HSL, or pick one.
- Copy the format you need.
- In the contrast checker, enter a text color and a background to see if they pass.
About this tool
This color converter changes a color between HEX, RGB and HSL, and checks if two colors are readable together. The three formats describe the same color, so converting never changes how it looks. The contrast checker uses the WCAG formula. Normal text needs a ratio of at least 4.5 to 1 for level AA and 7 to 1 for AAA. Large text needs 3 to 1 for AA, and buttons and icons need 3 to 1.
Three ways to write one color
HEX such as #4f46e5 is common in CSS and design tools. RGB gives the red, green and blue amounts from 0 to 255. HSL gives hue, saturation and lightness, which makes it easy to make a color lighter or darker. All three describe the same color.
Check contrast for readability
Text needs enough contrast against its background to be readable by people with low vision. WCAG asks for at least 4.5 to 1 for normal text and 3 to 1 for large text at level AA. Enter your text and background colors to see if they pass.
Questions
Which color formats can I type?
HEX such as #4f46e5 or #fff, RGB such as rgb(79, 70, 229), and HSL such as hsl(243, 75%, 59%).
What contrast ratio do I need?
For normal text, 4.5 to 1 passes AA. For large text it is 3 to 1. AAA asks for 7 to 1 and 4.5 to 1.
Is anything uploaded?
No. All of it runs in your browser.