Advertisement
Advertisement

Auto Text Color Generator

Pick a background color and get the most readable text color (black or white) based on WCAG contrast ratios.

Aa Bb Cc
Sample text on this background
The quick brown fox jumps over the lazy dog
Best Text Color
#FFFFFF
Contrast Ratio
4.5 : 1
AA Pass
WCAG Levels
AA Normal ✓
AA Large ✓
AAA Normal ✓

Popular Background Colors

Frequently asked questions

How do I choose the best text color for a background?

Pick the candidate that maximizes contrast ratio: black text on light backgrounds, white on dark, computed with the WCAG relative-luminance formula. Then verify the ratio clears 4.5:1 for body text rather than trusting the choice by eye.

Is black or white always the best choice?

No. Near-black (#111827) and near-white (#f8fafc) usually read softer than the pure values and avoid the harsh edge pure black and white produce on large text areas. Both still need a measured contrast check.

What about text over images or gradients?

Contrast is judged against the worst-case pixel behind each glyph. Add a scrim or solid overlay, or test the lightest and darkest regions separately; a single average value hides the failures.