Color Converter & Palette Studio
Convert colors across HEX, RGB, HSL, HSV and CMYK spaces. Test WCAG 2.1 accessibility contrast and generate tints and shades in your browser. All processing happens locally in your browser.
Color Converter & Contrast Analyzer
Convert colors bidirectionally across HEX, RGB, HSL, HSV, and CMYK formats. Inspect WCAG 2.1 accessibility contrast and generate cohesive tints and shades.
Web Content Accessibility Guidelines (WCAG) 2.1 requires a minimum contrast ratio of 4.5:1 for regular body text and 3.0:1 for large text / UI elements (Level AA).
What is color conversion?
Digital displays, design tools, and printing systems describe and reproduce color in different ways. Color conversion translates a color between these representations so the same shade can be used in CSS, design software, image workflows, or print preparation.
Common color models include:
- RGB and HEX: Screens create color using red, green, and blue light. Each RGB channel typically ranges from
0to255. HEX represents those same RGB channel values using hexadecimal notation such as#225F73. - HSL and HSV/HSB: These models reorganize RGB values around hue, saturation, and lightness or brightness. They are often easier to work with when choosing colors, adjusting brightness, or creating related shades.
- CMYK: Printing commonly uses Cyan, Magenta, Yellow, and Black inks. The separate black channel helps produce cleaner dark tones and text while reducing the amount of colored ink needed for neutral blacks.
How to convert color codes
- Enter a color value Type or paste a supported color such as HEX, RGB, RGBA, HSL, HSV, CMYK, or a CSS named color.
- Choose a color visually Use the color picker to select a color and update the converted values.
-
Adjust transparency if needed
Use the alpha control to create transparent colors such as
#225F73CCorrgb(34 95 115 / 80%). - Check contrast Compare the selected color against white and black backgrounds to see how the combination performs against common WCAG contrast thresholds.
- Copy the format you need Copy the converted HEX, RGB, HSL, HSV, or CMYK value, or choose a lighter or darker variation from the generated palette.
Color format comparison
Different formats are useful for different workflows. This table shows how the most common color formats represent the same kind of visual information.
| Format | Example | Values | Common use |
|---|---|---|---|
| HEX | #225F73 |
Red, Green, Blue as hexadecimal values from 00 to FF |
CSS, HTML, SVG, and design tokens |
| 8-digit HEX | #225F73CC |
Red, Green, Blue, and Alpha | CSS colors with transparency |
| RGB | rgb(34, 95, 115) |
Red, Green, Blue from 0 to 255 |
CSS, Canvas, JavaScript, image processing |
| RGBA | rgba(34, 95, 115, 0.8) |
RGB values plus alpha from 0 to 1 |
CSS colors with transparency |
| Modern RGB syntax | rgb(34 95 115 / 80%) |
Space-separated RGB channels with optional slash alpha | Modern CSS color declarations |
| HSL | hsl(195, 54%, 29%) |
Hue 0–360°, Saturation 0–100%, Lightness 0–100% |
Theme design, color adjustments, UI states |
| HSV / HSB | H 195°, S 70%, V 45% |
Hue, Saturation, Value/Brightness | Color pickers and visual design tools |
| CMYK | C 70%, M 17%, Y 0%, K 55% |
Cyan, Magenta, Yellow, Black from 0–100% |
Print preparation and reference conversions |
Color conversion examples
These examples show how several colors can be represented in HEX, RGB, HSL, and approximate CMYK values.
| Color | HEX | RGB | HSL | Approx. CMYK |
|---|---|---|---|---|
| Deep Teal | #225F73 |
rgb(34, 95, 115) |
hsl(195, 54%, 29%) |
70%, 17%, 0%, 55% |
| Warm Gold | #DA8F1D |
rgb(218, 143, 29) |
hsl(36, 77%, 48%) |
0%, 34%, 87%, 15% |
| Tomato | #FF6347 |
rgb(255, 99, 71) |
hsl(9, 100%, 64%) |
0%, 61%, 72%, 0% |
| Emerald | #10B981 |
rgb(16, 185, 129) |
hsl(160, 84%, 39%) |
91%, 0%, 30%, 27% |
CMYK values shown by mathematical converters should be treated as approximate references rather than final production-print specifications.
How HEX converts to RGB
A 6-digit HEX color contains three pairs of hexadecimal digits. The pairs represent red, green, and blue values.
HEX: #225F73
22 → Red
5F → Green
73 → Blue
Red:
(2 × 16) + 2 = 34
Green:
(5 × 16) + 15 = 95
Blue:
(7 × 16) + 3 = 115
Result:
rgb(34, 95, 115)
HEX and RGB can represent the same 24-bit color directly, so converting a normal 6-digit HEX value to RGB does not change the color.
How RGB converts to HSL
RGB values are first normalized from 0–255 to a range from 0–1:
R' = R / 255
G' = G / 255
B' = B / 255
The maximum and minimum normalized channels are then used to calculate lightness, saturation, and hue.
- Lightness:
L = (Cmax + Cmin) / 2 - Saturation: If all channels are equal, saturation is
0%. Otherwise it is calculated from the difference between the maximum and minimum channel values. - Hue: Hue depends on which RGB channel is the largest and is expressed as an angle from
0°to360°.
HSL is especially useful when you want to keep a similar hue while changing how light, dark, vivid, or muted a color appears.
How RGB converts to CMYK
A simple mathematical RGB-to-CMYK conversion first normalizes the RGB channels and calculates the black component:
K = 1 - max(R', G', B')
C = (1 - R' - K) / (1 - K)
M = (1 - G' - K) / (1 - K)
Y = (1 - B' - K) / (1 - K)
For pure black, where K = 1, Cyan, Magenta, and Yellow can be treated as 0 in this simple mathematical model.
Important: This formula provides an approximate CMYK conversion. Professional printing normally uses ICC color profiles because the final CMYK values depend on the printer, ink, paper, and printing process.
Alpha transparency and 8-digit HEX
Standard 6-digit HEX uses the form #RRGGBB. An 8-digit HEX color adds an alpha channel at the end:
#RRGGBBAA
The alpha pair ranges from 00 for fully transparent to FF for fully opaque.
| Opacity | Alpha HEX | Example |
|---|---|---|
| 100% | FF |
#225F73FF |
| 80% | CC |
#225F73CC |
| 50% | 80 |
#225F7380 |
| 25% | 40 |
#225F7340 |
| 0% | 00 |
#225F7300 |
The same transparency can also be written using CSS syntax such as rgb(34 95 115 / 50%).
Why RGB colors can look different in print
RGB displays and CMYK printing reproduce different ranges of color. Some bright RGB colors cannot be reproduced exactly using a particular combination of printer, ink, and paper, so the printed result may look less saturated or slightly different from the screen version.
The mathematical CMYK values produced by a browser color converter are useful as an initial reference, but they are not a substitute for a color-managed print workflow.
For important print work: Use the ICC profile recommended by your printer and request a proof before a large production run. Spot-color systems may also be useful when exact brand-color reproduction is required.
Color contrast and WCAG accessibility
Text needs enough contrast against its background to remain readable. WCAG uses a contrast ratio ranging from 1:1 for identical colors to 21:1 for the highest possible black-and-white contrast.
- Normal text: A contrast ratio of at least 4.5:1 is commonly required for WCAG Level AA.
- Large text: A ratio of at least 3:1 is commonly required for Level AA.
- Enhanced contrast: Level AAA uses higher thresholds of 7:1 for normal text and 4.5:1 for large text.
- UI components: Visual information needed to identify interactive components and their states generally requires at least 3:1 contrast against adjacent colors.
The contrast checker compares the selected color with white and black backgrounds and shows whether those specific combinations meet common WCAG contrast thresholds.
A passing contrast ratio for one background does not mean the color will be accessible in every interface. Font size, weight, surrounding colors, and interaction states also matter.
Practical use cases for a color converter
- CSS development: Convert HEX values from a design file into RGB, HSL, or transparent CSS colors.
- Theme creation: Adjust hue, saturation, and lightness when creating hover, focus, active, and disabled states.
- Design handoff: Compare values used by design software with formats required by a website or application.
- Print reference: Generate an approximate CMYK starting point before moving into a color-managed print workflow.
- Accessibility checks: Compare foreground colors with common light and dark backgrounds before using them for text or interface elements.
- Palette generation: Create lighter and darker variations of a base color for related UI elements.
Browser-based execution and privacy
Color parsing, format conversion, contrast calculations, and palette generation run entirely in your browser. The tool guarantees full privacy because no color values or design tokens are ever transmitted to an external server.
Frequently Asked Questions
Why can CMYK look different from RGB?
RGB screens and CMYK printing systems reproduce different ranges of color. Some bright screen colors cannot be reproduced exactly using a particular printer, ink, and paper combination. Browser-based CMYK conversions should therefore be treated as approximate references rather than final print-production values.
What is the difference between HSL and HSV or HSB?
Both represent color using hue and saturation, but the third value works differently. HSL uses lightness, where 0% is black and 100% is white. HSV or HSB uses value or brightness, where 100% represents the brightest version available for the selected hue and saturation.
How does 8-digit HEX work?
An 8-digit HEX color uses the format #RRGGBBAA. The final two hexadecimal digits represent alpha transparency, from 00 for fully transparent to FF for fully opaque. For example, #225F7380 represents approximately 50% opacity.
What does the modern rgb() space-and-slash syntax mean?
Modern CSS allows RGB channels to be separated by spaces and uses a slash before the alpha value. For example, rgb(34 95 115 / 80%) represents the same basic idea as an RGB color with 80% opacity.
Does converting between HEX and RGB change the color?
No. A standard 6-digit HEX value and an RGB value can represent the same three 8-bit red, green, and blue channels. Converting between them changes the notation, not the underlying color values.
What contrast ratio is recommended for WCAG Level AA?
For normal text, WCAG Level AA commonly requires a contrast ratio of at least 4.5:1. Large text commonly requires at least 3:1. The required result applies to a specific foreground and background color combination.
How are color tints and shades calculated?
Tints are created by moving a base color toward white, while shades move it toward black. The generated swatches provide progressively lighter and darker variations of the selected color.