Color Format Converter
100% LocalConvert colors between HEX, RGB, RGBA, HSL, HSV, CMYK, and CSS named colors.
Color Converter
8 formats#3B82F6#3B82F6FFrgb(59, 130, 246)rgba(59, 130, 246, 1)hsl(217, 91%, 60%)hsla(217, 91%, 60%, 1)hsv(217, 76%, 96%)cmyk(76%, 47%, 0%, 4%)No close matchEnter a color in any format (HEX, RGB, HSL, OKLCH). All other formats update as you type.
What is Color Format Converter?
Frequently Asked Questions
Technical Deep Dive
Color Format Converter
Convert any color between HEX, HEX8 (with alpha), RGB, RGBA, HSL, HSLA, HSV, and CMYK formats instantly. Includes alpha channel control, WCAG contrast ratio against white/black, closest CSS named color matching, and a 10-color history. All conversions are computed client-side with pure JavaScript math.
Two-Way Conversion
Convert in either direction with consistent semantics on the round-trip.
Type-Faithful
Preserves nulls, numbers, booleans, and structure, no string-soup translation.
Production-Sized
Built to handle real-world payloads, not just textbook examples.
01 Color Space Comparison Matrix
| Format | Coordinate Basis | Design Utility | Transparency |
|---|---|---|---|
HEX | Red, Green, Blue | Standard Web (Compact) | Optional (HEX8) |
HSL | Hue, Sat, Lightness | Systematic Palettes | Yes (HSLA) |
HSV | Hue, Sat, Value | Design Tool Native | No |
CMYK | Cyan, Mag, Yel, Blk | Print Production | No |
02 Perceptual Contrast Workflow
(L1 + 0.05) / (L2 + 0.05) formula.
03 Where Format Conversion Actually Happens
Format conversion is rarely about curiosity, it is about moving a color from one tool's vocabulary into another's without losing information. These are the daily collisions where this converter pays for itself.
-
Figma's rgba() → CSS Custom Property Figma's inspector emits
rgba(59, 130, 246, 1). Your design system stores tokens as HEX (or modern HSL/OKLCH). Paste, copy the format you need, paste into--color-primary. No mental math, no truncation. -
OKLCH → HEX for Older-Browser Fallbacks You author tokens in OKLCH because it is perceptually uniform. But Safari before 16.4 and any browser used by enterprise IT departments needs a HEX fallback. The converter gives you the matching sRGB hex for the
@supports not (color: oklch(...))branch. -
HEX → HEX8 (#RRGGBBAA) Adding transparency to an existing hex without switching to rgba(): take
#3B82F6and 80% opacity, and out comes#3B82F6CC. Useful when an existing CSS file uses hex everywhere and you want consistency. -
Tailwind Arbitrary-Value Syntax Tailwind accepts
bg-[#3b82f6],bg-[rgb(59_130_246)], orbg-[hsl(217_91%_60%)], note the space-separated syntax. The converter outputs Tailwind-ready strings (no commas) so they paste straight into JSX without escaping. -
CMYK Approximation for Print Drafts Marketing wants a print PDF that "matches the web color." Naive CMYK conversion is wrong for press-ready work, but it is the right starting estimate before a designer takes it into Illustrator with a real ICC profile.
04 Worked Examples
#3b82f6
HEX #3b82f6
RGB rgb(59, 130, 246)
HSL hsl(217, 91%, 60%)
OKLCH oklch(0.62 0.19 259)
All four describe the exact same sRGB pixel. The differences are how easy each is to edit, HSL for hue/saturation tweaks, OKLCH for perceptually-uniform lightness ramps, HEX for compactness.
rgba(59, 130, 246, 0.8) /* the classic /#3b82f6cc /same color, hex syntax /
HEX8 is supported in all modern browsers since 2017. Prefer it when your codebase uses hex everywhere, keeps the file visually consistent and lets you grep for color values with one pattern.
#3b82f6 → hsl(217.218, 91.220%, 59.804%)
→ hsl rounded to "hsl(217, 91%, 60%)"hsl(217, 91%, 60%) → #3c83f6 /off by one in R */
HSL stores three integer-ish percentages; HEX stores three bytes. Rounding the middle representation shifts the endpoints by 1-2 channel values. If you need lossless round-trips, store the original hex alongside the editable HSL.
05 Related Tools
Conversion is upstream work. Once you have the format your codebase wants, these adjacent tools handle palette generation, accessibility, and Tailwind integration.
Color Palette Generator
Take a converted base color and explode it into a full 50-950 scale, monochromatic ramp, or complementary set in one click.
Color Contrast Checker
After conversion, validate the color against its background, converting doesn't change accessibility, but you finally have it in a comparable format.
CSS to Tailwind Converter
Convert whole stylesheet blocks (including converted colors) into Tailwind utility classes in one paste.