FOIL Calculator
Multiply two binomials step by step using First, Outer, Inner, Last — with a visual FOIL diagram, an area-model grid, and automatic detection of perfect-square and difference-of-squares shortcuts.
Background
FOIL is a memory trick for multiplying two binomials like (ax + b)(cx + d): multiply the First terms, the Outer terms, the Inner terms, and the Last terms, then combine the two middle (Outer + Inner) results into a single term. It's really just the distributive property applied twice — FOIL just gives the four products a memorable order.
How to use this calculator
- Choose General FOIL to multiply any two binomials, or Square a Binomial / Difference of Squares for the two special shortcut patterns.
- Enter whole-number coefficients — the live preview above the fields updates as you type, so you can confirm it matches what you meant.
- Click Calculate to see the expanded polynomial, the FOIL diagram, an area-model grid, and a full step-by-step breakdown.
- Even in General FOIL mode, the calculator will tell you if your binomials secretly form a perfect square or difference of squares.
How FOIL works
First: multiply the first term of each binomial together — this gives the x² term.
Outer: multiply the outermost two terms (first term of binomial 1, last term of binomial 2).
Inner: multiply the innermost two terms (last term of binomial 1, first term of binomial 2).
Last: multiply the last term of each binomial together — this gives the constant term.
Outer and Inner are both x-terms, so they combine into one middle term. First and Last don't combine with anything else — they're the only x² and constant terms.
Formula & Equations Used
General FOIL: (ax+b)(cx+d) = ac·x² + (ad+bc)·x + bd
Perfect square shortcut: (ax+b)² = a²x² + 2ab·x + b² — Outer and Inner are always equal, so the middle term is exactly double one of them.
Difference of squares shortcut: (ax+b)(ax−b) = a²x² − b² — Outer and Inner are always opposites, so they cancel and there's no middle term at all.
Example Problems & Step-by-Step Solutions
These cover cases the Quick Examples chips above don't already demonstrate.
Example 1 — An applied problem
A rectangular room is (x + 8) feet long and (x + 3) feet wide. What's its area as a polynomial?
Step: Area = (x+8)(x+3). First: x². Outer: 3x. Inner: 8x. Last: 24. Combine Outer+Inner: 11x.
Result: Area = x² + 11x + 24 square feet.
Example 2 — A hidden perfect square
Multiply (4x + 1)(4x + 1) using General FOIL (rather than the Square shortcut).
Step: First: 16x². Outer: 4x. Inner: 4x — notice Outer equals Inner, since both binomials are identical.
Result: 16x² + 8x + 1 — the calculator flags this as a perfect square even though it was entered as a general problem.
Example 3 — A bigger difference of squares
Multiply (7x + 5)(7x − 5).
Step: First: 49x². Outer: −35x. Inner: 35x — these are opposites, so they cancel exactly.
Result: 49x² − 25 — no middle term.
Example 4 — Checking your answer by substitution
Multiply (2x + 5)(3x − 1), then verify the answer at x = 2.
Step: FOIL gives 6x² + 13x − 5. At x=2: original = (4+5)(6−1) = 9 × 5 = 45. Expanded = 6(4)+13(2)−5 = 24+26−5 = 45.
Result: Both sides equal 45 — plugging in a number is a fast way to catch a sign mistake before you move on.
Frequently Asked Questions
Does FOIL work for anything other than two binomials?
No — FOIL specifically means two terms times two terms. Multiplying a binomial by a trinomial, or three binomials together, needs the distributive property applied more generally (every term times every term), which FOIL doesn't name but is really the same idea extended.
Why do Outer and Inner always combine into one term?
Both products always come out as a plain multiple of x (never x² or a constant), since each is one x-term times one constant term. Since they're "like terms," they can always be added into a single coefficient.
How can I tell if I have a difference of squares?
Check two things: the two binomials must have identical terms except for one sign flip (like (x+4) and (x−4)), and there must be no middle term in the answer — Outer and Inner will always cancel exactly.
Why does squaring a binomial give three terms, not two?
A common mistake is writing (a+b)² as a²+b², skipping the middle term entirely. FOIL shows why that's wrong: Outer and Inner are both nonzero and equal, so they add up to a real middle term, 2ab·x — it doesn't disappear.