Color Utility
Convert a color between HEX, RGB and HSL and check the contrast ratio of two colors against WCAG. Enter HEX (#1a2b3c or #abc), rgb(10, 20, 30) or hsl(200, 50%, 40%) and the other two forms are shown. Contrast is calculated from a foreground and a background color by the WCAG 2.x definition and judged against AA (4.5:1 for normal text, 3:1 for large text) and AAA (7:1 and 4.5:1), and a preview shows how text looks. Everything runs in your browser and the colors you enter are not sent anywhere. It also reads CSS color names, transparency and space-separated syntax, shows HSV, CMYK and OKLCH, builds color schemes and 50-950 shade scales, suggests an accessible text color, and previews color-vision differences.
Color Conversion
Transparency is kept in the HEX8, rgb() and oklch() values. Contrast is calculated for the opaque color.
Palette
Click a color to use it as the input.
Shades and tints (50-950)
Contrast Checker (WCAG)
The quick brown fox jumps over the lazy dog.
Suggested text color
How it looks with color vision differences
A rough simulation of the text on the background. Do not rely on color alone to convey meaning.
Gradient (CSS)
Pick two or three colors to get a linear-gradient() you can paste into CSS. OKLCH interpolation avoids muddy middles in browsers that support it.
Nearest CSS color name
Finds the closest named CSS color by perceived difference (OKLab).
Palette: contrast table and export
One color per line, optionally named (brand: #2563eb). Get the contrast ratio of every text-on-background pair, and export the palette as CSS variables or a Tailwind config.
Contrast (text ↓ on background →)
GuideHow to use & features
- Enter a color as HEX, RGB, or HSL to see the other formats instantly.
- Set foreground and background colors to view the contrast ratio and WCAG status.
- Use the preview text to judge readability and adjust colors as needed.
- Copy outputs directly into design tools or CSS files.
SamplesSample input & output
Convertir HEX a RGB/HSL
#1d4ed8
RGB: rgb(29, 78, 216) HSL: hsl(221, 76%, 48%)
FAQFAQ
What color formats can I enter?
HEX (`#1a2b3c`, `#abc`, 8-digit `#rrggbbaa`, the `#` is optional), `rgb()`/`rgba()`, `hsl()`/`hsla()`, `hwb()`, `oklch()` and CSS color names (`red`, `rebeccapurple`...). Comma-separated and space-separated forms (`rgb(0 123 255 / 50%)`) both work. The color is shown as HEX, RGB, HSL, HSV, CMYK and OKLCH.Can I use color names like `red` or colors with transparency?
Yes. CSS color names and the transparency in `rgba(10, 20, 30, 0.5)` or an 8-digit HEX (`#11223344`) are read. Transparency stays in the HEX8, `rgb()` and `oklch()` values, but the contrast ratio is calculated for the opaque color.What is the contrast ratio based on?
It follows the WCAG 2.x definition, computed from the relative luminance of the foreground and background colors. Values run from 1:1 (same color) to 21:1 (black and white).What do AA and AAA require?
AA needs at least 4.5:1 for normal text and 3:1 for large text. AAA needs at least 7:1 for normal text and 4.5:1 for large text. Large text is generally 18pt or larger, or 14pt or larger in bold.What can I check in the preview?
How text looks with the chosen foreground and background colors, right on the spot.Is the color I enter sent anywhere?
No. Conversion and the contrast calculation happen entirely in your browser.
Use casesCommon use cases
Checking that a design's colors are readable
Get the contrast ratio of text and background colors and see whether it meets AA and AAA.Responding to accessibility findings
When told "contrast is insufficient", experiment to find which color to darken, and by how much, to pass the standard.Moving between HEX, RGB and HSL
Turn a design tool's HEX into CSS `rgb()` or `hsl()`, or the reverse, at once.Considering colors for dark mode
Swap background and text colors and compare readability in both light and dark.
NotesNotes & limitations
Transparency (alpha) is kept, but not used in the contrast ratio
Alpha in `rgba()` or 8-digit HEX stays in the HEX8, `rgb()` and `oklch()` values, but the contrast ratio is calculated for the opaque color. How a translucent color looks over a background cannot be calculated.`color()`, `lab()`, `color-mix()` and other newer CSS syntax are not supported
Color names (`red`), space-separated `hsl(200 50% 40%)`, `hwb()` and `oklch()` are understood. Values with `color()`, `lab()`, `lch()`, `color-mix()` or `calc()` cannot be read.Out-of-range values are clamped
A value past the range, as in `rgb(300, 0, 0)`, is clamped to the maximum of 255. Check that you did not get an unintended color.The contrast ratio is a guideline for meeting the standard
It is the value from the WCAG 2.x formula. Real readability also depends on text size, weight and whether text sits over an image, so make the final check on screen.
AboutAbout this tool
Color Converter and Contrast Checker
Design and frontend work often moves between HEX, RGB, and HSL color formats. This tool converts color values and helps check contrast between foreground and background colors so UI text and controls remain readable.
Common use cases
- Convert CSS colors: Move between HEX, RGB, and HSL when implementing designs.
- Check readability: Compare text and background colors before shipping UI changes.
- Create color variations: Use HSL to adjust lightness or saturation for hover states, borders, and subtle backgrounds.
Accessibility note
Color contrast affects readability, especially on mobile screens and bright displays. Do not rely on color alone to communicate state; combine color with text, icons, labels, or layout cues.
