You can mix two HEX colors without an online mixer by calculating every RGB channel as round(A × (1 − ratio) + B × ratio).

Use this fallback when the color-mixing page is unavailable, blocked, or inconvenient. The goal is to produce a reproducible digital color for a website, app, icon, chart, interface, or gradient—not to predict how physical paint or ink will combine. Converting both colors to RGB, applying the same ratio to each channel, and converting the result back to HEX gives you the same sRGB-based result defined by the Color Mixer.

what should i do if i cannot use mix two hex colors
What To Do If You Cannot Use the HEX Color Mixer

Choose a fallback based on the required output

The best alternative depends on whether you need one exact color, a continuous transition, or a physical material match. A manual channel calculation is the most transparent option for a single digital value because every step is visible and repeatable.

Required output Recommended approach What to expect
One exact on-screen color Calculate a weighted RGB average A reproducible HEX and RGB result
A continuous color transition Use an sRGB gradient or blend workflow Several intermediate colors rather than one midpoint
Paint, acrylic, dye, or printer ink Test the actual materials A physical result that screen arithmetic cannot reliably predict

For a website component that calls for one blended value, use the manual method below. If the requirement is actually a series of related colors, a full gradient may communicate the transition better than reducing the design to a single averaged color.

Turn each HEX code into RGB channels

A six-digit HEX color divides into three two-digit pairs. The first pair represents red, the second green, and the third blue. Each pair maps to an 8-bit channel value from 0 to 255, which is the number system used by the weighted-average formula.

Input form Example Supported handling
Short HEX #f00 Accepted directly
Full HEX #3b82f6 Accepted directly
RGB string rgb(59, 130, 246) Accepted directly
Visual selection Click the color swatch Opens the native color picker

For a manual calculation, write down the decimal triplet for each color and keep the original HEX strings nearby. That makes it easy to check your work without changing the source values.

  • Read the first two HEX digits as the red channel.
  • Read the next two digits as the green channel.
  • Read the final two digits as the blue channel.
  • Record each value as a decimal number from 0 to 255.

RGB To HEX The Color Mixer itself also tolerates extra spaces, an omitted hash mark, and upper- or lowercase letters, so those variations do not require rewriting a valid value before you begin.

Calculate the blend by hand

Let A represent the first color’s RGB channels, B represent the second color’s channels, and ratio represent the share assigned to Color B. A ratio of 0 produces pure Color A, a ratio of 1 produces pure Color B, and a ratio of 0.5 gives the midpoint of the two channel values.

  1. Write down the red, green, and blue values for Color A and Color B.
  2. Convert the desired Color B percentage to a decimal ratio between 0 and 1.
  3. Apply the same ratio separately to each of the three channels: round(A × (1 − ratio) + B × ratio).
  4. Round each result to the nearest integer and keep it within the 0–255 channel range.
  5. Convert the three resulting integers back into two-digit HEX pairs and join them with a hash mark.

Here is one complete example using Color A #3b82f6, which is RGB (59, 130, 246), and Color B #ff0000, which is RGB (255, 0, 0). With Color B at 25%, the ratio is 0.25:

  • Red: round(59 × 0.75 + 255 × 0.25) = 108
  • Green: round(130 × 0.75 + 0 × 0.25) = 98
  • Blue: round(246 × 0.75 + 0 × 0.25) = 185

Those channels convert to 6c, 62, and b9, producing #6c62b9. If the result looks different, check that the ratio was applied in the intended direction and that you averaged the channels rather than averaging the two HEX strings as text.

Know the limits of screen-color blending

The documented method is a direct weighted average of 8-bit sRGB channel values. It is additive-style screen-light interpolation, not gamma-corrected optical mixing and not subtractive pigment mixing. This distinction explains why two saturated screen colors may produce a clean digital blend while the same pigments look darker or muddier on a palette.

The approach is well suited to digital work such as website colors, app interfaces, icons, chart palettes, gradient stops, hover states, and intermediate brand-color shades. It is not a reliable predictor for acrylics, dyes, printer inks, or other physical materials. Test those combinations with the actual substances before relying on a predicted screen color.

  • Use the calculation for opaque RGB colors intended for screens.
  • Do not treat the midpoint as a perceptual or gamma-corrected midpoint.
  • Remember that the documented formula blends red, green, and blue channels; it does not describe alpha compositing.

Because channel rounding is part of the result, keep the source colors and ratio together as a recipe. Re-entering those same values with the same direction will reproduce the same digital output.

Run the supported Color Mixer workflow when access returns

When the page is available, the Color Mixer performs the calculation for you in the browser. It accepts the same two source colors, updates the result as the ratio changes, and keeps the color math local, so the inputs are not uploaded to a server. There is no sign-up requirement or usage limit.

  1. Enter the first color in the Color A field as a short or full HEX value, an rgb() string, or by clicking its swatch and choosing a color visually.
  2. Enter the second color in the Color B field using the same input options.
  3. Drag the ratio slider to choose the blend. At 0% the result is pure Color A, at 100% it is pure Color B, and at 50% it is the midpoint.
  4. Read the exact lowercase six-digit HEX and RGB values in the result panel, and use the gradient bar to inspect the transition between both endpoints.
  5. Click Copy to place the result hex on the clipboard.

The ratio label records the split, such as 70% A and 30% B, which makes the result easy to reproduce. The gradient bar contains eleven evenly spaced steps, including both original colors, so you can judge where a useful intermediate appears rather than relying on one midpoint alone. The Copy control copies the hex result; the RGB string remains available in the result panel when that output format is needed.

If the page or a control is temporarily unavailable, return to the manual formula rather than guessing at a blend. If an entered value appears unsuitable, normalize it to a documented form such as #3b82f6 or rgb(59, 130, 246), or use the adjacent swatch to select the color visually.

Check the result before using it

A mathematically correct blend can still be wrong for the design task. Run through a short final check before applying the color:

  • Confirm the ratio direction: Color B’s percentage is the ratio used in the formula.
  • Confirm the color model: the result represents an sRGB screen blend, not mixed paint.
  • Confirm the output format: the Color Mixer displays both HEX and RGB values, while its Copy action copies the hex.
  • Preserve the recipe: save both original color strings and the ratio alongside the result.
  • Review nearby colors: use the gradient preview when the blend must sit comfortably between two brand colors.

For a subtle tint, shade, hover state, or palette step, adjust the ratio and compare more than one setting. For a full transition rather than one blended color, retain both endpoints and the intermediate stops instead of collapsing the scale into a single average.

Related reading: Convert Hex to RGB in JS: Reusable JavaScript Code.

Related reading: Before Mixing Two HEX Colors: Format, Ratio, and Math.