Completing the Square Calculator with Step-by-Step Results

Enter the coefficients from ax² + bx + c = 0. Exact algebra runs locally in your browser, and your coefficients are not sent anywhere.

See the number added to both sides, completed-square form, vertex form, exact and decimal roots, and a substitution check.

Enter quadratic coefficients

x² + 6x + 5 = 0

Use integers, finite decimals, or fractions such as -3/4. Enter zero for a missing x or constant term.

Try an example

Result

Completed-square equation
Enter coefficients to begin.
Solutions
Vertex form
Vertex
Number added
Root type
Decimal roots
Verification

Advertisement

Step-by-step completing the square

The algebra steps will appear here.

Advertisement

How completing the square works

Completing the square uses one identity. If the coefficient of x is p, half of it is p/2, and:

x² + px = (x + p/2)² − (p/2)²

1. Make x² monic

If a ≠ 1, divide every term in ax²+bx+c=0 by a. The new x coefficient is b/a.

2. Move the constant

Rewrite the equation as x²+(b/a)x=−c/a so the variable terms are together.

3. Add the square term

Add (b/2a)² to both sides. The left side now factors as (x+b/2a)².

4. Take both square roots

Use the plus-or-minus sign, then isolate x. A negative right side gives complex roots.

Completed-square and vertex forms

For any quadratic with a ≠ 0:

ax² + bx + c = a(x + b/2a)² + c − b²/4a

This is vertex form a(x−h)²+k, so h=−b/(2a) and k=c−b²/(4a). The vertex is (h,k), and the axis of symmetry is x=h.

Worked examples

Leading coefficient 1

For x²+6x+5=0, move 5 and add (6/2)²=9: (x+3)²=4. Therefore x+3=±2, so x=−1, −5.

Leading coefficient not 1

For 2x²−8x+5=0, divide by 2: x²−4x=−5/2. Add 4 to get (x−2)²=3/2, so x=2±√6/2.

Repeated root

For x²−8x+16=0, add 16 after moving the constant: (x−4)²=0. The only root is x=4, counted twice.

Complex roots

For x²+4x+8=0, completing the square gives (x+2)²=−4. Thus x+2=±2i, so x=−2±2i.

Calculation method, privacy, and limits

Integers, fractions, and finite decimals are converted to reduced fractions and processed with BigInt arithmetic. The displayed algebra is exact; decimal roots are rounded to 10 significant decimal places. Results are verified numerically by substituting each root into the original quadratic.

To keep browser calculations responsive, each numeric part is limited to 18 digits and normalized integer coefficients must not exceed 1012 in magnitude. Inputs outside that range receive an error rather than an unreliable result. Radical extraction checks square factors up to 100,000 and always preserves an exact radical even when a very large radicand is not reduced further. Last reviewed: 4 August 2026.

Completing the square FAQs

What does completing the square mean?

It rewrites a quadratic so part of it is a perfect-square binomial. The identity x²+px=(x+p/2)²−(p/2)² is the key step.

What number do I add when completing the square?

After making the x² coefficient 1, take half the x coefficient and square it. For x²+px, add (p/2)² to both sides.

Do I have to divide by a first?

Yes when a ≠ 1. Divide every term by a so the leading coefficient is one before forming the perfect square.

How does completing the square give vertex form?

ax²+bx+c becomes a(x−h)²+k, where h=−b/(2a) and k=c−b²/(4a).

Can completing the square produce complex roots?

Yes. If the completed square equals a negative number, taking square roots introduces i, the imaginary unit, and gives a complex-conjugate pair.

Does the calculator accept fractions and decimals?

Yes. Enter integers, finite decimals, or fractions such as 3/4. Finite decimals are converted to exact fractions before any algebra is performed.

Explore more tools