AIColors

FREE TOOL · AUTO-DETECT INPUT

Color Converter — HEX, RGB, HSL, HSV, CMYK, OKLCH

Paste a color in any format and read out every other format at once. Includes the closest CSS named color and copy-ready snippets for CSS variables, Tailwind, SCSS, Swift, Android, and Flutter.

#7C3AED

Detected: hex

Examples:

All color formats

HEX

#7C3AED

R 124 · G 58 · B 237

RGB

rgb(124, 58, 237)

124, 58, 237

HSL

hsl(262, 83%, 58%)

H 262.1° · S 83.3% · L 57.8%

HSV

hsv(262, 76%, 93%)

H 262.1° · S 75.5% · V 92.9%

CMYK

cmyk(48%, 76%, 0%, 7%)

C 48% · M 76% · Y 0% · K 7%

OKLCH

oklch(54.13% 0.2466 293.01)

L 0.541 · C 0.247 · H 293°

OKLab

oklab(54.13% 0.0964 -0.227)

L 0.541 · a 0.096 · b -0.227

CSS named color

bluevioletClosest match

Drop into your codebase

CSS variable
--brand: #7c3aed;
Tailwind arbitrary
bg-[#7c3aed] text-[#7c3aed]
SCSS variable
$brand: #7c3aed;
Swift UIColor
UIColor(red: 0.486, green: 0.227, blue: 0.929, alpha: 1.0)
Android Color
Color.parseColor("#7C3AED")
Flutter Color
Color(0xFF7C3AED)

Three steps to every format

1

Paste any color

Hex, rgb(), hsl(), hsv(), cmyk(), oklch(), oklab(), or a CSS name like "tomato" — we detect the format automatically and show you which one was matched.

2

Read every format at once

All seven formats render side by side with one-click copy. The numeric breakdown sits beneath each line so you don't need a calculator.

3

Drop into your codebase

Pre-rendered snippets for CSS variables, Tailwind arbitrary values, SCSS, Swift UIColor, Android Color, and Flutter Color save you the formatting work.

Pick the right tool

Which format should I actually use?

Most converters treat the formats as equal. They are not — each was designed for a different problem, and using the wrong one is how you end up with banding in dark mode or muddy colors in print.

HEX

Use for

Anything that gets handed between humans and machines: brand guidelines, Figma swatches, Slack pastes, configuration files.

Avoid for

Generating tints or shades programmatically — you cannot reason about lightness from a hex string.

RGB / RGBA

Use for

Working with pixel data, image manipulation, or any case where you need to inspect channel-by-channel.

Avoid for

Building accessible color scales — RGB has no concept of perceptual lightness.

HSL

Use for

Quick manual tweaks in code where you want to nudge a hue or pull saturation down.

Avoid for

Design tokens and color scales. HSL "lightness" is not perceptually uniform — 50% lightness yellow and 50% lightness blue look nothing alike in brightness.

HSV / HSB

Use for

Inside color-picker UIs, where users want hue/saturation control with a value slider for brightness.

Avoid for

CSS — HSV is not a valid CSS color function. Convert to HSL or OKLCH before shipping.

CMYK

Use for

Anything destined for a printing press: business cards, packaging, brochures.

Avoid for

Screen design entirely. CMYK has a smaller gamut than sRGB — vibrant on-screen colors will desaturate when converted for print.

OKLCH / OKLab

Use for

Design tokens, perceptually uniform color scales, dark-mode pairs, accessible palettes. The format CSS Color Module 4 is steering toward.

Avoid for

Older browsers without OKLCH support (Safari 15.4 and earlier) — provide an sRGB fallback via @supports or a build step.

Our take

Stop building palettes in HSL. Use OKLCH.

For two decades, designers built color scales by stepping HSL lightness from 10% to 90%. The result: yellow-50 looks washed out, blue-900 looks black, and the "neutral gray" between them looks vaguely green. The math says these are evenly spaced; your eyes say they are not.

OKLCH was built to fix exactly this. Its lightness axis is perceptually uniform — L 0.5 in red looks the same brightness as L 0.5 in blue, which means stepping by 0.05 produces a scale that actually reads as evenly spaced. Every modern design system that ships in 2026 — Tailwind v4, Radix, Material, even system colors on macOS Sonoma — is migrating to it.

Keep HEX for handoff and RGB for pixel work. But when you sit down to design a palette, switch to OKLCH. Your accessibility audits will improve overnight.

Frequently asked questions

Is this color converter free?
Yes — fully free, no signup, no ads, nothing uploaded. All conversion math runs locally in your browser.
What input formats does it accept?
Hex (3 or 6 digits, with or without #), rgb() / rgba(), hsl() / hsla(), hsv(), cmyk(), oklch(), oklab(), and any of the 147 CSS named colors. We detect the format automatically; you do not have to tell the tool which one you are pasting.
Why does the CMYK output look different from my print proof?
CMYK conversion depends on the printer's ink set, paper, and ICC profile. Our converter uses the naïve mathematical formula (no profile), which is fine as a starting point but should never be your final value for press. Get the exact CMYK values from your printer's color profile in Photoshop or Affinity.
What is OKLCH and why does it matter?
OKLCH is a perceptually uniform color space designed by Björn Ottosson in 2020 and adopted into CSS Color Module 4. Its lightness axis matches how your eyes actually perceive brightness, which makes it the right format for building color scales, accessible palettes, and design tokens. If you are starting a new design system in 2026, define your colors in OKLCH.
Does it support alpha / transparency?
The current version focuses on opaque colors. You can paste an rgba() or hsla() value with alpha and we will strip it during parsing. Full alpha-aware output is on our roadmap.
How is the closest CSS named color found?
We compare your color to all 147 CSS named colors in OKLab space and return the nearest neighbour. OKLab distance roughly correlates with human perception, so the suggestion is "looks closest" rather than "smallest RGB delta".
Can I share a converted color?
Yes. Click share and the page URL updates to include the color as a hash (#color=ff5733). Opening that URL loads the same conversion. The URL updates automatically as you type, too.
Where do the Swift / Android / Flutter snippets come from?
They are generated from the same hex value in the syntax each platform expects: UIColor with normalised floats for Swift, Color.parseColor with an ARGB hex string for Android, and the Color(0xFFRRGGBB) literal for Flutter. Copy-paste and they compile.

Pair with our other color tools