Completing the Square Calculator

Rewrite quadratics in vertex form.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter a, b and c to rewrite a quadratic as a(x − h)² + k. x² − 6x + 5 becomes (x − 3)² − 4.

How to use

1
Step 1
Enter a, b and c.
2
Step 2
Press Calculate.
3
Step 3
Read the completed-square form.

How it works

Half the x-coefficient, squared, completes a perfect square. In general h = −b ÷ 2a and k = c − b² ÷ 4a. Setting the form to zero then gives x = h ± √(−k/a), which is how the quadratic formula is derived.

ax² + bx + c = a(x − h)² + k,  h = −b ÷ 2a,  k = c − b² ÷ 4a

Worked example

With a leading coefficient

Input
2x² + 8x + 3
Output
2(x + 2)² − 5
Walkthrough
h = −8 ÷ 4 = −2 and k = 3 − 64 ÷ 8 = −5, so 2(x + 2)² − 5. Expanding: 2(x² + 4x + 4) − 5 = 2x² + 8x + 3.

Limitations

  • The result is written as a(x − h)² + k with signs folded in, so h = −2 appears as (x + 2) and a = 1 is left out. Fractions are shown as decimals.
  • a must not be 0.

Questions

What is x² − 6x + 5 in completed-square form?
(x − 3)² − 4.
What is 2x² + 8x + 3 in completed-square form?
2(x + 2)² − 5.
How do I find h?
h = −b ÷ 2a. For x² − 6x + 5, h = 6 ÷ 2 = 3.

Features

  • Shows h and k
  • Works with any a
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Solving an equation with variables on both sides

    Khan Academy

    Classic linear solve pattern for algebra calculators.

    Watch on YouTube
  • Solving a consecutive integer problem

    Khan Academy

    Word-problem setup that feeds equation tools.

    Watch on YouTube
  • Solving Equations

    Math is Fun

    Balance-scale approach for linear equation tools.

  • Polynomials

    Math is Fun

    Vocabulary for polynomial simplify and factor tools.