Home/Tools/Colors/Color Mix Calculator
Colors · Generator

Color Mix Calculator

Mix two colors in different color spaces using the CSS color-mix() function.

Colors

Mix Amount

50%

Color B: 50%

Color Space

Different spaces produce different perceptual mixes. OKLCH often gives the most natural results.

Preview

Color A (50%)Mixed ResultColor B (50%)

#a857c5 (approx sRGB)

CSS color-mix()

color-mix(in oklch, #6366f1 50%, #ec4899)

Generated CSS
/* color-mix() — Chrome 111+, Firefox 113+, Safari 16.2+ */
.element {
  /* Fallback */
  background-color: #a857c5;
  /* color-mix */
  background-color: color-mix(in oklch, #6366f1 50%, #ec4899);
}
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Color Mix Calculator?

Preview and generate color-mix() CSS values. Blend two colours at any ratio in any colour space and copy the output.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Color Mix Calculator

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Pick your two colours

Enter HEX or colour values for both inputs. The live preview shows the blend in real time.

2

Set the mix ratio

Drag the slider to control the percentage of colour 1. 50% gives an even blend. Adjust to create tints and shades.

3

Choose a colour space

sRGB is the default. oklch and lch give perceptually uniform blends that avoid muddy midpoints. Copy the color-mix() CSS or the computed hex fallback.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
/* Mix two colours 50/50 in sRGB */
.tint-50 {
  color: color-mix(in srgb, #6C2EF5 50%, white);
}

/* 80% primary, 20% black (a shade) */
.shade-80 {
  background: color-mix(in srgb, #6C2EF5 80%, black);
}

/* Mix in oklch for perceptually uniform results */
.tint-oklch {
  background: color-mix(in oklch, #6C2EF5, white 40%);
}

color-mix() is supported in Chrome 111+, Firefox 113+, Safari 16.2+. For older browsers, generate a hex fallback using this tool.

Pro tips

Pro tips for better results

oklch blending avoids muddy midpoints

Mixing blue and yellow in sRGB produces a dull grey midpoint. In oklch, the same blend passes through vivid greens - much closer to physical paint mixing.

Generate a hex fallback for older browsers

color-mix() is not supported below Chrome 111 or Firefox 113. Use this tool to compute the blended hex value as a fallback in a @supports block.

Build tint/shade scales with color-mix()

color-mix(in srgb, var(--brand) 90%, white) is a tint at 10% white. Increment from 90% to 10% for a full 9-step tint scale without a preprocessor.

Percentages do not need to add up to 100%

In color-mix(), omitting the second percentage defaults it to 100% minus the first. color-mix(in srgb, blue 30%, red) gives 30% blue and 70% red.

FAQ

Frequently asked questions

color-mix() is a native CSS function that blends two colours at a given ratio in a specified colour space. It ships in Chrome 111+, Firefox 113+, and Safari 16.2+. It replaces the need for Sass colour functions in modern CSS.
srgb is the safest for compatibility. oklch produces better-looking blends with consistent perceived lightness. Use oklch when you want gradients or scales that look even across the hue range.
No. All blending and calculations run in your browser. Nothing is sent to a server.

From the blog

Read more