Hex to RGB
Convert 3-digit, 6-digit and 8-digit hex colors to RGB, RGBA and HSL in your browser.
Check WCAG contrast between foreground and background colors, with pass/fail for AA and AAA.
A color contrast checker measures the WCAG contrast ratio between foreground and background colors.
This tool runs in your browser. Inputs, files and generated values stay on this device. Favorites and recently used tools, if you use them, store only tool names in local storage — never passwords, documents or QR contents. See the privacy policy.
Compare two solid colors and show the WCAG 2 contrast ratio for normal and large text. Designers checking a button label against its background use it before they ship the pair. Black on white is 21:1, and a photograph behind the text is outside the calculation.
The ratio is 21:1, which meets every listed WCAG contrast criterion.
A pair such as #777777 on #999999 fails normal-text AA because the ratio is well below 4.5:1.
The tool uses WCAG 2 relative luminance. A pass means the pair meets the selected WCAG contrast criterion. Contrast is only one part of accessibility. Font size, weight, spacing and keyboard access still matter. The checker does not claim a design is universally accessible.
The result is the WCAG 2 contrast ratio of two colors the parser can read. A pass is not a full accessibility audit. Font size is not read from a stylesheet, and a color the parser rejects produces no ratio.
See the disclaimer for what these tools do not cover.
Convert 3-digit, 6-digit and 8-digit hex colors to RGB, RGBA and HSL in your browser.
Pick a color with the browser color input and copy HEX, RGB or HSL values.
Build linear, radial or conic CSS gradients, or gradient text, and copy the CSS or HTML.
Approximate the dominant colors in a JPG, PNG or WebP image using sampled pixels.
Tune offset, blur, spread and color, then copy a CSS box-shadow value.
Pretty-print JSON, minify it, or check that it parses in the page. Comments, trailing commas, and single quotes fail. It does not turn the result into CSV.
Guide
Split a hex color into red, green, and blue pairs and convert each pair from base 16 to a number from 0 to 255.
Read guideGuide
Choose one opaque color with the browser color control and copy it as HEX, RGB, or HSL.
Read guideGuide
Sample a JPG, PNG, or WebP and list 3 to 10 colors with each color's share of the sampled pixels.
Read guideGuide
Compare two solid colors and read the WCAG 2 ratio, including AA and AAA for normal and large text.
Read guideNormal sample text
Large sample text
18.88:1
Foreground #111111 (rgb(17, 17, 17), hsl(0, 0%, 7%)) on #ffffff (rgb(255, 255, 255)).
WCAG 2.1 contrast uses relative luminance. Normal text needs 4.5:1 for AA and 7:1 for AAA. Large text (18pt or 14pt bold) needs 3:1 for AA and 4.5:1 for AAA.
A pass means the pair meets the selected WCAG contrast criterion. Contrast is only one part of accessibility. Spacing, size, motion and keyboard use still matter.