FOIL Calculator

Multiply two binomials and see every step.

Type or paste two binomial expressions - e.g. (x + 3)(x - 5)  or  (2x - 1)²
Expanded Result
Visual Breakdown
First
Outer
Inner
Last
Step-by-Step Solution
Combine All Terms
Simplified Result

How to Use the FOIL Calculator

This FOIL calculator multiplies two binomials and shows the work, not just the answer. Type the binomials, each in its own parentheses, and press Calculate or Enter. You'll see the expanded answer, a color-coded diagram of the four products, and the line where like terms are combined.

  • Powers: type x^2 or x². A power inside a binomial is fine, so something like x² − 3 works.
  • Squares: put the exponent after the closing parenthesis, as in (x - 7)^2 or (x − 7)².
  • Letters: any single letter works as a variable, and the two binomials can use different letters, such as a and b.
  • Decimals: type them as usual, like 0.5x. For a fraction, enter its decimal: ½ becomes 0.5.
  • Minus signs: a minus belongs to the term right after it. A normal hyphen on your keyboard works.
FOIL calculator showing First, Outer, Inner, Last steps for (x + 3)(x + 5)
A FOIL calculator with steps: each product gets its own color before like terms are combined. Here (x + 3)(x + 5) becomes x² + 8x + 15.

The calculator multiplies exactly two binomials. For square roots, use the FOIL with radicals calculator. To go backwards from a trinomial to its two factors, use the reverse FOIL calculator.

What Is the FOIL Method?

Quick answer: The FOIL method is a way to multiply two binomials. FOIL stands for First, Outer, Inner, Last: multiply those four pairs of terms, add the products, then combine like terms. For example, (x + 1)(x + 6) gives x² + 6x + x + 6, which simplifies to x² + 7x + 6.

A binomial is an expression with exactly two terms, such as x + 4 or 2y − 1. Multiplying two binomials means every term in the first has to meet every term in the second: four multiplications in all. FOIL is a checklist that makes sure none of the four gets skipped. A FOIL method calculator like this one runs the same checklist and shows each product in its own color.

FOIL isn't a separate rule. It is the distributive property used twice: the first term of the left binomial multiplies the whole right binomial, then the second term does the same. FOIL just puts those four multiplications in a fixed order. Any order that covers all four pairs gives the same answer. For a longer walkthrough with practice problems, read our guide to the FOIL method.

FOIL Formula

Quick answer: The FOIL formula multiplies (a + b) by (c + d) and produces four products: ac from the First terms, ad from the Outer terms, bc from the Inner terms and bd from the Last terms. Add the four products, then combine like terms, which are usually the Outer and Inner products.

( a + b )( c + d ) FIRST OUTER INNER LAST
F
First
The first term of each binomial: a × c
O
Outer
The two terms on the outside: a × d
I
Inner
The two terms in the middle: b × c
L
Last
The last term of each binomial: b × d
(a + b)(c + d) = ac + ad + bc + bd
Every term in the first binomial meets every term in the second exactly once.

Subtraction fits the same pattern if you read it as adding a negative. In (x − 4)(x + 3), the first binomial is x + (−4), so b = −4. The Inner product is −4 · x = −4x and the Last product is −4 · 3 = −12, which gives x² + 3x − 4x − 12 = x² − x − 12.

Worked Examples

These start with the simplest case and add one new idea each time. Every example lists the four products in FOIL order, then combines like terms.

1. FOIL with positive numbers (x + 2)(x + 5)

F
First
x · x
= x²
O
Outer
x · 5
= 5x
I
Inner
2 · x
= 2x
L
Last
2 · 5
= 10

Combine like terms: x² + 5x + 2x + 10 = x² + 7x + 10

When every term is positive, the middle coefficient is the sum of the two numbers (2 + 5) and the last term is their product (2 · 5).

2. FOIL with negative numbers (x − 3)(x + 8)

F
First
x · x
= x²
O
Outer
x · 8
= 8x
I
Inner
−3 · x
= −3x
L
Last
−3 · 8
= −24

Combine like terms: x² + 8x − 3x − 24 = x² + 5x − 24

Keep the minus sign attached to the 3. A positive times a negative is negative, so the last term is −24.

3. FOIL with coefficients (3x + 4)(2x − 5)

F
First
3x · 2x
= 6x²
O
Outer
3x · (−5)
= −15x
I
Inner
4 · 2x
= 8x
L
Last
4 · (−5)
= −20

Combine like terms: 6x² − 15x + 8x − 20 = 6x² − 7x − 20

Multiply the numbers and the variables separately: 3 · 2 = 6 and x · x = x².

4. FOIL with two variables (2a + b)(a − 3b)

F
First
2a · a
= 2a²
O
Outer
2a · (−3b)
= −6ab
I
Inner
b · a
= ab
L
Last
b · (−3b)
= −3b²

Combine like terms: 2a² − 6ab + ab − 3b² = 2a² − 5ab − 3b²

ab and ba are the same term, so the outer and inner products still combine. Writing the letters in alphabetical order makes that easy to spot.

5. FOIL with fractions (x + ½)(x − ¼)

F
First
x · x
= x²
O
Outer
x · (−¼)
= −¼x
I
Inner
½ · x
= ½x
L
Last
½ · (−¼)
= −⅛

Combine like terms: x² − ¼x + ½x − ⅛ = x² + ¼x − ⅛

To add −¼x and ½x, write ½ as 2/4: −1/4 + 2/4 = 1/4. In the calculator, enter (x + 0.5)(x - 0.25); it shows the same answer as decimals, x² + 0.25x − 0.125.

FOIL vs Box Method

Quick answer: FOIL and the box method always give the same answer, because both multiply every term by every term. FOIL lists the four products in a fixed order and is quickest for two short binomials. The box method puts them in a grid, which helps with negative signs and grows to fit trinomials.

MethodHow it worksBest forBeyond two binomials?
FOILFour products in a fixed order: First, Outer, Inner, LastQuick binomial × binomial problemsNo
Box methodTerms on the edges of a grid, one product in each cellProblems with several negative signs; seeing the structureYes: 2×3, 3×3 and larger grids
Distributive propertyEach term of the first factor multiplies the whole second factorAny product of polynomialsYes: it is the general rule

Teachers often show all three, and you can use whichever keeps your signs straight. To see a problem laid out as a grid, try the box method calculator. It and this binomial multiplication calculator always land on the same expanded answer. For a fuller comparison with worked examples, read FOIL vs the distributive property vs the box method.

Special Products: Difference of Squares and Perfect Squares

Quick answer: Two binomial products have shortcuts worth memorizing. A difference of squares, (a + b)(a − b), loses its middle term and leaves a² − b². A perfect square, (a + b)² or (a − b)², doubles its middle term to give a² ± 2ab + b². Spotting them saves time and makes factoring easier later.

Both shortcuts come straight out of FOIL, as the two examples below show. For more practice with the first pattern, read our guide to the difference of squares.

6. Difference of squares (4x + 7)(4x − 7)

F
First
4x · 4x
= 16x²
O
Outer
4x · (−7)
= −28x
I
Inner
7 · 4x
= 28x
L
Last
7 · (−7)
= −49

Combine like terms: 16x² − 28x + 28x − 49 = 16x² − 49

When the two binomials differ only in the sign between their terms, the outer and inner products cancel. The pattern is (a + b)(a − b) = a² − b².

7. Perfect square trinomial (3x − 5)²

F
First
3x · 3x
= 9x²
O
Outer
3x · (−5)
= −15x
I
Inner
−5 · 3x
= −15x
L
Last
−5 · (−5)
= 25

Combine like terms: 9x² − 15x − 15x + 25 = 9x² − 30x + 25

Squaring means multiplying the binomial by itself, so the two middle products are equal and the middle term doubles: (a − b)² = a² − 2ab + b². The last term is positive because a negative times a negative is positive.

Common Mistakes When Multiplying Binomials

  • Squaring each term separately. (x + 6)² is not x² + 36. Write it as (x + 6)(x + 6) and you get two middle products of 6x, so the answer is x² + 12x + 36.
  • Dropping a negative sign. In (x − 9)(x + 2), the inner product is −9 · x = −9x. Lose the sign and the correct x² − 7x − 18 turns into x² + 11x − 18.
  • Adding coefficients instead of multiplying them. 4x · 3x = 12x². It isn't 7x², and it isn't 12x: the numbers multiply and so do the x's.
  • Combining unlike terms. x² and x are different terms, so 2x² + 5x stays as it is. Only terms with the same variable raised to the same power combine.
  • Multiplying exponents. x² · x³ = x⁵. When you multiply powers of the same variable, add the exponents.
  • Stopping one step early. 2x² + 6x − x − 3 is a list of four products, not an answer. Combine 6x and −x to finish: 2x² + 5x − 3.

For a longer list with practice problems and answers, see FOIL mistakes and how to avoid them. If signs are the problem, work through how to FOIL with negative numbers.

When FOIL Doesn't Work

Quick answer: FOIL only works for a binomial times a binomial, because it names exactly four products. For anything larger, such as a binomial times a trinomial or three binomials, use the distributive property instead: multiply every term in one factor by every term in the other, then combine like terms.

  • A binomial times a trinomial needs 2 × 3 = 6 products. For (x + 2)(x² + x + 3), multiply x by each term of the trinomial, then 2 by each term: x³ + x² + 3x + 2x² + 2x + 6 = x³ + 3x² + 5x + 6.
  • Three binomials take two rounds. Multiply two of them first, then multiply that result by the third: (x + 1)(x − 1)(x + 4) = (x² − 1)(x + 4) = x³ + 4x² − x − 4.
  • A single term times a binomial needs only two products: 5x(x − 3) = 5x² − 15x. There's nothing to FOIL.

Like any multiply binomials calculator built around FOIL, the one on this page expects exactly two binomials. For bigger products, a grid keeps track of every pair better than a memory aid does: the box method grows to 2×3 or 3×3 without any new rules. Going the other way, from a trinomial back to two binomials, is factoring, which the reverse FOIL calculator handles.

Frequently Asked Questions

Questions students ask once they know the basics.