Color Converter
Paste a colour in any notation and get every other one back, plus tints, shades and harmony palettes and a contrast check that tells you straight out whether text will be readable.
🎨 Pick a colour
HEX, rgb(), hsl() or a CSS name — #1e90ff, rgb(30 144 255), hsl(210 100% 56%), dodgerblue.
The picker has no alpha channel — use the slider below for transparency.
1 is fully opaque, 0 fully transparent. — 1
🔁 Every format
| Format | Value | Copy |
|---|---|---|
| HEX | #1e90ff | |
| HEX + alpha | #1e90ffff | |
| RGB | rgb(30, 144, 255) | |
| RGBA | rgba(30, 144, 255, 1) | |
| HSL | hsl(210, 100%, 55.9%) | |
| HSLA | hsla(210, 100%, 55.9%, 1) | |
| HSV | hsv(210, 88.2%, 100%) | |
| CMYK | cmyk(88%, 44%, 0%, 0%) | |
| CSS name | dodgerblue |
🧪 Palettes
Click any swatch to make it the current colour.
🤍 Tints (mixed with white)
🖤 Shades (mixed with black)
↔️ Complementary
🎚️ Analogous
🔺 Triadic
🔻 Split complementary
👁️ Contrast checker
Any colour value. Falls back to white if it cannot be read.
How to use the colour converter
- Enter a colour in any supported notation — a HEX code,
rgb(),hsl()or a CSS name likedodgerblue. The native colour picker is there if you would rather choose visually. - Set the alpha with the slider if you need transparency. It feeds the RGBA, HSLA and eight-digit HEX outputs.
- Copy what you need. Every format has its own copy button, so you can take
hsl()for CSS and CMYK for a print brief without retyping anything. - Browse the palettes. Tints, shades, complementary, analogous, triadic and split-complementary sets are generated live; click any swatch to make it the current colour and carry on from there.
- Check the contrast. Compare against white, black or any custom background, read the AA and AAA badges, and look at the live text sample.
How the conversions work
All formats are stored internally as RGBA and converted on demand, which is why every round-trip comes back to the same HEX code.
| Format | Range | Notes |
|---|---|---|
| HEX | #000000 – #ffffff |
3, 4, 6 and 8 digits all accepted |
| RGB | 0–255 per channel | Percentages like rgb(100% 0% 0%) also work |
| HSL | H 0–360, S and L 0–100% | Cylindrical, easy to lighten or darken |
| HSV | H 0–360, S and V 0–100% | Common in colour pickers |
| CMYK | 0–100% each | Subtractive, approximate for screens |
| Name | 148 CSS keywords | rebeccapurple, tomato, cornflowerblue… |
Contrast follows the WCAG definition. Each sRGB channel is linearised — divided by 12.92 below the 0.04045 threshold, otherwise raised to the power 2.4 after a gamma offset — and combined into a relative luminance with the weights 0.2126, 0.7152 and 0.0722. The ratio is then the lighter luminance plus 0.05 divided by the darker plus 0.05.
L = 0.2126 R + 0.7152 G + 0.0722 B
ratio = (L1 + 0.05) / (L2 + 0.05)
That is why the range is 1 to 21: black has a luminance of 0 and white of 1, giving 1.05 ÷ 0.05 = 21.
Worked examples
Dodger blue. #1e90ff is rgb(30, 144, 255), hsl(210, 100%, 55.9%) and hsv(210, 88.2%, 100%), and it has an exact CSS name: dodgerblue. Against white it manages only 3.24:1, which fails AA for body text but passes for large text. Against black it reaches 6.49:1.
The classic grey. #777777 on white is 4.48:1 — just under the 4.5:1 AA threshold for body text, which is exactly the kind of near-miss the badges are there to catch. Darkening it to #767676 pushes it over.
Maximum contrast. #ffffff against #000000 is 21:1, the highest possible value and the reason it is used as the reference point.
Shorthand and alpha. #f00 expands to #ff0000, and #ff000080 is the same red at roughly 50% alpha — rgba(255, 0, 0, 0.502). The eight-digit form is the compact way to write a translucent colour in CSS.
A harmony set. Starting from pure red, the complementary colour is cyan #00ffff, the triad is red, #00ff00 and #0000ff, and the analogous pair is #ff0080 and #ff8000. All of them are simple hue rotations with saturation and lightness untouched.
Tips and common mistakes
- Do not judge contrast by eye. Mid-tone greys and saturated blues both look more readable than they measure. Check the number.
- Large text is 18.66px bold or 24px regular. Below that, the 4.5:1 threshold applies rather than 3:1.
- Contrast is not the whole of accessibility. Colour alone should never carry meaning: pair it with a label, an icon or a pattern for anyone who cannot distinguish the hues.
- Work in HSL for variations. Changing lightness by ten per cent gives a predictable hover state; nudging a HEX code by hand rarely does.
- CMYK values are indicative. Rich blacks, spot colours and paper stock all move the result. Ask the printer for a proof.
- Watch out for HSL rounding.
hsl(210, 100%, 55.9%)andhsl(210, 100%, 56%)are different colours by one unit of blue. Copy the value rather than retyping it.
Glossary
- Alpha – opacity from 0 (invisible) to 1 (solid).
- Relative luminance – perceived brightness on a 0–1 scale, used for contrast maths.
- Tint / shade – a colour mixed with white or with black.
- Complementary – the colour directly opposite on the wheel, 180 degrees away.
- Gamut – the set of colours a device can actually reproduce; CMYK’s is smaller than sRGB’s.
Privacy
Everything runs in your browser. Colour values are converted in JavaScript on this page — nothing is uploaded, logged or stored, and no palette you build here is visible to anyone but you.
Frequently asked questions
What does the contrast ratio mean?
It compares the relative luminance of two colours on a scale from 1:1 (identical) to 21:1 (black on white). WCAG asks for at least 4.5:1 for body text and 3:1 for large text at level AA, and 7:1 and 4.5:1 respectively at level AAA.
Why is my HSL value slightly different from another tool's?
Rounding. HSL stores hue in degrees and saturation and lightness as percentages, and most tools round them for display. Converting the rounded values back to RGB can shift a channel by one. This page rounds only the displayed strings and keeps full precision internally, so its round-trips land on the same HEX code.
Is CMYK here the same as my printer's?
No, and no on-screen converter can be. This uses the standard arithmetic conversion from RGB, which ignores ink, paper and the printer's colour profile. Treat it as a starting point and always trust a proof over a screen.
How does alpha work in HEX?
An eight-digit HEX code appends a two-digit alpha byte, so `#ff000080` is red at about 50% opacity. Four-digit codes are the shorthand version, where `#f008` expands to `#ff000088`. Both are supported here and in every current browser.
What are tints, shades and analogous colours?
A tint mixes a colour with white and a shade mixes it with black, which is the simplest way to build a scale from one brand colour. Analogous colours sit 30 degrees either side on the colour wheel, triadic colours 120 degrees apart, and the complementary colour directly opposite at 180 degrees.
Does a translucent colour have a contrast ratio?
Not on its own. A ratio is only defined between two opaque colours, so the checker composites your colour over the background first and measures the flattened result. Change the background and the ratio changes with it.
Related tools
- QR Code GeneratorMake a QR code for a link, your Wi-Fi password, a contact card or a text message. The code is drawn in your browser and contains your data directly — no redirect, no account, no expiry.
- HEIC to JPG Converter (and Everything Else)Turn iPhone HEIC photos into JPG in seconds, or convert between PNG, WebP, AVIF and more. Files are decoded on your own device and never uploaded.
- Password GeneratorBuild a random password or a memorable passphrase with real cryptographic randomness. Entropy, strength and crack time are shown for the exact options you picked — and nothing ever leaves your browser.
- JSON Formatter & ValidatorPaste JSON, get it beautified, minified or validated with the exact line and column of the problem. Everything runs in your browser.
- Cron Expression GeneratorWrite a cron expression in Unix, Spring or Quartz form, read what it actually means in English, and see the next ten fire times in UTC and your local time.
- Base64 Encoder & DecoderConvert text, files and data URIs to and from Base64 with correct UTF-8 handling, a URL-safe option and MIME line wrapping. Nothing is uploaded.
Last reviewed: