Completing the Square Calculator

Enter the coefficients a, b, and c to complete the square and find the vertex form.

How it is calculated

Enter the three coefficients of ax² + bx + c. The tool computes the vertex coordinates h = −b / (2a) and k = c − b² / (4a), then writes the expression as a(x − h)² + k. It prints the vertex form, h, k and the vertex (h, k), all with four decimals. The sign of h is already built into the vertex form: a positive h appears as x − h and a negative h as x + |h|. Likewise k is shown with a plus or minus. Any real numbers work for b and c, but a cannot be 0, because then the expression is linear and no result is shown. The vertex is the lowest point when a is positive and the highest when a is negative. Powers are written with a caret, such as ^2.

Worked example

Rewrite 2x² − 12x + 7, so a = 2, b = −12, c = 7. Axis position: h = −(−12) / (2 × 2) = 12 / 4 = 3. Height: k = 7 − (−12)² / (4 × 2) = 7 − 144 / 8 = 7 − 18 = −11. The vertex form is 2.0000(x - 3.0000)^2 - 11.0000, with vertex (3.0000, −11.0000). Check by expanding: 2(x − 3)² − 11 = 2x² − 12x + 18 − 11 = 2x² − 12x + 7. Since a is positive, −11 is the minimum value.

Try this example →

Common mistakes

  • Misreading the sign of h. The vertex form is a(x − h)² + k, so (x − 3) means h = +3, and (x + 3) would mean h = −3.
  • Forgetting that a multiplies the whole bracket. For 2x² − 12x + 7 the form is 2(x − 3)² − 11, not (x − 3)² − 11, and dropping the 2 changes the parabola's width.
  • Entering an equation that is not in standard form. 3x² + 6 = 2x must first be moved to 3x² − 2x + 6 = 0, so that b = −2 and c = 6; otherwise b and c are wrong.
  • Leaving out a missing term instead of typing 0. For x² − 9 the coefficients are a = 1, b = 0, c = −9.
  • Reading k as the y-intercept. The y-intercept is c; k is the height of the vertex, and the two coincide only when b = 0.

About this calculator

Completing the square rewrites a quadratic ax² + bx + c into vertex form a(x − h)² + k, where h = −b/2a and k = c − b²/4a. In this form, (h, k) is the vertex of the parabola — its minimum point if a > 0, or maximum point if a < 0 — which is far easier to read off than from the original expanded form.

Algebra students and teachers use this technique to graph parabolas by finding the vertex directly, and it's also the method used to derive the quadratic formula itself, making it a foundational skill that shows up throughout algebra and pre-calculus coursework.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Once you have the vertex you can tell whether the parabola reaches the x-axis: opposite signs for a and k mean two crossings, the same sign means none. With the default 1, -6, 5 you get a = 1 and k = -4, so the roots sit 2 either side of h = 3, at x = 1 and x = 5. A quick self-check: a × h² + k should give back c. Is this for graphing or for deriving the quadratic formula?

Popular calculators

All Calculators