# Color Converter

> Color converter: HEX to RGB, RGB to HEX, HSL, HSV and CMYK in one place, with a colour picker and WCAG contrast ratio. Free, runs in your browser.

Source: https://widgetpantry.com/en/color-converter · Türkçe: https://widgetpantry.com/tr/renk-kodu-cevirici

Paste a colour code or pick one, and get its HEX, RGB, HSL, HSV and CMYK values at once. It also shows the colour's contrast ratio against white and black, graded by WCAG.

Runs in your browser: files and text are not uploaded. [Use the tool](https://widgetpantry.com/en/color-converter)

## How to use it

1. Type a code like #0A6B7C, rgb(10, 107, 124) or hsl(189, 85%, 26%), or use the colour picker.
2. Every format and a preview appear straight away.
3. Press Copy next to the format you need.

## Which format when?

HEX (#RRGGBB) and RGB are screen colours, the ones web pages and design tools use most. HSL and HSV describe a colour as hue, saturation and lightness or value, which makes it easy to find a lighter or more muted shade.

CMYK is for print. The CMYK values here come straight from a formula, without a colour profile: fine as a starting point, but for exact print colours convert with the profile your printer gives you.

The contrast ratio measures how readable text is. WCAG asks for at least 4.5:1 for normal text (AA) and 3:1 for large text; 7:1 and above is AAA.

## Frequently asked questions

### How do you convert HEX to RGB?

Each pair of characters in a HEX code is a base-16 number from 0 to 255 for red, green and blue. For #0A6B7C: 0A = 10, 6B = 107, 7C = 124, so rgb(10, 107, 124). Paste the code and the maths is done for you.

### Does it read three-digit HEX codes?

Yes. Short codes like #F00 are read by doubling each digit: #F00 = #FF0000.

### Is transparency (alpha) supported?

No. Only opaque colours are read, so that every format here can show them.

### What is the contrast ratio for?

It tells you whether text in this colour, or on it, will be readable. AA is the accessibility minimum for normal text.

## Related tools

- [Image Converter](https://widgetpantry.com/en/image-converter): Convert PNG, JPG and WebP images to each other in your browser: several files at once, adjustable quality. Your images are never uploaded.
- [Base64 Encode/Decode](https://widgetpantry.com/en/base64-encode-decode): Base64 encode and decode online: turn text into Base64 or Base64 back into text. UTF-8, emoji and base64url support. Runs in your browser.
- [JSON Formatter](https://widgetpantry.com/en/json-formatter): Online JSON formatter and validator: pretty-print, validate and minify JSON. Line and column for errors, 2/4-space or tab indentation, one-click copy.
