Completing the Square Calculator

Convert ax² + bx + c to vertex form a(x−h)² + k. Full step-by-step solution, vertex, and axis of symmetry shown.

Enter a, b, and c for ax² + bx + c. The calculator converts it to vertex form a(x−h)²+k, showing every step of the process and the resulting vertex and axis of symmetry.

Enter ax² + bx + c vertex form
x² coefficient (≠ 0)
x coefficient
constant

What is completing the square?

Completing the square is a technique for rewriting a quadratic from standard form, ax² + bx + c, into vertex form, a(x − h)² + k. The two forms describe the exact same parabola — vertex form just makes the vertex (h, k) visible at a glance instead of buried inside the coefficients.

The name comes from the middle of the process: a quadratic expression like x² + bx is missing a constant term that would make it a perfect square trinomial — one that factors as (x + something)². Completing the square means adding (and then immediately subtracting, to keep the expression unchanged) exactly the right constant to “complete” that missing piece.

Standard formax² + bx + c
Vertex forma(x − h)² + k

Vertex form is useful well beyond just locating the vertex — it’s also how the quadratic formula itself is originally derived, and it makes graphing, finding the axis of symmetry, and identifying the maximum or minimum value of a quadratic function far more direct than working from standard form alone. Every quadratic has both forms available; converting between them is purely a matter of algebraic rearrangement, not a change in what function is being described. A parabola graphed from ax² + bx + c and the same parabola graphed from its equivalent a(x − h)² + k form are pixel-for-pixel identical — vertex form simply exposes information that standard form leaves implicit in a combination of coefficients.

The vertex formula

Completing the square on the general form ax² + bx + c produces a direct formula for h and k, which this calculator uses to compute the final answer:

Vertex coordinatesh = −b / (2a)     k = c − b² / (4a)

These two formulas are worth recognizing on sight: h = −b/(2a) is exactly the same expression that gives the axis of symmetry of a parabola, and it’s also the “−b/(2a)” term that sits in the middle of the quadratic formula. Completing the square is, in a real sense, where that formula comes from in the first place.

Reading the vertex geometrically

Once a quadratic is in vertex form, its graph can be sketched almost by inspection. The vertex (h, k) is the single turning point of the parabola — its lowest point if a is positive, or its highest point if a is negative. The value of a also controls how narrow or wide the parabola is: a larger |a| produces a narrower, steeper curve, while a smaller |a| produces a wider, flatter one, exactly as it does in standard form.

Sign of aParabola opensVertex is a...
PositiveUpwardMinimum point
NegativeDownwardMaximum point

The axis of symmetry — the vertical line the parabola is mirror-symmetric across — is simply x = h, read directly off the vertex form without any further calculation. This is often the single most useful piece of information vertex form provides over standard form, since standard form requires computing −b/(2a) separately to get the same value.

Step-by-step process

  1. Factor a out of the x² and x terms only, leaving the constant c outside. If a = 1, this step does nothing and can be skipped.
  2. Take half of the coefficient of x inside the parentheses (that’s b/a, so half of it is b/(2a)), and square that value.
  3. Add and subtract that squared value inside the parentheses. This changes nothing about the expression’s value, since adding and subtracting the same amount cancels out — but it sets up a perfect square trinomial.
  4. Rewrite the perfect square trinomial as a squared binomial, and move the leftover “subtracted” piece (multiplied back through by a) outside the parentheses to join the constant.
  5. Read off h and k from the resulting a(x − h)² + k form.

Worked example: a = 1

Complete the square for x² − 6x + 5.

Step 1 doesn’t apply, since a = 1. Step 2: half of −6 is −3, and (−3)² = 9. Step 3: add and subtract 9: x² − 6x + 9 − 9 + 5. Step 4: the first three terms factor as (x − 3)², leaving −9 + 5 = −4 outside:

Result(x − 3)² − 4

Reading off the vertex form directly: h = 3, k = −4, matching the vertex formula h = −b/(2a) = −(−6)/2 = 3 and k = c − b²/(4a) = 5 − 36/4 = −4.

Worked example: a ≠ 1

Complete the square for 2x² + 8x + 3.

Step 1: factor 2 out of the first two terms: 2(x² + 4x) + 3. Step 2: half of 4 is 2, and 2² = 4. Step 3: add and subtract 4 inside the parentheses: 2(x² + 4x + 4 − 4) + 3. Step 4: factor the perfect square and move the leftover term out, multiplying it back by the factored-out a = 2: 2(x + 2)² − 8 + 3 = 2(x + 2)² − 5.

Result2(x + 2)² − 5

This example is worth studying closely because of the subtraction step: the “−4” inside the parentheses gets multiplied by the factored-out 2 when it moves outside (2 × −4 = −8), which is a detail that’s easy to lose track of when a isn’t 1.

Worked example: negative a

Complete the square for −x² + 4x + 1.

Step 1: factor −1 out of the first two terms: −(x² − 4x) + 1. Step 2: half of −4 is −2, and (−2)² = 4. Step 3: add and subtract 4 inside the parentheses: −(x² − 4x + 4 − 4) + 1. Step 4: factor the perfect square, and carefully multiply the leftover −4 by the factored-out −1 when moving it outside: −(x − 2)² − (−1 × 4) + 1 = −(x − 2)² + 4 + 1 = −(x − 2)² + 5.

Result−(x − 2)² + 5

Checking against the vertex formula: h = −b/(2a) = −4/(2×−1) = 2, and k = c − b²/(4a) = 1 − 16/(−4) = 1 + 4 = 5 — both match. This example is a useful one to practice specifically because negative values of a require extra care with signs at every single step, not just the final one.

Why h uses a minus sign

A detail that trips people up: the vertex formula gives h = −b/(2a), with a minus sign built in, even though the completed expression inside the parentheses often reads as “x + something.” The resolution is that “x + (something)” and “x − h” are the same statement whenever h itself is negative — (x − h) with h = −3 is literally x − (−3), which simplifies to x + 3.

Sign of bSign of h = −b/(2a)How the binomial reads
PositiveNegative"x + (positive number)"
NegativePositive"x − (positive number)"
ZeroZeroJust "x"

The underlying formula a(x − h)² + k never changes — only which sign ends up visible in the simplified binomial does, depending on the sign of h itself. Getting this backwards (writing “x − half” using the un-negated b/(2a) value directly, instead of correctly negating it to get h) is a subtle sign error that produces a binomial with exactly the wrong sign — worth watching for closely in any hand-worked solution.

Checking your answer

The fastest check is to expand the vertex form back out and confirm it matches the original standard form. Using the a ≠ 1 example above, 2(x + 2)² − 5 expands as: 2(x² + 4x + 4) − 5 = 2x² + 8x + 8 − 5 = 2x² + 8x + 3 — which matches the original 2x² + 8x + 3 exactly.

A second, faster check: plug a single convenient x-value, such as x = 0, into both the original standard form and the vertex form, and confirm the two outputs agree. At x = 0: the standard form gives 2(0)² + 8(0) + 3 = 3. The vertex form gives 2(0+2)² − 5 = 2(4) − 5 = 3. They match.

Common mistakes to avoid

Forgetting to multiply the subtracted term by a when moving it outside the parentheses. When a ≠ 1, the ”− (half)²” term that gets pulled out of the parentheses has to be multiplied by a first, since it was inside a set of parentheses that a was factoring. Pulling it out unchanged (without the multiplication) is one of the most common arithmetic slips in this topic.

Getting the sign of h backwards. As covered above, h = −b/(2a) always includes a negative sign relative to b/(2a). Writing the vertex form using the un-negated value produces a binomial with the wrong sign — correct on the surface (same numbers involved) but describing a parabola shifted to the opposite side of the y-axis from the real one.

Only completing the square inside the parentheses, and forgetting the “subtract” half. Adding the squared value without also subtracting it changes the value of the expression, which is not allowed — the whole point of adding-and-subtracting the same number is that it’s a legal, value-preserving rewrite.

Skipping the factor-out step when a ≠ 1. Trying to complete the square directly on ax² + bx without first factoring out a leads to fractions and sign errors that are much easier to avoid by factoring a out first, even when a is a “nice” number like 2 or 3.

Mishandling the sign when a is negative. As the third worked example above shows, a negative a means every sign in the process needs extra attention — the leftover term inside the parentheses gets multiplied by a negative number when it moves outside, which flips its sign relative to what a positive-a problem would produce at the same step.

Real-world applications

Projectile motion and optimization. A projectile’s height over time is often modeled by a downward-opening quadratic; completing the square directly reveals the maximum height (k) and the time it occurs (h) without needing calculus, since the vertex of a downward-opening parabola is exactly its highest point.

Business: maximizing profit or revenue. When profit is modeled as a quadratic function of price or quantity, completing the square identifies the exact price point that maximizes profit (h) and what that maximum profit actually is (k), directly from the model’s coefficients.

Engineering: minimizing material or cost. Many optimization problems in engineering and design reduce to minimizing a quadratic cost function; completing the square finds that minimum directly, which is often faster and more transparent than other optimization methods for a problem that’s genuinely quadratic.

Deriving the quadratic formula itself. Applying completing the square to the fully general ax² + bx + c = 0, then solving for x, is the standard derivation of the quadratic formula — anyone comfortable with the process in this article already understands, at least in outline, where that famous formula actually comes from.

Frequently asked questions
What is vertex form?
Vertex form is a(x − h)² + k, an alternative way of writing a quadratic that puts its vertex (h, k) directly in the formula. It describes the exact same parabola as standard form ax² + bx + c — the two are algebraically equivalent, just rearranged.
What is the formula for h and k when completing the square?
h = −b/(2a) and k = c − b²/(4a). These come directly from the completing-the-square process applied to the general quadratic, and h also happens to equal the parabola's axis of symmetry.
Why does h have a minus sign in a(x − h)²?
Because a(x − h)² needs to expand back to the original quadratic exactly, and working through the algebra shows h must equal −b/(2a), not b/(2a). If h is negative, (x − h) simplifies to "x plus a positive number," which is why some vertex forms visually show a plus sign even though the formula itself always subtracts h.
What if a is not 1?
Factor a out of the x² and x terms only (leaving the constant outside) before completing the square inside the parentheses. When the leftover term is moved back outside those parentheses at the end, it must be multiplied by a — a step that's easy to forget.
How can I check my completed-the-square answer?
Expand the vertex form back out and confirm it matches the original standard form, or plug in a single convenient x-value (like x = 0) into both forms and confirm they give the same result.
Is completing the square the same as the quadratic formula?
They're closely related — applying completing the square to the fully general ax² + bx + c = 0 and solving for x is exactly how the quadratic formula is derived. Completing the square converts to vertex form; the quadratic formula solves for the roots directly.
What does the vertex tell you about the parabola?
The vertex (h, k) is the parabola's single turning point — its minimum if a is positive, or its maximum if a is negative. The axis of symmetry is the vertical line x = h, read directly off the vertex form.