🇺🇸 USC
Math & Conversion
🟦

Completing the Square Calculator

Rewrite a quadratic in vertex form, step by step

Last updated September 6, 2026

Method: The identity ax² + bx + c = a(x + b/2a)² + (c - b²/4a). Coefficients are handled as exact fractions, radicals are reduced to simplest form, and every result is verified by expanding the completed form back out.

Included: The completed square (vertex) form, every algebra step, the number (b/2a)² you add, the vertex, the axis of symmetry, the minimum or maximum value, the y-intercept, the discriminant, and the exact real or complex solutions of the equation set to zero.

Not included: Cubic and higher-degree polynomials, quadratics in two variables (conic sections), systems of equations, and graph plotting. The tool assumes a real coefficient a that is not zero.

Enter the coefficients of ax² + bx + c

Rearrange your equation so every term is on one side first. a cannot be zero.

Try an example

🔢 Completed square (vertex) form

2(x + 2)² - 3
2x² + 8x + 5 rewritten
Vertex
(-2, -3)
Axis of symmetry
x = -2
Minimum value
-3
Discriminant b² - 4ac
24

📝 Step by step

  1. 1. Write the quadratic in standard form
    2x² + 8x + 5
    a = 2, b = 8, c = 5
  2. 2. Factor a out of the x² and x terms
    2(x² + 4x) + 5
    b ÷ a = 4
  3. 3. Halve the x-coefficient and square it
    (4 ÷ 2)² = (2)² = 4
    This is the number you add: (b / 2a)² = 4
  4. 4. Add and subtract it inside the bracket
    2(x² + 4x + 4 - 4) + 5
    Adding and subtracting the same value leaves the expression unchanged.
  5. 5. Group the perfect square trinomial
    2(x + 2)² - 8 + 5
    Taking 2 × 4 = 8 back out of the bracket.
  6. 6. Combine the constants: vertex form
    2(x + 2)² - 3
    c - b² / 4a = 5 - 8 = -3
Check: expanding the completed form reproduces the original quadratic exactly.

✓ Solving 2x² + 8x + 5 = 0 from the completed form

Two distinct real solutions.

  1. Set the completed form equal to zero
    2(x + 2)² - 3 = 0
  2. Isolate the squared bracket
    (x + 2)² = 3/2
  3. Take the square root of both sides
    x + 2 = ± 1/2 × √6
  4. Solve for x
    x = (-4 + √6) / 2 and x = (-4 - √6) / 2
Solution 1
x = (-4 + √6) / 2
-0.7753
Solution 2
x = (-4 - √6) / 2
-3.2247

📈 What the vertex form tells you

Vertex form2(x + 2)² - 3
Vertex (h, k)(-2, -3) ≈ (-2, -3)
OpensUpward (a > 0)
Minimum of the functiony = -3 at x = -2
y-intercept(0, 5)
Number added to complete the square(b / 2a)² = 4
Real roots2

Exact algebra. Coefficients are handled as exact fractions, so the vertex, the constant (b / 2a)² and rational roots are shown without rounding. Irrational roots are given in simplified radical form with a decimal approximation.

Completing the square: everything you need to know

Completing the square rewrites a quadratic so the variable appears only once, inside a perfect square. Take 2x² + 8x + 5. Factor out the 2, halve the 4 that is left in front of x, square it to get 4, and the expression becomes 2(x + 2)² - 3. The vertex is now readable at a glance: (-2, -3).

Three sister tools cover the neighboring questions. The Quadratic Formula Calculator jumps straight to the roots when you do not need the working, the Factoring Calculator is faster when the quadratic breaks into whole-number factors, and the Square Root Calculator simplifies the radical that appears at the last step. Use this page when you need the method: the vertex, the maximum or minimum, or a step-by-step solution you can copy into your homework.

How completing the square works

Every quadratic in standard form can be rewritten with a single identity:

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

The bracket (x + b/2a)² is the perfect square, and the leftover constant c - b²/4a is what remains after the square has absorbed as much of the expression as it can. Written as a(x - h)² + k, the parabola has its vertex at (h, k), where h = -b/2a and k = c - b²/4a.

The mechanics are always the same four moves: factor the leading coefficient out of the first two terms, halve the x-coefficient that is left and square it, add and subtract that number inside the bracket, then group the perfect square and tidy the constants. The number you add, (b/2a)², is the only piece of real arithmetic in the whole method.

Worked example: 2x² + 8x + 5

Follow the six steps the calculator shows for the default example.

  1. Standard form: a = 2, b = 8, c = 5.
  2. Factor out a: 2(x² + 4x) + 5, because 8 ÷ 2 = 4.
  3. Halve and square: (4 ÷ 2)² = 2² = 4. This is the number you add.
  4. Add and subtract inside: 2(x² + 4x + 4 − 4) + 5.
  5. Group the square: 2(x + 2)² − 8 + 5, because the −4 leaving the bracket is multiplied by 2.
  6. Combine constants: 2(x + 2)² − 3.

Check it by expanding: 2(x + 2)² − 3 = 2(x² + 4x + 4) − 3 = 2x² + 8x + 8 − 3 = 2x² + 8x + 5. The original is back, so the rewrite is exact.

Now solve 2x² + 8x + 5 = 0 from the completed form. Set 2(x + 2)² − 3 = 0, so (x + 2)² = 3/2. Take the square root of both sides: x + 2 = ±√(3/2) = ±√6 ÷ 2. Therefore x = (−4 ± √6) ÷ 2, which is about −0.775 and −3.225. The discriminant b² − 4ac = 64 − 40 = 24 agrees: √24 = 2√6, and the quadratic formula gives (−8 ± 2√6) ÷ 4, the same pair after cancelling the 2.

A second worked example with fractions: x² + 5x + 3

An odd b is where students usually stumble, because half of it is a fraction. Here a = 1, so there is nothing to factor out. Half of 5 is 5/2, and squaring gives 25/4. Add and subtract it: x² + 5x + 25/4 − 25/4 + 3. Group the square and combine the constants, using 3 = 12/4, so −25/4 + 12/4 = −13/4. The completed form is (x + 5/2)² − 13/4, giving the vertex (−5/2, −13/4), or (−2.5, −3.25) as decimals.

Solving: (x + 5/2)² = 13/4, so x + 5/2 = ±√13 ÷ 2 and x = (−5 ± √13) ÷ 2. Since √13 ≈ 3.6056, the roots are about −0.697 and −4.303. Note how the exact answer keeps the radical: rounding √13 too early is the fastest way to lose marks on an exam. The calculator on this page keeps every intermediate value as an exact fraction and only rounds in the final approximation line.

Completed square form for common quadratics

Each row was produced with the identity above. The third column is what the calculator prints, and the last column solves the corresponding equation from that form.

Quadratic Add (b/2a)² Completed form Vertex Solutions
x² + 6x + 59(x + 3)² − 4(−3, −4)−1 and −5
x² − 6x + 79(x − 3)² − 2(3, −2)3 ± √2 ≈ 4.414, 1.586
2x² + 8x + 542(x + 2)² − 3(−2, −3)(−4 ± √6)/2 ≈ −0.775, −3.225
3x² − 12x + 743(x − 2)² − 5(2, −5)(6 ± √15)/3 ≈ 3.291, 0.709
x² + 5x + 325/4(x + 5/2)² − 13/4(−5/2, −13/4)(−5 ± √13)/2 ≈ −0.697, −4.303
2x² − 7x + 349/162(x − 7/4)² − 25/8(7/4, −25/8)3 and 1/2
4x² + 12x + 59/44(x + 3/2)² − 4(−3/2, −4)−1/2 and −5/2
−2x² + 8x − 34−2(x − 2)² + 5(2, 5)(4 ± √10)/2 ≈ 3.581, 0.419

Two patterns are worth noticing. First, the number you add depends only on b and a, never on c, which is why x² + 6x + 5 and x² + 6x + 13 both take a 9. Second, when a is negative the vertex is a maximum instead of a minimum: −2(x − 2)² + 5 peaks at y = 5.

The number you add: half of b, squared

For a monic quadratic (a = 1) the whole method collapses to a single reflex: halve b, square it, and you have a perfect square trinomial. This table is worth memorizing for mental math.

b b ÷ 2 (b ÷ 2)² x² + bx + (b/2)² factors as
211(x + 1)²
33/29/4(x + 3/2)²
424(x + 2)²
55/225/4(x + 5/2)²
639(x + 3)²
77/249/4(x + 7/2)²
8416(x + 4)²
−10−525(x − 5)²

The squared value is always positive, even when b is negative, because squaring kills the sign. The sign of b survives only inside the bracket: a negative b gives (x − something)².

Reading the completed form: what a and k tell you

Once a quadratic sits in the form a(x − h)² + k, the signs of a and k answer three questions instantly, with no graphing and no discriminant.

Sign of a Sign of k Vertex is a Real roots Example
a > 0k < 0minimum below the x-axis2(x + 3)² − 4, roots −1 and −5
a > 0k = 0minimum on the x-axis1 repeated(x + 3)², root −3
a > 0k > 0minimum above the x-axis0(x + 3)² + 4, roots −3 ± 2i
a < 0k > 0maximum above the x-axis2−2(x − 2)² + 5, roots (4 ± √10)/2
a < 0k = 0maximum on the x-axis1 repeated−2(x − 2)², root 2
a < 0k < 0maximum below the x-axis0−2(x − 2)² − 3, roots (4 ± i√6)/2

The rule behind the table: real roots exist only when a and k have opposite signs, because solving needs (x − h)² = −k/a, and a square can never be negative. That is the same information the discriminant carries, arrived at without computing b² − 4ac.

How to use this calculator

  1. Rearrange first. Move every term to one side so the expression reads ax² + bx + c. For example 2x² + 5 = 7x becomes 2x² − 7x + 5.
  2. Enter a, b and c with their signs. A missing term simply means that coefficient is 0. Decimals such as 0.5 are accepted and converted to exact fractions.
  3. Read the headline. The blue card shows the completed square form, the vertex, the axis of symmetry, the minimum or maximum value, and the discriminant.
  4. Follow the numbered steps. Each one names what is happening and shows the algebra, so you can copy the working rather than just the answer.
  5. Check the solving panel. It isolates the bracket, takes the square root of both sides, and gives the exact roots in radical or a ± bi form plus decimal approximations.
  6. Try the example buttons if you want to see how a negative a, a fractional vertex, or a complex-root case behaves before entering your own numbers.

Everything recalculates as you type, so you can watch how one coefficient changes the whole picture.

Who this calculator is for

  • Algebra 1 and Algebra 2 students learning the method and needing every step spelled out.
  • Precalculus and calculus students converting to vertex form before graphing, or completing the square inside an integral or a conic-section equation.
  • Students checking homework who already have an answer and want to confirm the vertex and the constant they added.
  • Teachers and tutors generating clean worked examples with exact fractions instead of rounded decimals.
  • Anyone optimizing a quadratic model such as maximum area, maximum revenue, or projectile height, where the vertex is the answer.

Key terms explained

  • Standard form: ax² + bx + c, with terms ordered by descending power and a not equal to 0.
  • Vertex form: a(x − h)² + k. The completed square form is exactly this, with h = −b/2a and k = c − b²/4a.
  • Perfect square trinomial: an expression such as x² + 6x + 9 that factors as a single square, (x + 3)². Completing the square manufactures one on purpose.
  • Vertex: the turning point of the parabola, the minimum when a is positive and the maximum when a is negative.
  • Axis of symmetry: the vertical line x = h that mirrors the parabola onto itself.
  • Discriminant: b² − 4ac. Positive means two real roots, zero means one repeated root, negative means a complex conjugate pair.
  • Monic quadratic: one with a = 1, where the method needs no factoring step at all.

What changes the result the most

  • b relative to a: the whole method hinges on b/2a. Change b and both the number you add and the horizontal position of the vertex move.
  • The sign of a: it flips the parabola, turning a minimum into a maximum and reversing which side of the x-axis produces real roots.
  • c: it shifts the parabola vertically without touching h. Raise c enough and two real roots become none.
  • Whether b/2a is a whole number: an odd b with a = 1 forces fractions, which is where most hand-worked errors appear.
  • Whether −k/a is a perfect square: if it is, the roots are rational and the quadratic could also have been factored; if not, you are left with a radical.

Tips for doing it by hand

  • Factor a out of only the x² and x terms. The constant c stays outside the bracket the entire time.
  • Write the bracket as (x + b/2a)² immediately once you know b/2a. The sign inside the bracket matches the sign of b/2a.
  • When the subtracted number leaves the bracket, multiply it by a. Forgetting that factor is the single most common error.
  • Keep fractions as fractions. Converting 5/2 to 2.5 is fine, but 1/3 to 0.333 will poison the final constant.
  • Always expand your answer back out as a check. It takes ten seconds and catches nearly every slip.
  • If you only need the vertex and not the working, remember h = −b/2a and substitute it back to get k.

Deriving the quadratic formula by completing the square

The quadratic formula is not a separate idea, it is this method applied once to the general equation. Start with ax² + bx + c = 0 and divide through by a to get x² + (b/a)x + c/a = 0. Move the constant across: x² + (b/a)x = −c/a. Half of b/a is b/2a, so add (b/2a)² = b²/4a² to both sides. The left side is now the perfect square (x + b/2a)², and the right side is b²/4a² − c/a, which over the common denominator 4a² equals (b² − 4ac)/4a². Take the square root of both sides: x + b/2a = ±√(b² − 4ac) ÷ 2a. Subtract b/2a and you have the familiar x = (−b ± √(b² − 4ac)) ÷ 2a.

That is why the discriminant appears under the radical and why the axis of symmetry is −b/2a: both fall out of the same completion. If you would rather skip the derivation and go straight to the roots, the Quadratic Formula Calculator does exactly that.

Where completing the square is actually used

Beyond homework, the technique earns its keep in several places. In optimization problems the vertex is the answer: if revenue is modeled by −2x² + 8x − 3, the completed form −2(x − 2)² + 5 says the maximum revenue of 5 occurs at x = 2, with no calculus required. In graphing, vertex form gives the turning point, the axis of symmetry, and the direction of opening before you plot a single point. In analytic geometry, completing the square on both variables turns a scattered equation such as x² + y² − 6x + 4y = 3 into the standard circle form (x − 3)² + (y + 2)² = 16, revealing the center and radius. In calculus, it rewrites awkward denominators so a substitution becomes obvious. And in statistics, completing the square is the standard algebraic step in deriving the normal distribution and in least-squares regression. The same four moves keep reappearing.

Limitations and assumptions

  • The tool handles a single-variable quadratic only. It does not complete the square in two variables, so circle and ellipse equations must be done one variable at a time.
  • a cannot be 0. With no x² term there is no square to complete, and the expression is linear instead.
  • Decimal coefficients are converted to fractions with up to six decimal places. Coefficients with longer expansions are rounded before the algebra runs, and the result panel says so.
  • Radicals are simplified for reasonably sized integers. Extremely large values under the radical may be left unsimplified rather than fully factored.
  • Complex roots are shown in a ± bi form, but the tool does no further complex arithmetic.
  • The calculator rewrites and solves, it does not draw the parabola. Use the vertex, the axis of symmetry, and the y-intercept it reports to sketch one yourself.

How it compares to related calculators

This page answers "rewrite this quadratic in vertex form and show me every step". If your question is different, a sister tool fits better:

Sources and method

Every number on this page comes from deterministic algebra, not from external data, so no outside source is required or cited. The tool applies one exact identity, ax² + bx + c = a(x + b/2a)² + (c − b²/4a), which is proved by expanding the right-hand side: a(x + b/2a)² + c − b²/4a = ax² + bx + b²/4a + c − b²/4a = ax² + bx + c. Coefficients are stored as exact rational numbers (numerator and denominator reduced by the greatest common divisor), radicals are simplified by removing perfect-square factors, and roots follow from the square root property: if u² = v with v greater than or equal to 0 then u = ±√v, and if v is negative then u = ±i√(−v). Each result is verified by expanding the completed form back to standard form before it is displayed, so a mismatch would be reported rather than shown as correct.

⚠️ Common mistakes & edge cases

Forgetting to multiply the subtracted number by a

In 2(x² + 4x + 4 − 4) + 5 the −4 is inside a bracket multiplied by 2, so it leaves as −8, not −4. The correct result is 2(x + 2)² − 3, not 2(x + 2)² + 1. This single slip accounts for most wrong answers.

Factoring a out of the constant too

Only the x² and x terms go inside the bracket. Writing 2(x² + 4x + 5/2) and then completing the square inside is legal but a different route, and mixing the two halfway is where the arithmetic falls apart. Keep c outside.

Adding without subtracting

Adding (b/2a)² changes the value of the expression unless you subtract it again in the same line. Adding to both sides is correct when you are solving an equation, but when you are rewriting an expression you must add and subtract.

Dropping the plus-or-minus

Taking the square root of both sides produces two values, not one. From (x + 2)² = 3/2 you get x + 2 = ±√6/2, so there are two roots. Keeping only the positive root loses half the answer.

Getting the vertex sign backwards

In a(x − h)² + k the vertex is (h, k), so (x + 3)² − 4 has its vertex at x = −3, not +3. The sign inside the bracket is the opposite of the vertex coordinate.

Rounding the fractions early

With an odd b, half of it is a fraction. Turning 5/2 into 2.5 is harmless, but converting a value like 7/3 to 2.33 will make the final constant wrong. Work in fractions until the very last line.

Note: The result is exact algebra, not an approximation. Where a root is irrational or complex, the exact radical form is the answer and the decimal underneath it is only a convenience.

❓ Frequently asked questions

What does completing the square mean?

Completing the square means rewriting a quadratic ax² + bx + c so that the variable appears only once, inside a perfect square bracket: a(x + b/2a)² + (c - b²/4a). You do it by adding the number that turns x² + (b/a)x into a perfect square trinomial, then subtracting the same amount again so the expression keeps its value. The result is called vertex form, because you can read the vertex of the parabola straight off it.

What is the formula for completing the square?

For ax² + bx + c the completed form is a(x + b/2a)² + (c - b²/4a). The number you add inside the bracket is (b/2a)², half of the x-coefficient after factoring out a, squared. For a monic quadratic (a = 1) this simplifies to x² + bx + c = (x + b/2)² + (c - b²/4), so you just halve b and square it.

How do I complete the square when a is not 1?

Factor a out of the x² and x terms first, leaving a(x² + (b/a)x) + c. Now the bracket is monic, so you halve b/a and square it to get (b/2a)². Add and subtract that inside the bracket, group the perfect square, and multiply the subtracted piece by a when you take it back outside. For 2x² + 8x + 5 that gives 2(x + 2)² - 8 + 5 = 2(x + 2)² - 3.

What number do I add to complete the square?

Half of the x-coefficient, squared. After factoring out a, the x-coefficient is b/a, half of it is b/2a, and squaring gives (b/2a)². For x² + 6x you add (6/2)² = 9, giving the perfect square (x + 3)². For x² + 5x you add (5/2)² = 25/4, giving (x + 5/2)². The calculator shows this number on every run.

How do I find the vertex by completing the square?

Once the quadratic is written as a(x - h)² + k, the vertex is simply (h, k). Because the completed form is a(x + b/2a)² + (c - b²/4a), the vertex is at x = -b/2a and y = c - b²/4a. For 2x² + 8x + 5 the completed form is 2(x + 2)² - 3, so the vertex is (-2, -3) and -3 is the minimum value of the function.

Can I solve any quadratic by completing the square?

Yes. Completing the square works on every quadratic, factorable or not, with rational, irrational or complex roots. That is its main advantage over factoring, which only works cleanly when the roots are rational. After completing the square you isolate the bracket, take the square root of both sides (remembering the plus-or-minus), and solve for x.

What if completing the square gives a negative number under the square root?

Then the equation has no real solutions and the two roots are complex conjugates. Geometrically, the parabola never crosses the x-axis. For x² + 6x + 13 the completed form is (x + 3)² + 4, so (x + 3)² = -4 and x = -3 ± 2i. The calculator reports complex roots in exact a ± bi form rather than saying no solution.

Is completing the square the same as the quadratic formula?

They give identical answers, because the quadratic formula is what you get when you complete the square on the general equation ax² + bx + c = 0 once and for all. Completing the square is the method; the formula is the shortcut you memorize. Completing the square also hands you the vertex, which the formula alone does not.

Why do I subtract the number I just added?

Because you are rewriting an expression, not solving an equation, so the value must not change. Adding (b/2a)² inside the bracket creates the perfect square you want, and subtracting the same amount immediately cancels it out. When a is not 1 the subtracted piece is multiplied by a as it leaves the bracket, which is why the constant becomes c - b²/4a rather than c - b²/4a².

How do I complete the square with fractions?

Exactly the same way, you just keep the fractions exact instead of rounding. For x² + 5x + 3 half of 5 is 5/2 and squaring gives 25/4, so the form is (x + 5/2)² - 25/4 + 3 = (x + 5/2)² - 13/4. This calculator works in exact fractions internally, so a vertex like (-5/2, -13/4) is shown as a fraction and never as a rounded decimal.

When should I use completing the square instead of factoring?

Factor first when the quadratic factors neatly over the integers, since it is faster. Reach for completing the square when the discriminant is not a perfect square, when the leading coefficient makes factoring awkward, or whenever you need the vertex, the maximum or minimum value, or a graph of the parabola. Completing the square is also the standard step for deriving vertex form and for integrating certain expressions in calculus.

How do I check my completed square answer?

Expand it back out. a(x + p)² + k expands to ax² + 2apx + ap² + k, so the x-coefficient must equal b and the constant must equal c. For 2(x + 2)² - 3 you get 2x² + 8x + 8 - 3 = 2x² + 8x + 5, which matches the original. This calculator runs that expansion check on every result before showing it.

What is vertex form and why is it useful?

Vertex form is y = a(x - h)² + k, where (h, k) is the vertex of the parabola. It is useful because you can read the turning point, the axis of symmetry x = h, the minimum or maximum value k, and the direction of opening (up when a is positive, down when a is negative) without any further work. Standard form ax² + bx + c hides all of that behind the arithmetic.

Does completing the square work if b = 0?

Yes, and it is trivial in that case. With b = 0 the number you add is (0/2a)² = 0, so ax² + c is already in vertex form with the vertex on the y-axis at (0, c). For x² - 9 the vertex is (0, -9) and taking the square root of both sides immediately gives x = ±3. The calculator detects this and shortens the step list.

💡 Good to know

c never affects the number you add

The value (b/2a)² depends only on a and b. That is why x² + 6x + 5 and x² + 6x + 13 both take a 9, and why the two parabolas share the same vertex x-coordinate of −3 while sitting at different heights.

The completed form answers optimization questions for free

Because a(x − h)² is never negative when a is positive, the smallest the expression can ever be is k, and that happens at x = h. Maximum area, minimum cost, and peak height problems are all this one observation.

The quadratic formula is this method, memorized

Completing the square on ax² + bx + c = 0 in general produces x = (−b ± √(b² − 4ac)) ÷ 2a. Understanding the method once means you can rebuild the formula any time you forget it.

Related Calculators