What is completing the square?

Completing the square is the method that rewrites a quadratic expression such as x² + 6x + 5 as a squared bracket plus a constant — here, (x + 3)² − 4. Nothing about the value changes; only the shape of the writing changes. That new shape is far more informative than the old one. In standard form, ax² + bx + c, the three coefficients hide the interesting facts: where the parabola turns, what its smallest or largest value is, and where it crosses the x-axis all have to be dug out. In the completed-square shape, called vertex form, a(x − h)² + k, the turning point (h, k) is printed inside the expression itself, and solving the equation becomes a matter of undoing a square with a square root.

This completing the square calculator performs the whole conversion for any quadratic you enter and shows every step of the working, not just the final line. That matters, because completing the square is usually taught as a skill to be used by hand in exams, where the method marks are in the steps. Watching the calculator halve the coefficient, square the half, balance the equation and factor the bracket — with your own numbers — is the fastest way to learn the rhythm of the method. The same working also produces the vertex, the vertex form and the solutions of ax² + bx + c = 0, so one calculation answers the three questions quadratics are most often asked about.

The completing the square steps

The method has five moves, and they never change. Step one: if a is not 1, divide by a — in practice, factor a out of the x terms so the bracket starts with a clean x². Step two: halve the coefficient of x inside the bracket. Step three: square that half; the result is the number that completes the square, (b/2a)² in the general formula. Step four: add that number inside the bracket and subtract exactly its value — multiplied by a, because everything inside the bracket is scaled by a — outside the bracket, so the expression keeps the same value. Step five: factor the first three terms inside the bracket into a perfect square, (x − h)², and collect the constants into k.

Two habits make the steps reliable. First, keep the balance visible: every number added in one place must be paid for in another, and most wrong answers in this topic are unbalanced equations rather than wrong ideas. Second, keep fractions exact until the last line. Halving an odd coefficient produces a fraction such as 5/2, whose square is 25/4; working with those fractions exactly, as this calculator does, keeps the vertex and the solutions exact as well. Rounding halfway through is how small errors creep into k and then into both roots. If the halving step feels mysterious, the next section shows the picture behind it: the method is named after a literal square of paper or land, and the algebra is just that picture written in symbols.

Why it works: completing a real square

The name is not a metaphor. Take the expression x² + 6x. Draw a square of side x; its area is x². The term 6x is a rectangle of sides x and 6. Split that rectangle into two strips of x by 3 and place one along the right edge of the square and one along the bottom. The figure is now almost a bigger square of side x + 3 — except that the bottom-right corner, a small square of side 3, is missing. Its area is 9, which is exactly (6/2)². Add that corner and the figure is a complete square of area (x + 3)². That is the whole method: x² + 6x + 9 = (x + 3)², and the 9 was not guessed — it is the missing corner, forced by halving the rectangle.

This picture explains the two facts students most often memorise without understanding. The coefficient is halved because the rectangle is split into two equal strips, one for each side of the growing square. The half is squared because the missing piece is literally a square whose side is that half. It also explains why the method works for any coefficient, including fractions and negatives: the picture stretches, but the corner is always (half the x coefficient)². When the coefficient is odd, the strips are simply 2.5 wide and the corner is 6.25. The calculator follows the same geometry in symbols, which is why its second and third steps always read: halve the coefficient, then square the half.

When a is not 1

Quadratics with a leading coefficient other than 1 cause most of the trouble in this topic, because the completing number is worth more outside the bracket than inside it. The rule is simple to state: complete the square inside the bracket using b/a, and remember that anything inside the bracket is multiplied by a. Take 2x² − 8x + 3. Factor 2 out of the x terms: 2(x² − 4x) + 3. Inside the bracket the coefficient is now −4; halving gives −2 and squaring gives 4. Adding 4 inside the bracket really adds 2 × 4 = 8 to the expression, so subtract 8 outside: 2(x² − 4x + 4) + 3 − 8 = 2(x − 2)² − 5. The vertex is (2, −5), and solving gives x = 2 ± √(5/2), approximately 0.4189 and 3.5811.

Negative leading coefficients work the same way. For −x² + 4x − 3, factor out −1: −(x² − 4x) − 3. Completing inside gives −(x − 2)² + 4 − 3 = −(x − 2)² + 1, with vertex (2, 1) — a maximum, because the parabola opens downward. The sign of a never changes the steps; it only changes whether the vertex is a floor or a ceiling. This calculator handles a = 1, a greater than 1, fractional a and negative a through the identical routine, and shows the factoring step explicitly whenever a is not 1, because that is the step hand working most often skips.

Worked example: x² + 6x + 5

Here is the example built into this page, done entirely by hand. The coefficients are a = 1, b = 6 and c = 5. Since a is 1, no division is needed. Halve the coefficient of x: 6 / 2 = 3. Square it: 3² = 9. Add 9 inside the working and subtract 9 to keep the balance: x² + 6x + 9 + 5 − 9. The first three terms factor as the perfect square (x + 3)², and the constants collect to −4. The vertex form is therefore (x + 3)² − 4, and the vertex is (−3, −4) — note the sign: the bracket holds x + 3, which is x − (−3), so h is −3, not 3. Because a is positive, the parabola opens upward and (−3, −4) is its minimum point.

Solving is now short. Set (x + 3)² − 4 = 0, so (x + 3)² = 4. Take square roots with the plus-or-minus sign: x + 3 = 2 or x + 3 = −2. The solutions are x = −1 and x = −5, sitting symmetrically either side of the axis x = −3, exactly as they should. Every figure here can be checked in the calculator above: enter a = 1, b = 6, c = 5 and the step-by-step panel reproduces this working line for line. A second check with a repeated root: x² − 4x + 4 completes to (x − 2)² + 0, the vertex sits on the x-axis at (2, 0), and the only solution is the repeated root x = 2.

Worked examples: the data table

The table below collects the worked examples used across this page, including the cases students find hardest: a leading coefficient of 2, a repeated root, and a quadratic whose solutions are complex. Reading across a row shows the complete journey of one quadratic — standard form in, vertex form, vertex and solutions out. Try each row in the calculator and compare the step-by-step panel with the row: the completing number (b/2a)², the vertex and the discriminant together explain every entry.

QuadraticCompleting number (b/2a)²Vertex formVertex (h, k)Solutions of the equation = 0
x² + 6x + 59(x + 3)² − 4(−3, −4)x = −1 and x = −5
2x² − 8x + 34 (inside the bracket)2(x − 2)² − 5(2, −5)x = 2 ± √(5/2) ≈ 0.4189 and 3.5811
x² − 4x + 44(x − 2)² + 0(2, 0)x = 2 (repeated root)
x² + 2x + 51(x + 1)² + 4(−1, 4)x = −1 + 2i and x = −1 − 2i (complex)
−x² + 4x − 34 (inside the bracket)−(x − 2)² + 1(2, 1)x = 1 and x = 3

Two patterns in the table are worth noticing. First, the sign of k tells you about the roots before you solve anything: when a and k have opposite signs, the vertex is on the opposite side of the x-axis from the opening direction and two real roots are guaranteed; when k is 0 the vertex touches the axis and the root repeats. Second, the complex row is not a failure case. x² + 2x + 5 has its vertex at (−1, 4), above the axis, while opening upward — it never reaches the axis, so its solutions must be complex, and completing the square shows exactly where the 2i comes from: (x + 1)² = −4.

Reading the vertex and vertex form

The completed-square form a(x − h)² + k is called vertex form because the vertex of the parabola, (h, k), can be read straight from it — which is precisely what our companion Vertex Calculator is built around. The value a keeps its standard-form job: its sign says whether the parabola opens up or down, and its size controls the width. The axis of symmetry is the vertical line x = h. The extreme value of the function is k — a minimum when a is positive, a maximum when a is negative — reached at x = h. A vertex form calculator and a complete the square calculator are therefore two views of one calculation: this page shows the rewriting steps in full, while the vertex page starts from either form and reports the focus, directrix and intercepts as well.

One warning belongs with vertex form, and it causes more lost marks than any other in this topic: the sign inside the bracket is reversed. The term (x − 2)² means h = 2, but (x + 3)² means h = −3, because the bracket is always x minus h. Reading (x + 3)² − 4 as vertex (3, −4) instead of (−3, −4) is the classic error. A reliable habit is to ask: what value of x makes the bracket zero? That value is h. For (x + 3)² the bracket is zero at x = −3, so h = −3. This calculator always reports the vertex as a coordinate pair alongside the vertex form, so the two can be checked against each other at a glance.

Solve by completing the square

Solving by completing the square means using the vertex form as a solving machine. Once ax² + bx + c has been rewritten as a(x − h)² + k, set it equal to zero and isolate the squared bracket: (x − h)² = −k/a. Then take the square root of both sides — keeping the ± sign, which is where the second solution comes from — and add h. The method handles every case uniformly. If −k/a is positive, two real solutions appear. If it is zero, the two solutions merge into one repeated root at x = h. If it is negative, no real square root exists and the solutions are complex, written with the imaginary unit i: for x² + 2x + 5, the step reads (x + 1)² = −4, so x + 1 = ±2i and x = −1 ± 2i.

Why learn this when the quadratic formula exists? Three reasons. First, many courses and exams explicitly require the method, because it demonstrates understanding rather than substitution. Second, it produces the vertex form as a by-product, so a single working answers solve, sketch and optimise questions at once. Third, it is the method that generalises: the same complete-the-square move reappears in circle equations, in integration, in statistics when completing the square in a normal distribution exponent, and in physics. For pure arithmetic speed on a bare solve, the formula wins; for everything around the solve, completing the square is the more useful tool. If a problem instead hands you two simultaneous equations, our System of Equations Solver covers that ground.

Where the quadratic formula comes from

The quadratic formula is not a separate invention — it is completing the square performed once, in letters, on the general equation. Start with ax² + bx + c = 0 and divide by a: x² + (b/a)x + c/a = 0. Move the constant across: x² + (b/a)x = −c/a. Halve the coefficient of x to get b/(2a), square it to get b²/(4a²), and add it to both sides. The left side is now the perfect square (x + b/(2a))², and the right side combines over a common denominator: (b² − 4ac)/(4a²). Take square roots, remembering the ±: x + b/(2a) = ±√(b² − 4ac)/(2a). Subtract b/(2a) and the formula stands complete: x = (−b ± √(b² − 4ac)) / (2a).

Seeing the derivation once explains several things the bare formula hides. The discriminant b² − 4ac is simply the numerator that ends up under the square root, which is why its sign decides the number of real solutions: positive gives two, zero gives one repeated solution, and negative gives a complex pair. The −b/(2a) that centres the formula is the same h that completing the square produces — the axis of symmetry — and the ±√ term measures how far the roots sit either side of it. It also explains why a must not be zero: the very first step divides by a. If you need a square root evaluated on its own, our Square Root Calculator shows that working, and our Slope Calculator covers the straight-line graphs that remain when a is zero.

Common mistakes and how to avoid them

The most common completing the square mistake is unbalanced adding: putting the completing number inside the bracket and forgetting that, when a is not 1, it must be subtracted a times over outside. Writing the balance as a separate visible step, as this calculator does, prevents it. Second is skipping the division by a and halving b instead of b/a — with 2x² − 8x + 3 that error gives a completing number of 16 instead of 4 and a wrong vertex. Third is the vertex sign trap described above: reading h straight off the bracket without flipping the sign. Fourth is dropping the ± when taking square roots, which throws away one of the two solutions.

Fifth is panicking at fractions: an odd b makes b/2a fractional, and students often round it to a decimal early, corrupting k and both roots. Keep the fraction; (5/2)² = 25/4 is exact and harmless. Sixth is declaring no solutions when the squared bracket equals a negative number, without stating the complex pair — in courses that cover complex numbers, x = −1 ± 2i is the full answer, not an error. Seventh is a checking failure: expanding the finished vertex form back should always return the original quadratic, and thirty seconds spent on that check catches nearly every slip above. The calculator performs that same discipline internally — its vertex satisfies k = c − b²/(4a) and its solutions satisfy the original equation.

Where completing the square is used every day

In school and exams, completing the square is a required method in its own right and the standard route to vertex form for sketching parabolas, finding maximum and minimum values, and solving quadratics that do not factorise. In physics and engineering, the vertex it reveals is the peak of a projectile's flight, the optimal operating point of a system modelled by a quadratic, and the centre form of a circle's equation, where the identical technique turns x² + y² + Dx + Ey + F = 0 into a centre and radius that can be read off directly. In optimisation problems — the largest area a fixed length of fencing can enclose, the price that maximises revenue — the answer is a vertex, and completing the square finds it without calculus.

In later mathematics the move keeps returning: integrals are simplified by completing the square in a denominator, Laplace transforms and control theory use it to recognise standard forms, and probability uses it to combine exponents in normal distributions. Even computer graphics uses vertex form, because a parabola in the shape a(x − h)² + k can be drawn and transformed by moving h and k. The pattern to carry away is that completing the square is not really about squares: it is the technique of rewriting a quadratic so that x appears in exactly one place, inside one bracket — and any expression with x in one place is easy to solve, sketch, maximise and reason about.

What this calculator cannot do

Plainly stated: this calculator handles single-variable quadratics only — expressions of the form ax² + bx + c with numbers for a, b and c, and a not equal to zero. It does not handle cubic or higher-degree expressions, quadratics in two variables such as circle equations, systems of equations, or symbolic inputs with letters instead of numbers. It does not factorise quadratics over the integers as a separate task, fit a parabola to data points, or graph with zooming and tracing; the small graph is a sketch drawn from the same computed vertex, intended to show the shape and the turning point at a glance. If a is 0 the input is a straight line rather than a quadratic, and the calculator shows a clear error instead of a result.

Two honesty notes about the numbers. First, exact answers are shown as fractions or simplified surd forms wherever they are exact — a root such as 2 + √(5/2) is given in that form as well as in figures — and anything shown with the approximation symbol is a decimal rounded to four places. Complex solutions are always labelled as complex. Second, everything runs in your browser: no numbers are uploaded, stored or shared, and the step-by-step working is generated from the same formulas described in this guide, so hand working and calculator working can be compared line by line. Used within those limits, this is a complete completing the square calculator: steps, vertex form, vertex and solutions, every time.

Sources & References

All seven sources were checked with curl on the day this page was built and every one returned HTTP 200; no substitutions were needed. Every figure in this guide was calculated with this page's own method — divide by a, add (b/2a) squared, factor the perfect square, and read off h, k and the solutions — so you can reproduce each one exactly above.