Expand & FOIL Calculator

Multiply two expressions and simplify — the exact reverse of everything else on this site.

Expand & FOIL

Multiply two expressions and simplify

(2x+3)(x−4)Two Binomials (FOIL)
(x−5)(x+5)Difference of Squares
(3x−1)(3x−1)Perfect Square
(x+2)(x²−3x+5)Binomial × Trinomial
← Back to Examples
Result
Answer
Steps go here…

Expanding Is Factoring in Reverse

Every calculator elsewhere on this site takes an expanded expression and breaks it into factors. This one runs the process backwards: give it two factors, and it multiplies them out into a single expanded polynomial. If you’ve ever wanted to double-check a factoring answer, this is how — factor something, then expand your answer back out and confirm you land on the original expression.

FOIL (First, Outer, Inner, Last) is just a memory aid for the specific case of multiplying two binomials — two two-term expressions. The calculator also handles longer expressions, like a binomial times a trinomial, using the same distribution idea without needing a special acronym for it.

FOIL, for two binomials (a+b)(c+d)

First + Outer + Inner + Last

ac + ad + bc + bd — then combine any like terms.

Two Worked Examples

Example 1 — FOIL on two binomials

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. The two middle terms are like terms, so they merge: 2x² − 5x − 12.

You can check this against the General Trinomial Calculator — factoring 2x² − 5x − 12 should return you right back to (2x + 3)(x − 4).

Example 2 — a binomial times a trinomial

Expand: (x + 2)(x² − 3x + 5)

Here FOIL doesn’t apply directly since the second factor has three terms, but the underlying idea — distribute every term of the first factor across every term of the second — works exactly the same way.

x × (x² − 3x + 5) = x³ − 3x² + 5x, and 2 × (x² − 3x + 5) = 2x² − 6x + 10. Add them: x³ − 3x² + 5x + 2x² − 6x + 10, which combines to x³ − x² − x + 10.

Common Mistakes

  • Forgetting the Outer and Inner terms. It’s easy to multiply First and Last correctly and forget the two cross terms in between — those are exactly what usually creates the middle term of a trinomial.
  • Sign errors on negative terms. If either binomial has a minus sign, every product it touches needs that sign carried through carefully.
  • Not combining like terms at the end. FOIL gives you four separate terms — the answer isn’t finished until the two middle ones (when they’re like terms) are added together.
  • Applying FOIL to expressions that aren’t both binomials. FOIL specifically means two two-term expressions. For anything longer, fall back to full distribution, like Example 2 above.

Frequently Asked Questions

First, Outer, Inner, Last — the four pairs of terms you multiply when expanding two binomials, referring to their position in the two sets of parentheses.
Not directly, FOIL is specifically for two binomials. For a binomial times a trinomial or larger, use full distribution instead: multiply every term of one expression by every term of the other, then combine like terms.
Expand your factored answer back out using this calculator. If it matches the original expression you started with, the factoring was correct — this is the fastest way to self-check any factoring problem.
That happens with a difference of squares, like (x – 5)(x + 5). The Outer and Inner terms end up being exact opposites of each other, so they cancel to zero, leaving just the First and Last terms behind.