Design

Color Converter

Translate the same color into HEX, HEXA, RGB, RGBA, HSL, HWB, Lab, LCH, OKLab, and OKLCH, plus wider gamut spaces such as Display P3, Rec. 2020, and CMYK. Paste a single value and see the live preview and every equivalent format at once, with all parsing happening locally in your browser. The tool is built for frontend development, design handoff, theming, brand-color governance, cross-device calibration, and print collaboration.

  • Common CSS color values and modern color spaces are listed side by side for easy comparison
  • Live parsing keeps the preview and text output in sync so syntax errors stay visible
  • Common and advanced formats are grouped instead of dumped together, so you find what you need
  • Alpha transparency is preserved across HEXA, RGBA, HSLA, and modern slash-alpha syntax
  • Color parsing runs locally in the browser, suitable for unreleased brand colors and internal assets
tools/Color Converter

Supports HEX, HEXA, RGB, RGBA, HSL, HWB, Lab, LCH, OKLab, and OKLCH, plus several advanced color spaces.

30 formats
Common formats
HEX
#6366f1
RGB
rgb(99, 102, 241)
HSL
hsl(238.73, 83.53%, 66.67%)
HSV
hsv(239deg 58.9% 94.5%)
HWB
hwb(239deg 38.8% 5.5%)
Lab
lab(49.05% 30.34 -71.87)
LCH
lch(49.05% 78.017 293deg)
OKLab
oklab(58.540% 0.0253 -0.2025)
OKLCH
oklch(58.540% 0.2041 277deg)
CMYK
cmyk(58.9% 57.7% 0.0% 5.5%)
Advanced color spaces
HSI
HSI(s: 0.32805, i: 0.57778, h: 238.73239)
Linear sRGB
Linear sRGB(r: 0.12477, g: 0.13287, b: 0.87962)
Display P3
Display P3(r: 0.39036, g: 0.39962, b: 0.91264)
Adobe RGB 1998
Adobe RGB 1998(r: 0.39139, g: 0.39941, b: 0.92821)
ProPhoto RGB
ProPhoto RGB(r: 0.44576, g: 0.35254, b: 0.87046)
Rec. 2020
Rec. 2020(r: 0.3828, g: 0.35567, b: 0.89583)
XYZ D50
XYZ D50(x: 0.23144, y: 0.17633, z: 0.64277)
XYZ D65
XYZ D65(x: 0.25772, y: 0.18506, z: 0.85436)
Lab D65
Lab D65(l: 50.10376, a: 38.69554, b: -70.48412)
LCH D65
LCH D65(l: 50.10376, c: 80.40743, h: 298.76663)
Luv
Luv(l: 49.04853, u: -10.52483, v: -100.606)
LCHuv
LCHuv(l: 49.04853, c: 101.15503, h: 264.02776)
DIN99o Lab
DIN99o Lab(l: 54.20065, a: 20.19273, b: -35.9358)
DIN99o LCh
DIN99o LCh(l: 54.20065, c: 41.22049, h: 299.33212)
Jzazbz
Jzazbz(j: 0.12176, a: -0.00845, b: -0.12512)
JzCzhz
JzCzhz(j: 0.12176, c: 0.12541, h: 266.1376)
ICtCp
ICtCp(i: 0.42269, t: 0.18478, p: -0.07095)
XYB
XYB(x: -0.00028, y: 0.42171, b: 0.24005)
YIQ
YIQ(y: 0.45889, i: -0.18243, q: 0.16712)
Cubehelix
Cubehelix(l: 0.45643, s: 1.00084, h: -124.06588)
Quick actions

Overview

Paste once and walk away with every common CSS value plus modern spaces such as OKLCH, so the same color stops drifting between palette tools, design files, CSS variables, and documentation.

  1. 01

    Multiple CSS formats at once

    HEX, RGB, and HSL appear alongside HWB, Lab, LCH, OKLab, and OKLCH, so you can pick the syntax that fits the surrounding code.

  2. 02

    Flexible input parsing

    Six-digit HEX, eight-digit HEXA, comma-separated RGB, space-separated HSL, and slash-alpha OKLCH are all recognized without manual cleanup.

  3. 03

    Alpha kept intact

    When transparency is provided, the alpha channel flows through to HEXA, RGBA, HSLA, and OKLCH outputs without being silently dropped.

  4. 04

    Advanced color spaces grouped

    Display P3, Rec. 2020, Adobe RGB, ProPhoto, XYZ, and Jzazbz are grouped together for wide-gamut review, cross-device calibration, and print handoff.

  5. 05

    Live preview next to text output

    A swatch updates as you type, making it easy to catch unreadable colors or hand-off mismatches before you copy anything.

  6. 06

    Per-row copy controls

    Each row has its own copy button, so you can take HEX where you need HEX and OKLCH where you need OKLCH, without selecting around brackets.

How to use

From pasting a value to copying the target format, the whole flow happens in one panel, suitable for quick checks and for moving back and forth between design and code.

  1. 01

    Paste or type a color in the input field, for example a HEX from the design file or an OKLCH from a spec.

  2. 02

    Look at the preview swatch and confirm it matches the source design or the intended result.

  3. 03

    Browse the common and advanced groups and find the syntax that fits the current context.

  4. 04

    Press the copy button on that row and paste the normalized value into CSS, tokens, or documentation.

  5. 05

    When you want to try a different value, click a sample color or clear the field and repeat.

Details

A single panel covers everyday color conversion, alpha handling, design-token alignment, and cross-device color communication, without forcing you to open extra palette or color-management tools.

  • Online color converter for HEX, RGB, HSL, HWB, Lab, LCH, OKLab, and OKLCH in one pass
  • Flexible input parsing, including comma, space, and slash-alpha syntaxes
  • Common and advanced color spaces grouped, so you can scan only what you need
  • Live color preview that surfaces parsing errors and visual mismatches early
  • Per-row copy buttons that take only the exact value you need
  • Alpha kept intact across HEXA, RGBA, HSLA, and OKLCH outputs
  • Built-in sample colors for quick syntax checks and demos
  • Bridges design files and frontend tokens, reducing manual conversion steps
  • Supports theme maintenance for primary, accent, and state colors
  • Supports brand-color governance with a shared, normalized reference
  • Pairs with Display P3 and Rec. 2020 output for wide-gamut review
  • Includes CMYK output for print, packaging, and offline collaboration

Use cases

When a color has to travel from a design file into CSS, tokens, documentation, interface states, and marketing assets, having one clean reference keeps everyone aligned about which value actually represents that color.

  1. Design handoff to frontend

    Translate colors picked from a design tool into whichever format your codebase prefers, without recomputing HSL or OKLCH by hand.

  2. Design tokens and CSS variables

    Generate multiple equivalent values for the same semantic name and choose the one that fits your token convention.

  3. Theme system maintenance

    Audit primary, accent, and state colors across light, dark, and seasonal themes by comparing their equivalent values.

  4. Brand color governance

    Make sure the same brand color does not show up as two different values across design files, docs, and product code.

  5. Component library expansion

    Quickly explore hover, active, disabled, info, and warning variants by adjusting lightness or chroma in HSL or OKLCH.

  6. Wide-gamut and cross-device review

    Cross-check Display P3, Rec. 2020, and Adobe RGB values when colors need to look correct across screens and content pipelines.

  7. Campaign and marketing pages

    Translate one-off campaign colors into the formats allowed by the design system without breaking the existing palette.

  8. Accessibility refinement

    Normalize foreground and background values first, then verify the real combination with a contrast checker.

  9. Print and packaging handoff

    Convert on-screen colors into CMYK so print, packaging, and offline assets stay visually aligned with the digital product.

  10. Data visualization palettes

    Chart series colors, status colors, and accent values often live in different libraries and configs. Normalizing them through the same syntax first keeps neighboring charts in a dashboard from clashing.

See also

After converting a brand color or design token, use Palette Generator to expand it into a usable scale for surfaces, buttons, and state layers. Before that color lands in real text, buttons, or badges, run the actual pairing through Contrast Checker so the value is not just correct on paper but also readable on screen.

Color format reference

The main formats this tool produces, with concise definitions and typical examples. The table is not a replacement for the W3C specs, but it covers the formats that show up across day-to-day frontend, design, and brand work.

Format Description Example
HEX Hexadecimal red, green, and blue channels. Compact and very common in design tokens and CSS variables. #6366f1
HEXA HEX with an alpha channel appended. Useful when you need a single concise value that includes transparency. #6366f180
RGB Decimal red, green, and blue channels. Easy to adjust per channel and to assemble from a script. rgb(99, 102, 241)
RGBA RGB with alpha transparency. Common for overlays, focus states, shadows, and layered UI surfaces. rgba(99, 102, 241, 0.6)
HSL Hue, saturation, and lightness. Closer to how designers reason about color and palette variants. hsl(239 84% 67%)
HSLA HSL with alpha transparency, useful for semitransparent theme colors that still need readable semantics. hsl(239 84% 67% / 0.6)
HSV Hue, saturation, and value. Matches the model used by many color pickers, though its lightness differs from HSL. hsv(239 59.3% 94.5%)
HWB Hue, whiteness, and blackness. Useful for quickly tinting or shading a base color without leaving the hue. hwb(239 39% 5%)
Lab Perceptually uniform space. Useful for measuring color distance, tuning brand tolerances, and fine-grained calibration. lab(53.59% 22.06 -66.53)
LCH Cylindrical Lab using lightness, chroma, and hue. Helpful for directional hue rotation and chroma control. lch(53.59% 70.10 288deg)
OKLab Modern perceptual model with smoother interpolation behavior than legacy Lab in digital interfaces. oklab(58.56% 0.0255 -0.1639)
OKLCH Cylindrical OKLab. Increasingly used to build theme ramps, brand families, and controlled gradients. oklch(58.56% 0.1659 278deg)
CMYK Cyan, magenta, yellow, and black ink channels. Used to communicate color to print, packaging, and offline collaborators. cmyk(58.9% 56.8% 0% 5.5%)

Best practices

Color conversion is only the first step. Pair it with naming conventions, contrast checks, and visual regression so the converted values land safely in real products.

  • Pick one primary format per team, for example HEX for tokens and OKLCH for theme expression, to reduce drift.
  • Document the origin and intent next to each design token, so brand colors stay traceable through reuse.
  • Validate light and dark themes separately for contrast and legibility, not just one mode.
  • Use visual regression or screenshot diffs after color updates on key pages, so a single change does not regress others.
  • Treat color conversion and accessibility contrast as two separate steps, and run contrast checks after normalization.
  • Roll out large palette migrations gradually, starting from a few key pages before applying them site-wide.
  • Keep the designer-facing semantic name and the engineering-facing token name in the same document, to reduce cross-role friction.

Limitations

Color conversion is deterministic math, but the final appearance still depends on the display, the rendering pipeline, and the design intent, so the output should be validated in real conditions.

  • The same value can look different across monitors, and calibration differences make the gap larger.
  • Some advanced color spaces have limited support in older browsers and rendering engines, so target environments still matter.
  • Color normalization does not replace visual contrast, color-blindness, or full accessibility review.
  • A brand color in real use also depends on interaction state, font size, surrounding whitespace, and context, not just the value itself.
  • Back up before bulk-replacing legacy palette values, and verify a few key pages before site-wide rollout.
  • A value being technically correct does not guarantee the visual hierarchy is right, so important pages still need design review.
  • For print, the rendered CMYK depends on inks, paper, and process, so the tool output is a starting point for collaboration.

FAQ

Questions that come up most often during frontend implementation, design handoff, and brand collaboration when working with color conversion.

Which formats does the color converter support?

HEX, HEXA, RGB, RGBA, HSL, HSLA, HWB, Lab, LCH, OKLab, OKLCH, HSV, and CMYK are all produced, along with advanced color spaces such as Display P3, Rec. 2020, Adobe RGB, ProPhoto, XYZ, and Jzazbz.

Why does my color value fail to parse?

Most issues are syntax problems, for example a missing hash, an unclosed parenthesis, smart quotes, the wrong separator, an incorrect unit, or a channel value out of range. The hint below the input lists the supported formats.

Is my color sent to a server?

No. Parsing and formatting happen entirely in your browser, which makes the tool safe for unreleased brand colors, internal assets, and confidential design files.

Can I paste the output directly into CSS?

Yes. Each row is a valid CSS color value following current syntax, so you can drop it straight into a stylesheet, a design token file, or a CSS variable.

How is transparency handled?

When the input includes alpha (HEXA, RGBA, HSLA, or slash-alpha modern syntax such as oklch(70% 0.16 250 / 0.8)), every alpha-aware output updates accordingly.

When do I actually need advanced color spaces?

Wide-gamut monitor calibration, cross-device color management, fine brand-color control, HDR content review, and professional visual evaluation all benefit from spaces beyond sRGB.

Why does the same color look different on different devices?

Monitors differ in gamut, brightness, temperature, and calibration, and browser color management is not uniform either, so important cases should be reviewed on the actual target device.

Is this tool also useful for designers?

Yes. When moving from design files into engineering, having one normalized reference value reduces ambiguity and rework on both sides.

Should I prefer HEX or RGB?

Both are common. HEX is concise and standard in tokens; RGBA is more convenient when transparency control or channel-level scripting matters.

What is the core difference between HSL and RGB?

RGB is device oriented and easy to compute with, while HSL is design oriented and easier to use for hue, saturation, and lightness adjustments.

When is OKLCH a better choice?

OKLCH usually produces more visually consistent results when building theme ramps, brand color families, controlled gradients, and cross-hue palettes.

Do Lab and LCH matter in production web projects?

Yes, especially for controlled color distance, smooth state-color transitions, brand tolerance management, and describing "adjacent" colors inside a design system.

Can it convert many colors at once?

The current flow is optimized for single-color precision and review. For bulk work, combine it with CSV tools, scripts, or the batch features in your design software.

Does color conversion replace contrast checking?

No. Conversion answers "how to write this color"; contrast checking answers "can people actually read this." Use both together.

Why does CMYK look so different from the on-screen color?

CMYK is subtractive and physically different from the additive RGB used on screens, and the printed result also depends on ink, paper, and process choices.

What chroma value should I use in OKLCH?

There is no single rule, but most brand colors land between 0.05 and 0.25. Very low values look washed out, and very high values can fall outside the supported gamut on some browsers or displays.

Related tools

After conversion, you can continue with the palette generator, contrast checker, and gradient generator to turn a normalized value into a complete visual system.