Skip to content

Color Converter

Convert colors between HEX, RGB, HSL, HSV and CMYK, and check their contrast against white and black.

HEX, rgb() or hsl() — for example #0F1B4C, rgb(15, 27, 76) or hsl(228, 67%, 18%).

Formats

HEX

#FF6B1A

HEX
#FF6B1A
RGB
rgb(255, 107, 26)
HSL
hsl(21, 100%, 55%)
HSV
hsv(21, 90%, 100%)
CMYK
cmyk(0%, 58%, 90%, 0%)

Text contrast (WCAG)

With white text: 2.85:1AA failAAA fail
With black text: 7.37:1AA passAAA pass

Runs in your browser — nothing you enter is sent to a server.

How the Color Converter works

Type a color in any common format — HEX such as #FF6B1A, rgb(255, 107, 26) or hsl(21, 100%, 55%) — or choose one with the color picker. Every other format updates instantly, each with its own copy button.

The tool also measures how readable white and black text would be on that color, using the WCAG contrast ratio: 4.5:1 is the minimum for normal text (AA) and 7:1 the enhanced level (AAA).

Formulas

HEX to RGB

#RRGGBB → (RR16, GG16, BB16)

Each pair of hexadecimal digits is one channel from 0 to 255: FF = 255, 6B = 107, 1A = 26.

Contrast ratio

(L1 + 0.05) ÷ (L2 + 0.05)

Where:

L1
Relative luminance of the lighter color
L2
Relative luminance of the darker color

Examples

#0F1B4C in other formats

rgb(15, 27, 76) · hsl(228, 67%, 18%) · cmyk(80%, 64%, 0%, 70%) — and white text on it has a contrast of 16.39:1.

Short HEX codes

#F60 is shorthand for #FF6600: each digit is doubled.

Frequently asked questions

What's the difference between HSL and HSV?

Both describe color by hue and saturation. HSL uses lightness, where 100% is always white; HSV uses value (brightness), where 100% is the most vivid version of the color. Design tools often show HSV; CSS uses HSL.

Is the CMYK value exact for printing?

No. It's the standard mathematical conversion, useful as a starting point. Real printed color depends on the printer, ink and paper profile, so check with your printer for accurate CMYK values.

Does it support transparency?

Yes. Enter 8-digit HEX (#0F1B4C80), rgba() or a slash alpha such as rgb(15 27 76 / 50%), and the alpha value is kept in the HEX, RGB and HSL outputs.

Unit Converter

Convert length, weight, temperature, area, volume, speed, time, data storage, pressure and energy units instantly.

Converters

QR Code Generator

Turn a link or text into a QR code and download it as SVG or PNG, with custom colors.

Generators