Color contrast checker and brand palette export
Enter a text color and a background color to see their contrast ratio, with a live preview and the nearest color that reaches the ratio you want. Switch to palette mode to check every pair in a brand palette and export it. Free, no account, nothing uploaded.
- Price
- Free
- Sign-up
- None
Everything is worked out in your browser. Your colors are not sent, saved or logged.
Your colors
See-through colors are mixed first: a see-through background with white, then the text with the background. Text over photos and gradients needs a different check.
Contrast ratio
Contrast ratio: 15.80:1
Cut to two decimals, never rounded up, so 4.50 always means at least 4.5.
| Use | Needs | This pair |
|---|---|---|
| Normal textUnder 24 px, or under 18.66 px (14 pt) when bold. | 4.5:1 | Reaches 4.5:1 |
| Large text24 px or bigger, or 18.66 px (14 pt) or bigger when bold. | 3:1 | Reaches 3:1 |
| Normal text, higher barThe stricter level for normal-size text. | 7:1 | Reaches 7:1 |
| Large text, higher barThe stricter level for large text. | 4.5:1 | Reaches 4.5:1 |
| Buttons, borders and iconsButton and field outlines, icons and chart parts. | 3:1 | Reaches 3:1 |
Live preview
These lines use your two colors. The 3:1 level is for the large lines; the 4.5:1 level is for the first one.
Fix it: the nearest colors that reach the ratio
This pair already reaches 4.5:1.
Each option keeps your hue and only makes the color lighter or darker, by the smallest step that works.
Pick colors from a logo or photo
Choose a picture to see its main colors, or click a spot in it. The picture stays on your device; nothing is uploaded.
Without a mouse or touch screen, use the buttons under the main colors.
Main colors in the picture
No solid colors found. The picture may be fully see-through.
Need a website to go with it? See Digital Works Forge website packages. A small San Antonio studio that builds sites for local businesses.
How to check the contrast of two colors in four steps
- Enter your two colors. Type a text color and a background color as hex codes such as #1A1A1A, as rgb() or hsl() values, or as a color name such as navy. Transparency works too. You can also use the color pickers, pick a color from a logo or photo, or, in Chrome or Edge on a desktop computer, press the eyedropper button and click any color on your screen.
- Read the ratio and the four checks. The ratio appears with two decimals, from 1 to 21. Below it are four checks: 4.5:1 for normal text, 3:1 for large text and interface parts, 7:1 for enhanced normal text and 4.5:1 for enhanced large text. The live preview shows your pair at normal and large size.
- Fix a pair that falls short. When a target is not reached, the tool suggests the nearest color with the same hue, only lighter or darker, that does reach it. You can change the text or the background. Press Use this color to try it, or Swap to flip the pair.
- Check a whole palette. Building a brand? Switch to Palette mode, add 3 to 12 colors and read the matrix of every pair. Then export the colors as CSS variables, a Tailwind block or JSON, or download a PNG swatch card.
What a contrast ratio is
A contrast ratio is one number that says how different two colors are in brightness. It runs from 1:1, two identical colors, up to 21:1, pure black on pure white. The higher the number, the easier it is to read text in one color on the other.
The tool uses the formula from the W3C's Web Content Accessibility Guidelines (WCAG) 2. Each red, green and blue channel is first converted from its screen value to a linear value. The relative luminance is then 0.2126 times red, plus 0.7152 times green, plus 0.0722 times blue. The ratio is the lighter luminance plus 0.05, divided by the darker luminance plus 0.05. Green counts most because our eyes are most sensitive to it.
Only solid colors are supported. Transparency changes the final color depending on what sits behind it, so flatten it to a solid color first.
The numbers that matter: 4.5, 3 and 7
WCAG 2 uses a few fixed targets. The tool shows all four so you can see where a pair stands.
- 4.5:1 for normal text (success criterion 1.4.3, Contrast Minimum). This is the common target for body copy, labels and links.
- 3:1 for large text, and for interface parts such as button borders, form field outlines and icons (1.4.3 and 1.4.11, Non-text Contrast).
- 7:1 for normal text at the enhanced level (1.4.6, Contrast Enhanced).
- 4.5:1 for large text at the enhanced level (also 1.4.6).
Large text means at least 24 CSS pixels, or at least 18.66 pixels (14 points) and bold. Anything smaller counts as normal text. Logos, purely decorative text and disabled controls are exempt from the text rule.
The ratio is cut, never rounded up. A pair at 4.497 shows as 4.49 and falls short, so 4.50 on screen always means at least 4.5.
How to fix a pair that falls short
Most failing pairs are one small step from reaching the target. When a check is not reached, the tool looks for the nearest color that reaches it, keeping the hue and changing only the lightness. It can adjust the text or the background, and you choose which.
Some situations come up again and again.
Light grey text on white
Placeholder text and small captions in a pale grey such as #AAAAAA are about 2.3:1 on white. Going down to #767676 reaches 4.5:1.
White text on a brand button
Gold, yellow, orange and light green buttons often fall short with white text. Try dark text instead, or darken the button color a little.
Links inside a paragraph
If a link differs from the surrounding text only by color, check that pair as well, and keep an underline so the link does not depend on color alone.
Hover, focus and disabled states
Check every state of a button, not only the resting one. Disabled controls are exempt, but a faint label that looks disabled while still active will confuse people.
Dark mode
A pair that works on white can fail on near-black. Pure white on pure black is harsh, so many designers use off-white text on dark grey. Check that version.
Text on a photo
The tool compares two solid colors, so for text over an image, pick the lightest or darkest patch behind the words and test against that, or put a solid or darkened panel behind the text.
Choosing a brand palette that works
Palette mode takes 3 to 12 colors, with optional names, and shows the ratio for every pair in a matrix. That turns a vague feeling about your brand colors into a clear list.
Read the matrix in three groups. Pairs at 4.5:1 or more are safe for body text. Pairs between 3:1 and 4.5:1 suit large headings, buttons, borders and icons. Pairs under 3:1 are for decoration only, such as backgrounds, dividers and shapes.
A typical result: a deep navy and an off-white reach well over 7:1, so they carry the text. A mid-tone orange accent might reach 3:1 on the navy, so it works for a button outline but not for small copy. A pale yellow on white at about 1.1:1 is only a background tint. Decide these roles before you design, and you will not need to patch colors later.
What a ratio does not tell you
A ratio is one check among many. A site can reach every number here and still be hard to use, and a good ratio does not make a site legally safe. This is not legal advice. If a law or contract applies to your site, ask a qualified professional.
- It ignores font weight and thinness. A very thin typeface can be hard to read at 4.5:1.
- It cannot judge text over photos, gradients or patterns.
- It does not cover meaning carried by color alone, such as red for errors with no icon or words.
- It says nothing about focus outlines, keyboard use, screen readers, captions or clear wording.
- Color blindness is helped by contrast, but contrast does not replace having a second cue besides color.
Some people prefer a newer perceptual method called APCA, proposed for WCAG 3. It is not final. This tool uses the current WCAG 2 formula, the one most tests and audits use today.
Using the exports
Once a palette looks right, Palette mode exports it in the format your project needs. Each is shown as text to copy, and nothing is saved.
CSS variables
A :root block with one custom property per color, such as --color-navy, ready to paste into a stylesheet.
Tailwind CSS v4
A @theme block that adds your colors as theme tokens, so classes like bg-navy work.
Tailwind v3
A colors block for tailwind.config.js, inside theme.extend.
SCSS
One variable per color, such as $navy: #1b2a49;, for projects that use Sass.
JSON
A design tokens file with each color as an sRGB value and its hex code, for scripts, design tools or a developer handoff.
CSV of the pairs
The whole matrix of ratios as a spreadsheet file, so you can sort and share it.
PNG or SVG swatch card
A 1200 pixel wide card with your colors, their names and codes, and a list of the text pairs that reach 4.5:1, handy to send to a designer or a printer.
Your colors stay in your browser
The maths, the preview and the exports all run in your browser. Your colors are not uploaded, stored or logged, and you need no account. Close the tab and they are gone, so copy any export you want to keep.
Frequently asked questions
Is the contrast checker free? Do I need an account?
It is free. There is no sign-up, no limit on how many pairs or palettes you check, and no watermark on the swatch card.
Are my colors uploaded anywhere?
No. The checks run in your browser, and nothing you enter is sent, saved or logged. Close the tab and your colors are gone.
Why does 4.5 show as 4.49 for some pairs?
The ratio is cut to two decimals, never rounded up. A pair at 4.497 does not reach 4.5:1, and showing 4.50 would be misleading. So a displayed 4.50 always means at least 4.5.
If a pair reaches 4.5:1, is my site good for everyone?
No. A ratio is one check among many. It does not cover thin fonts, text over images, color-only meaning, focus outlines or anything else on your site. It also does not make a site legally safe, and this is not legal advice.
Can it check transparency, gradients or text on images?
No. It compares two solid, opaque colors. For a gradient or an image, test the worst spot behind the text, or place a solid panel behind it.
Why is there no eyedropper button in my browser?
The eyedropper depends on a browser feature found in Chrome and Edge on a desktop computer. Safari and Firefox do not offer it. Type the hex code or use the color picker instead.
Which pairs should I check in a palette?
Check every pair you will really place together, mainly each text color on each background. Skip pairs used only for decoration. The matrix shows all of them at once.