devjar tools
English

Color Converter

Change any field and the rest follows.

Output

White text contrast
Black text contrast

Body text needs at least 4.5:1 (AA); large text needs 3:1.

How to use

  1. Type a color in the HEX, RGB or HSL field, or use “Pick a color”.
  2. The other fields update at once and the preview is painted. Each field has its own “Copy” button.
  3. The contrast ratios tell you whether white or black text reads better on that color.

#6c63ff is rgb(108, 99, 255) and hsl(243, 100%, 69%). rgb(255, 0, 0) is #ff0000, and hsl(120, 100%, 25%) is #008000. White text on black has the highest possible contrast, 21:1.

FAQ

Which formats can I enter?

HEX as #abc, #aabbcc or #aabbccdd with alpha. RGB and HSL in the comma form rgb(1, 2, 3) or the modern CSS form rgb(1 2 3 / 50%). Three bare numbers without the function name also work.

Why does a round trip through HSL change the value slightly?

HSL is shown rounded to whole numbers, so converting it back to RGB can be off by one or two. Keep HEX or RGB as your source of truth when you need exact values.

How is the contrast ratio calculated?

With WCAG 2 relative luminance: (lighter + 0.05) ÷ (darker + 0.05). 4.5:1 passes AA for body text and 7:1 passes AAA. Transparency is ignored in the contrast check.