Normalize design tokens
Convert HEX values from design tools into RGB and HSL formats for CSS, JavaScript, and documentation.
🔒 Browser-side processing
Convert HEX, RGB, and HSL colors while checking contrast ratios.
Guide
Convert HEX, RGB, and HSL values from the same color and check contrast against white and black backgrounds.
Convert HEX values from design tools into RGB and HSL formats for CSS, JavaScript, and documentation.
See how the selected color performs against light and dark backgrounds before using it for UI text or icons.
Copy each color format directly into theme variables, component styles, or design notes.
Workflow
Examples
Input
#2DD4BF
Output
HEX #2DD4BF
RGB rgb(45, 212, 191)
HSL hsl(173, 66%, 50%)
Input
Foreground #64748B on background #FFFFFF
Output
Contrast ratio 4.76:1
Passes AA for body text, fails AAA
WCAG asks for 4.5:1 (AA) and 7:1 (AAA) on body text, and 3:1 for large text.
Troubleshooting
Light grey text on a light background is the most common failure. If you cannot reach 4.5:1, darken the text or increase the size to qualify for the 3:1 large-text threshold.
Contrast must be computed on the color the eye actually sees. For semi-transparent colors, enter the composited result rather than the source value.
Review
The ratio is a fast signal, but final accessibility depends on text size, font weight, state color, and surrounding background.
HSL is useful when you want to keep hue stable while adjusting lightness or saturation for hover, disabled, and border states.
Related