Math

Completing the square calculator

Completing the square rewrites a quadratic ax² + bx + c in the form a(x − h)² + k. With this completing the square calculator, enter a, b and c to see each step, worked in exact fractions and radicals rather than rounded decimals, then read off the vertex and solve the equation, including complex solutions when the parabola never crosses the x-axis.

Runs in your browser. Nothing you type is sent to us.

Vertex form

(x + 3)² − 4

Vertex (h, k) = (−3, −4)

Solutions
−1, −5
Vertex
(−3, −4)
Discriminant (b² − 4ac)
16

Step-by-step deviations

StepEquation
Startx² + 6x + 5 = 0
Move the constant to the rightx² + 6x = −5
Add (b ÷ 2a)² = 9 to both sidesx² + 6x + 9 = 4
Write the left side as a square(x + 3)² = 4
Take the square rootx + 3 = ± 2
Solve for xx = −1, −5

Key facts

  • Completing the square turns ax² + bx + c into a(x − h)² + k, with h = −b ÷ 2a and k = c − b² ÷ 4a.
  • x² + 6x + 5 = (x + 3)² − 4, so the vertex is (−3, −4) and the solutions are x = −1 and x = −5.
  • The key step is adding and subtracting (b ÷ 2)² after dividing by a.
  • If the number on the right is negative after you isolate the square, the solutions are complex: x² + 2x + 5 = 0 gives x = −1 ± 2i.
  • The quadratic formula is what you get when you complete the square on ax² + bx + c = 0 in general.

The method, step by step

To solve ax² + bx + c = 0 by completing the square:

  1. Divide by a so the x² coefficient is 1: x² + (b/a)x + c/a = 0.
  2. Move the constant to the right: x² + (b/a)x = −c/a.
  3. Add (b ÷ 2a)² to both sides. The left side is now a perfect square.
  4. Write the square: (x + b/2a)² = (b² − 4ac) ÷ 4a².
  5. Take square roots of both sides, remembering ±.
  6. Solve for x.

The calculator shows each of these lines with your numbers, keeping fractions and radicals exact.

How to use the completing the square calculator

  1. Enter a, b and c from ax² + bx + c. Use negative numbers for subtraction (x² − 4x + 1 means a = 1, b = −4, c = 1).
  2. Read the vertex form, the vertex, the solutions and the discriminant.
  3. Follow the steps table to see how each line comes from the one before.

Worked examples: completing the square

Example 1: whole-number answers

x² + 6x + 5 = 0. Move 5: x² + 6x = −5. Half of 6 is 3, and 3² = 9, so add 9: x² + 6x + 9 = 4, or (x + 3)² = 4. Then x + 3 = ±2, giving x = −1 or x = −5.

Example 2: irrational answers

x² − 4x + 1 = 0. Then x² − 4x = −1, add 4: (x − 2)² = 3, so x = 2 ± √3 ≈ 3.732 or 0.268.

Example 3: a leading coefficient

2x² − 12x + 7 = 0. Divide by 2: x² − 6x + 3.5 = 0. Add 9 to both sides of x² − 6x = −3.5: (x − 3)² = 5.5 = 11/2. So x = 3 ± √(11/2) = 3 ± √22/2 ≈ 5.345 or 0.655. The vertex form is 2(x − 3)² − 11.

Example 4: complex answers

x² + 2x + 5 = 0 becomes (x + 1)² = −4. No real number squares to −4, so x = −1 ± 2i.

Why it works

(x + p)² = x² + 2px + p². So any expression x² + bx is a perfect square missing only p² where p = b ÷ 2. Adding that missing piece, and subtracting it again to keep things balanced, completes the square. Geometrically, x² + bx is a square with two rectangles attached; the missing corner is a small square of side b ÷ 2.

What the vertex form tells you

PartMeaning
aSame as before: opens up if positive, down if negative
hx-coordinate of the vertex and the axis of symmetry x = h
kMinimum (a > 0) or maximum (a < 0) value of the quadratic

When to use completing the square

  • To find the vertex of a parabola without calculus.
  • To solve quadratics that do not factor nicely.
  • To derive the quadratic formula.
  • To rewrite circle equations like x² + y² − 6x + 4y = 3 as (x − 3)² + (y + 2)² = 16, a circle of radius 4 centred at (3, −2).
  • To set up integrals and inverse Laplace transforms later in calculus.

Common mistakes with completing the square

  • Forgetting to divide by a first.
  • Adding (b ÷ 2)² to only one side.
  • Dropping the ± when taking the square root.
  • Halving b before dividing by a.

For a one-step answer, use the quadratic formula calculator. To convert between forms with the focus and directrix, see the vertex form calculator, and to factor instead, the factoring trinomials calculator.

Completing the square, literally

The method is named for a picture. In the 9th century, al-Khwarizmi solved equations such as x² + 10x = 39 by drawing a square of side x, attaching rectangles of total area 10x, and then adding the small corner square of area 25 needed to "complete" a larger square of side x + 5; since the large square has area 39 + 25 = 64, its side is 8, so x = 3. The same idea appears geometrically in Book II of Euclid’s *Elements*, and it is how the quadratic formula is derived.

Completing the square is more than a solving technique. It converts a quadratic into vertex form, a(x − h)² + k, which shows a parabola’s turning point at once; it turns the general equation of a circle into centre-radius form; and in calculus and statistics it is the key step in integrating Gaussian functions behind the normal distribution. In US high schools, Common Core standards A-REI.B.4a and F-IF.C.8a ask students to complete the square to derive the quadratic formula and to reveal the maximum or minimum of a quadratic function. When a quadratic factors neatly, factoring the trinomial is quicker than completing the square. For the formula directly, use the quadratic formula calculator; to convert forms, the vertex form calculator; and for the discriminant, the discriminant calculator.

How this calculator works

  • Divides ax² + bx + c by a, moves the constant, then adds (b ÷ 2a)² to both sides to form a perfect square.
  • Writes the result as a(x − h)² + k with h = −b/2a and k = c − b²/4a, and shows each step.
  • Solves by taking square roots: x = h ± √(−k/a), giving real or complex solutions.
  • The discriminant and vertex are shown as a cross-check.

Frequently asked questions

What does completing the square mean?

Rewriting ax² + bx + c as a(x − h)² + k by adding and subtracting the number that makes a perfect square.

How do I complete the square for x² + 6x + 5?

Half of 6 is 3 and 3² = 9, so x² + 6x + 5 = (x + 3)² − 9 + 5 = (x + 3)² − 4.

What number do I add to complete the square?

(b ÷ 2)² after the x² coefficient has been made 1.

What if a is not 1?

Divide every term by a first, or factor a out of the x² and x terms.

What if I get a negative number under the square root?

The equation has no real solutions; the two solutions are complex conjugates such as −1 ± 2i.

How does completing the square give the vertex?

In a(x − h)² + k, the vertex is (h, k).

Is completing the square the same as the quadratic formula?

The quadratic formula is completing the square done once with letters, so both give the same answers.

When is completing the square better than factoring?

When the quadratic does not factor over the integers, or when you also want the vertex.

Sources

  1. OpenStax: College Algebra 2e, section 2.5 Quadratic Equations
  2. Wolfram MathWorld: Completing the square
  3. Math is Fun: Completing the square

Updated November 25, 2026. Formulas checked against published sources and worked examples.

Cite this page: CalcRoster. "Completing the square calculator." calcroster.com/completing-the-square-calculator/. Updated November 25, 2026.

Results are estimates for general information. They are not financial, medical or legal advice. Check important decisions with a qualified professional.