FOIL Calculator

Multiply two linear binomials and see the First, Outer, Inner, and Last products before like terms are combined.

FOIL method calculator
Enter two binomials in ax + b form to expand their product.

Use x as the variable and include a plus or minus constant term.

About the FOIL calculator

FOIL is a mnemonic for multiplying two binomials. Its letters stand for First, Outer, Inner, and Last, the four pairs of terms created by the distributive property. For the product (ax + b)(cx + d), the first terms produce ac times x squared, the outer terms produce ad times x, the inner terms produce bc times x, and the last terms produce bd. Adding the two middle products gives the standard quadratic form ac times x squared plus (ad + bc) times x plus bd. This calculator accepts linear binomials written with x, a numerical coefficient, and a signed constant. Inputs such as 2x + 3, x - 5, -x + 4, and 0.5x - 2 are supported. When no coefficient is written before x, the coefficient is understood to be 1; when only a minus sign appears, it is understood to be -1. The output omits unnecessary coefficients of 1 and formats positive and negative terms with familiar algebraic signs. The FOIL method is not a separate algebraic law. It is simply a memorable way to apply distribution to exactly two binomials. Every term in the first factor must multiply every term in the second factor. Once those four products are written, like x terms are combined. The squared term and constant term generally cannot combine with anything else because their powers differ. For example, expanding (2x + 3)(3x + 4) gives first product 6x squared, outer product 8x, inner product 9x, and last product 12. Combining 8x and 9x yields 17x, so the final polynomial is 6x squared + 17x + 12. A useful verification is to substitute a simple value such as x equal to 1 into both the original product and expanded polynomial; both forms should produce the same number. FOIL is especially useful when learning polynomial multiplication, solving quadratic equations, checking factorizations, and simplifying algebraic expressions. For products with more than two terms in either factor, use the full distributive method instead: multiply every term in one polynomial by every term in the other. The same principle applies, but the four-letter mnemonic no longer covers all required products.

FOIL examples

Binomial productExpanded polynomialMiddle-term calculation
(2x + 3)(3x + 4)6x² + 17x + 12The middle coefficient is 8 + 9.
(x - 5)(x + 2)x² - 3x - 10The middle coefficient is 2 - 5.
(3x - 1)(2x - 4)6x² - 14x + 4The middle coefficient is -12 - 2.
(-x + 2)(x + 3)-x² - x + 6The middle coefficient is -3 + 2.

How to use the FOIL calculator

  1. Enter the first binomial using x and a signed constant.
  2. Enter the second binomial in the same ax + b format.
  3. Select Calculate FOIL to multiply all four term pairs.
  4. Review the individual products and the combined expanded polynomial.

FOIL calculator FAQ

What does FOIL stand for?

FOIL stands for First, Outer, Inner, and Last. These names identify the four term pairs multiplied when expanding two binomials.

Can FOIL multiply expressions with subtraction?

Yes, subtraction is handled as addition of a negative term. Keep each minus sign with its coefficient when multiplying the corresponding pair.

Why are the outer and inner products combined?

Both products contain x to the first power, so they are like terms. Their numerical coefficients can therefore be added to make one middle term.

Can I use a variable other than x?

This calculator expects x so that input parsing remains clear and predictable. The same multiplication rule works for any variable when performed by hand.

Does FOIL work for three-term polynomials?

The four FOIL pairs cover only two terms multiplied by two terms. For larger polynomials, distribute every term in the first expression across every term in the second.