Skip to main content

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.

Set up your binomials

Step 1 — What are you multiplying?

Step 2 — Enter the coefficients

Enter whole numbers for all four coefficients.

Learning options

Result

No result yet. Set up your binomials above and click Calculate.

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

1

First: multiply the first term of each binomial together — this gives the x² term.

2

Outer: multiply the outermost two terms (first term of binomial 1, last term of binomial 2).

3

Inner: multiply the innermost two terms (last term of binomial 1, first term of binomial 2).

4

Last: multiply the last term of each binomial together — this gives the constant term.

5

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.

The Quadratic Formula
5. BONUS: Mathematical Operations and Functions
10 problems
Topic
5. BONUS: Mathematical Operations and Functions
5 topics 15 problems
Chapter
Polynomials Intro
0. Review of Algebra
4 problems
Topic
Callie
Multiplying Polynomials
0. Review of Algebra
3 problems
Topic
Callie
Factoring Polynomials
0. Review of Algebra
7 problems
Topic
Callie
Radical Expressions
0. Review of Algebra
6 problems
Topic
Callie
Simplifying Radical Expressions - Part 1 of 2
0. Review of Algebra
7 problems
Topic
Justin
Simplifying Radical Expressions - Part 2 of 2
0. Review of Algebra
7 problems
Topic
Justin
Intro to Quadratic Equations
1. Equations & Inequalities
4 problems
Topic
Callie
Completing the Square
1. Equations & Inequalities
4 problems
Topic
Callie
The Quadratic Formula
1. Equations & Inequalities
6 problems
Topic
Callie
Choosing a Method to Solve Quadratics
1. Equations & Inequalities
7 problems
Topic
Callie
0. Review of Algebra - Part 1 of 2
5 topics 10 problems
Chapter
Callie
0. Review of Algebra - Part 2 of 2
3 topics 10 problems
Chapter
Callie
1. Equations & Inequalities - Part 1 of 3
4 topics 11 problems
Chapter
Callie
1. Equations & Inequalities - Part 2 of 3
4 topics 10 problems
Chapter
Callie
1. Equations & Inequalities - Part 3 of 3
4 topics 10 problems
Chapter
Callie
Polynomials Intro
0. Fundamental Concepts of Algebra
3 problems
Topic
Multiplying Polynomials
0. Fundamental Concepts of Algebra
3 problems
Topic
Factoring Polynomials
0. Fundamental Concepts of Algebra
3 problems
Topic
Radical Expressions
0. Fundamental Concepts of Algebra
3 problems
Topic
Simplifying Radical Expressions
0. Fundamental Concepts of Algebra
4 problems
Topic
Intro to Quadratic Equations
1. Equations and Inequalities
4 problems
Topic
Completing the Square
1. Equations and Inequalities
4 problems
Topic
The Quadratic Formula
1. Equations and Inequalities
6 problems
Topic
Choosing a Method to Solve Quadratics
1. Equations and Inequalities
5 problems
Topic
0. Fundamental Concepts of Algebra
10 topics 10 problems
Chapter
1. Equations and Inequalities - Part 1 of 2
7 topics 13 problems
Chapter
1. Equations and Inequalities - Part 2 of 2
5 topics 12 problems
Chapter
The Quadratic Formula
BONUS: Mathematical Operations and Functions
4 problems
Topic
BONUS: Mathematical Operations and Functions - Part 1 of 2
4 topics 9 problems
Chapter
BONUS: Mathematical Operations and Functions - Part 2 of 2
1 topic 2 problems
Chapter
Back to all calculatorsAll calculators