FOIL Method Calculator

Expand the product of two binomials (ax + b)(cx + d) with the FOIL method and see each of the four products and the combined result.

First binomial (ax + b)

Second binomial (cx + d)

One letter, such as x, y or t.
F (first)
2x2
O (outer)
−8x
I (inner)
3x
L (last)
−12
Middle term (O + I)
−5x
Zeros of the product
x = −1.5, 4
(2x + 3)(x − 4) =2x2 − 5x − 12

Show the work

  1. First: multiply the first terms, 2x × x = 2x2
  2. Outer: multiply the outer terms, 2x × (−4) = −8x
  3. Inner: multiply the inner terms, 3 × x = 3x
  4. Last: multiply the last terms, 3 × (−4) = −12
  5. Add the four products: 2x2 − 8x + 3x − 12
  6. Combine the like terms −8x and 3x: −8x + 3x = −5x, giving 2x2 − 5x − 12

Box method: each cell is a row term × a column term

x−4
2x2x2−8x
33x−12

The diagonal cells −8x and 3x are the like terms that combine into −5x.

FOIL is the classic routine for multiplying two binomials such as (2x + 3)(x − 4). Each binomial has two terms, so the product has four partial products, and the letters F-O-I-L name them in a fixed order so none gets skipped. This calculator lists all four, combines the like terms and draws the same product as a box-method grid.

How to use the FOIL calculator

  1. For the first binomial (ax + b), enter the coefficient a of the variable and the constant b.
  2. For the second binomial (cx + d), enter c and d. Subtraction is a negative constant: x − 4 means c = 1 and d = −4.
  3. Optionally change the variable letter.
  4. The tape shows the expanded trinomial, each FOIL product and the zeros of the product. The steps show the multiplication, and the grid below shows the box method.

The FOIL formula

(ax + b)(cx + d) = acx² + (ad + bc)x + bd
Letter Which terms Product
F – First first term of each bracket ax · cx = acx²
O – Outer the two terms on the outside ax · d = adx
I – Inner the two terms on the inside b · cx = bcx
L – Last last term of each bracket b · d = bd

The outer and inner products are like terms, so they always merge into the single middle term (ad + bc)x.

Worked example

Expand (2x + 3)(x − 4).

First: 2x · x = 2x²

Outer: 2x · (−4) = −8x

Inner: 3 · x = 3x

Last: 3 · (−4) = −12

Combine: 2x² − 8x + 3x − 12 = 2x² − 5x − 12

A quick check: substitute x = 1. The factored form gives (2 + 3)(1 − 4) = −15, and the expanded form gives 2 − 5 − 12 = −15. Matching values at one or two test points is a fast way to catch sign errors.

The box method

The box (or area) method arranges the same four products in a 2 × 2 grid. Write one binomial’s terms along the top and the other’s down the side, and fill each cell with the product of its row and column. The cells on one diagonal are always the like terms. Many students find the grid easier than FOIL because it extends naturally to larger polynomials: a trinomial times a binomial is simply a 3 × 2 grid.

Special products worth recognizing

Some binomial products follow patterns you can write down without FOIL:

Pattern Expansion Example
(x + k)² x² + 2kx + k² (x + 5)² = x² + 10x + 25
(x − k)² x² − 2kx + k² (x − 3)² = x² − 6x + 9
(x + k)(x − k) x² − k² (x + 7)(x − 7) = x² − 49

In the last pattern the outer and inner products cancel, which is why the result has no middle term. The difference of two squares calculator works that identity in reverse, and a common error is to write (x + 5)² as x² + 25, forgetting the 10x middle term.

Going backwards: factoring

FOIL multiplies; factoring undoes it. To factor x² − x − 12 you look for two numbers that multiply to −12 and add to −1 (they are −4 and 3, so it factors as (x − 4)(x + 3)), the same search the diamond problem solver automates. When no such integers exist, the quadratic formula calculator still finds the roots, and the zeros listed on the tape here are exactly where each factor equals zero.

Frequently asked questions

What does FOIL stand for?

First, Outer, Inner, Last. It is a checklist for multiplying two binomials so that each term in the first bracket is multiplied by each term in the second bracket exactly once.

Does FOIL work for trinomials?

Not directly. FOIL is only a memory aid for two terms times two terms. For larger brackets, use the distributive property or the box method: multiply every term in one bracket by every term in the other and then combine like terms.

Why does the middle term come from two products?

The outer product (ax)(d) and the inner product (b)(cx) are both multiples of x, so they are like terms and add together into (ad + bc)x. The first and last products have no partner, so they stay as they are.

Can I use a letter other than x?

Yes. Type any single letter in the Variable box and the expansion uses it, for example (t + 2)(t − 5) = t² − 3t − 10.

Last reviewed October 2026 by the CalcFluent editorial team. How we check our calculators.