Piecewise Linear Blend Calculator

Blend two segment values with weights, steps, and clamps.

Quick Facts

Weights
Blend
Weight defines the mix
Steps
Progress
Steps define slope
Clamp
Bounds
Clamp keeps bounds
Decision Metric
Blend
Blended value

Your Results

Calculated
Blended Value
-
Weighted blend value
Step Increment
-
Value per step
Clamped Value
-
Blend after clamp
Delta from A
-
Change from segment A

Blend Plan

Your defaults produce a smooth blended result.

What it is and when to use it

This calculator performs linear interpolation (often called a "lerp") between two values, segment A and segment B, using a blend weight between 0 and 1. A weight of 0 returns segment A exactly, a weight of 1 returns segment B exactly, and anything in between returns a proportional mix. It also reports a step increment for breaking the A-to-B span into equal-sized moves, and it clamps the blended result to a minimum and maximum bound so the output never leaves an allowed range.

Use it for animation and transition planning (blending between two keyframe values), gradual ramps such as pay scales or pricing tiers, mixing two forecast or budget scenarios by confidence weight, or any piecewise plan that moves from a starting value to a target value in controlled steps while staying within safe bounds. The clamp inputs are especially useful when the blend weight might be pushed outside its intended range or when downstream values must never exceed a hard limit.

Blend = A × (1 − w) + B × w
A, B: the two segment values being blended.
w (blend weight): a number from 0 to 1 controlling how much of B is mixed in; 0.6 means "60% of the way from A to B."
Step increment: (B − A) / steps, the size of each equal move if you walked from A to B in that many steps.
Clamped value: the blended value forced back into the [clamp min, clamp max] range if it would otherwise fall outside it.

Worked example

With A = 18, B = 42, blend weight 0.6, 6 steps, and clamp bounds 10 to 50: Blend = 18 × (1 − 0.6) + 42 × 0.6 = 18 × 0.4 + 42 × 0.6 = 7.2 + 25.2 = 32.4. Step increment = (42 − 18) / 6 = 24 / 6 = 4.00, meaning each of the 6 steps from A to B moves the value by 4. Since 32.4 already falls inside the 10-50 clamp range, the clamped value stays at 32.4 and the delta from A is 32.4 − 18 = +14.40 — matching the calculator's default "Blend Plan" (stable, within range) result.

Common mistakes and how to interpret the result

  • Entering a blend weight outside the 0-1 range. Weights are meant to represent a percentage of the way from A to B; the calculator rejects values below 0 or above 1 since they would represent extrapolation beyond the two segments rather than a blend between them.
  • Confusing the step increment with the blended value. The step increment describes how big each move is if you split the A-to-B distance into equal pieces; it does not depend on the blend weight at all, only on the number of steps chosen.
  • Setting a clamp range that excludes the natural blend result. If your clamp bounds are narrower than where the blended value would naturally fall, the calculator flags "Outside Clamp" and reports the bounded value — check whether the clamp or the blend weight needs adjusting.
  • Forgetting the clamp only affects the final blended value, not the step increment. Steps are calculated directly from A and B, so a tight clamp does not change how large each individual step is.

Frequently Asked Questions

What does a blend weight of 0.6 actually mean?
A blend weight of 0.6 means the result sits 60% of the way from segment A to segment B, or equivalently, it is a mix of 40% of A's value plus 60% of B's value. A weight of 0 returns A unchanged, and a weight of 1 returns B unchanged.
Why does the calculator show a step increment separate from the blend?
The step increment is useful when you want to move from A to B gradually over a fixed number of discrete steps, such as a multi-stage ramp or a phased rollout, rather than jumping straight to a single blended value. It is calculated independently from the blend weight, since it only depends on the total distance (B minus A) and how many steps you choose.
What happens if the blended value falls outside my clamp range?
The calculator reports both the raw blended value and a separate clamped value. If the blend falls below the clamp minimum or above the clamp maximum, the clamped value is pulled back to that boundary, and the result banner flags the situation as "Outside Clamp" so you know the two numbers differ.
Can segment A be larger than segment B?
Yes. The formula works the same way regardless of which value is larger; a blend weight above 0 will move the result toward B even if B is numerically smaller than A, and the step increment will simply be negative, indicating each step decreases the value.

Related calculators