The method, not just its answer — a(x − h)² + k in exact fractions.
Calculator
Complete the square
Halves and squares stay exact fractions.
Fractions like 3/4 work
Include the sign
x² + 6x + 5
(x + 3)² − 4
Multiplied back out this is x² + 6x + 5 — the expression you entered.
Vertex
(−3, −4)
Opens upward
Minimum
−4
at x = −3
Axis of symmetry
x = −3
The mirror line of the parabola
The number squared
3
Half of b ÷ a; its square is 9
Working
1Halve the coefficient of x6 ÷ 2 = 3This number is h with its sign flipped, and it is already the answer to where the vertex sits.
2Square that half3² = 9
3Add AND subtract it inside the bracketx² + 6x + 9 − 9 + 5Adding alone would change the expression. The subtraction is what keeps it equal to what you started with — this is the line that gets left out.
4The first three terms are now a perfect squarex² + 6x + 9 = (x + 3)²Check it by multiplying back: the middle term is twice the number inside.
5Collect the constants5 − 9 = −4
6Vertex form(x + 3)² − 4
Exact fractions throughout — the vertex form above re-multiplies to the expression you entered.
What this tool shows
The technique the quadratic formula is made of, run on your equation rather than on a general one — the halving, the squaring, and the subtraction everyone forgets, in fractions exact enough that the answer re-expands to what you started with.
ax² + bx + c rewritten as a(x − h)² + k, with a ≠ 1 handled properly
The vertex, the axis of symmetry, and whether it is a maximum or a minimum
Solving the equation by the method, rather than by the formula
The missing constant: what c makes ax² + bx + c a perfect square
Vertex form a(x − h)² + k Add AND subtract, shown on one line Exact fractions — no rounded vertex Free, no signup
Free, no signup — exact fractions, nothing rounded.
Updated 6 September 2026 · Works in any browser, no installation
Completing the square rewrites ax² + bx + c as a(x − h)² + k, where h is half the x coefficient with its sign flipped and k is whatever is left over. x² + 6x + 5 becomes (x + 3)² − 4, so the vertex is at (−3, −4) — read straight off, with no differentiation and no formula.
At a glance
Formula shown
a(x − h)² + k where h = −b/2a and k = c − b²/4a. The number added and subtracted is (b/2a)². The missing constant is b²/4a.
Scenario support
Three coefficients, in vertex-form mode, solve-by-the-method mode, or find-the-constant mode.
Educational estimate
Planning support from the values you enter — not professional advice.
Five steps, and only one of them is interesting
Halve the x coefficient
b ÷ 2a
This is −h, so the vertex is already found.
Square it
(b / 2a)²
Add it and subtract it. Both.
What is left
k = c − b² / 4a
The height of the vertex.
Take x² + 6x + 5. Half of 6 is 3, and 3² is 9. Write x² + 6x + 9 − 9 + 5, group the first three as (x + 3)², and collect −9 + 5 into −4: the answer is (x + 3)² − 4. Every case follows that shape; what varies is how ugly the fractions get.
They get ugly quickly. x² + 3x + 1 has an odd b, so the half is 3/2 and its square is 9/4, giving (x + 3/2)² − 5/4. That is the correct, exact answer, and rounding 3/2 to 1.5 happens to be safe here only because it terminates — for a coefficient of 1/3 it would not, and the vertex would land in the wrong place. Everything on this page stays as fractions for that reason.
Add AND subtract — the step that gets dropped
Completing the square is the one common algebra technique where a step exists purely to undo another one, and steps like that are the ones that get left out. Adding 9 to x² + 6x does not rewrite it; it changes it into a different expression. The only way to introduce the 9 legally is to remove it in the same breath.
There is a quick way to catch the omission. Multiply the answer back out. (x + 3)² − 4 expands to x² + 6x + 5, which is what we started with. If the subtraction had been forgotten, the expansion would come out 9 too large and the mismatch would be obvious. The calculator above performs exactly that check on every result and prints both sides, so you never have to take the answer on trust.
The same logic explains a related habit that looks like superstition: when the equation is being solved rather than rewritten, some teachers add the square to both sides instead of adding-and-subtracting on one. Those are the same move. Adding to both sides of an equation preserves it; adding and subtracting on one side of an expression preserves it. Which you use depends on whether you have an equation or an expression in front of you, and the tool switches between them by mode.
When a is not 1, and the constant stays outside
With a leading coefficient the method gains one step and one trap. Factor a out of the x² and x terms — and only those. 2x² − 8x + 3 becomes 2(x² − 4x) + 3, with the 3 left outside the bracket. Pulling the constant inside as well is the standard mistake: it then gets multiplied by 2 when the bracket is expanded, and the answer is wrong by a factor that is easy to miss.
The second consequence is that the number you add inside the bracket is scaled by a on the way out. In 2x² − 8x + 3 you add and subtract 4 inside a bracket multiplied by 2, so the leftover is −8, not −4, and the constant becomes 3 − 8 = −5: 2(x − 2)² − 5.
3x² + 5x − 2 is the same shape with none of the arithmetic being kind: half of 5/3 is 5/6, its square is 25/36, and the answer is 3(x + 5/6)² − 49/12. It re-expands to 3x² + 5x − 2. A negative a works the same way and only changes what the vertex means: −x² + 4x + 1 gives −(x − 2)² + 5, and because the parabola opens downward the vertex is a maximum of 5 rather than a minimum.
What vertex form buys that the roots do not
If all you want is where the parabola crosses the axis, the quadratic formula gets there in fewer lines and this page will not pretend otherwise. Completing the square earns its place when the question is about the curve rather than about its roots:
The maximum or minimum, and where it happens. a(x − h)² + k puts both on display: the squared term is never negative, so the whole expression is at least k when a is positive and at most k when a is negative, and it hits that value exactly when x = h. That is an optimisation answered without calculus.
Graphing by transformation. The form reads as instructions: take y = x², shift it h to the right, stretch it by a, lift it by k. 2(x − 2)² − 5 is the basic parabola moved 2 right, stretched by 2, dropped 5.
Seeing at a glance that there are no real roots. If a and k have the same sign, the expression can never reach zero. That is the discriminant test in a form you can read rather than compute — and the Discriminant Calculator is the arithmetic version of the same fact.
Integration and physics substitutions. A quadratic under a radical or in a denominator is routinely completed into a square so a standard substitution applies. The vertex form is the shape those tables are written for.
The quadratic formula is this method, done once in general
Run these steps on ax² + bx + c = 0 without putting numbers in, and the quadratic formula falls out. It is worth doing once, because afterwards the formula stops being something to memorise:
Divide through by a: x² + (b/a)x + c/a = 0.
Move the constant: x² + (b/a)x = −c/a.
Halve the x coefficient and square it: (b/2a)² = b²/4a². Add it to both sides.
The left is now a square: (x + b/2a)² = b²/4a² − c/a.
Put the right over a common denominator: (b² − 4ac) / 4a².
Square-root both sides, keeping the ±: x + b/2a = ±√(b² − 4ac) / 2a.
Subtract b/2a: x = (−b ± √(b² − 4ac)) / 2a.
Two things that look arbitrary in the formula are explained by that derivation. The 2a underneath is the a you divided by in step 1, brought back. And b² − 4ac appears at step 5 as the numerator of what is left after the square has been completed — which is why its sign decides whether step 6 is possible over the real numbers.
The ± enters at step 6 and nowhere else. Dropping it there is the same mistake as dropping it in the formula, and it costs one of the two roots. x² − 4x + 1 = 0 is a clean example: the bracket squared equals 3, so x − 2 = ±√3, giving 2 − √3 and 2 + √3.
Finding the constant that completes the square
The smallest version of the question, and the most commonly asked on its own: given x² + bx, what constant makes it a perfect square? Half the coefficient, squared. x² + 6x needs 9, giving (x + 3)². An odd coefficient gives a fraction and that is fine: x² + 7x needs 49/4, and (x + 7/2)² is exactly right.
The rule people memorise as (b/2)² is only correct when a is 1. With a leading coefficient the answer is b²/4a: 2x² + 8x needs 8, not 16. The calculator asks for a precisely so that this case is not quietly assumed away, and the working shows the division that most quoted versions of the rule skip.
This is the same condition as a zero discriminant. b² − 4ac = 0 rearranges to c = b²/4a, so “the constant that completes the square” and “the constant that makes the discriminant zero” are one question asked two ways — which is also the definition of a perfect square trinomial.
Read the guide
This page argues that completing the square earns its place when the question is about the curve rather than the roots. Factoring, Completing the Square, or the Quadratic Formula — Which to Use puts that claim beside the other two methods and gives the rule in one line: complete the square whenever a maximum, a minimum, a vertex or a graph is what is being asked for, whatever the discriminant says. It also works one equation through all three routes, which is the quickest way to see what each method costs and what each one hands back.
Sources and methodology
The method and the derivation above are worked out in full rather than cited, because they are arguments rather than facts from a document — a citation would add nothing a reader could check that the seven lines do not. What is cited is the standard reference statement of the quadratic’s solution, for anyone wanting the canonical form beside this one.
Method. Every figure on this page — the calculator, the steps, and each worked example in the prose — comes from one engine, src/lib/completing-the-square.ts, over the exact-rational core in src/lib/algebra/. The vertex form is not asserted to be correct: the engine multiplies it back out and compares the result with the input, coefficient by coefficient, and the page prints that comparison. That engine is verified on every change against 45 hand-written assertions, including that every vertex form re-expands to the polynomial it came from, that a leading coefficient scales the leftover term rather than the added one, and that the missing constant for a ≠ 1 is b²/4a and not (b/2)². The count and the per-case breakdown are published on the formula verification page.
Related calculators
The same quadratic, approached other ways:
Quadratic FormulaSolve any quadratic with exact roots — surds stay surds and a negative discriminant gives the complex pair — plus the vertex, the factored form and every step of the working.
DiscriminantEvaluate b² − 4ac, the cubic and quartic discriminants, or D = f_xx·f_yy − (f_xy)² for the second-derivative test, in exact arithmetic so the sign is never a rounding artefact.
Factoring TrinomialsFactor a trinomial by the AC method with every factor pair of ac listed, the common factor taken out first, and the answer multiplied back out to check it.
ScientificTrigonometry, logarithms, powers, roots, and factorials with correct order of operations, memory registers, history, and keyboard entry.
Slope PercentageConvert a slope between percentage grade, degrees, a 1:n ratio and rise per run, or find the fall to set out across a known distance.
PercentageSolve X% of Y, what percent X is of Y, reverse percentage, increase/decrease, discounts, and tax, tip, or commission.
This calculator rewrites a quadratic in vertex form, solves it by completing the square, and finds the constant that completes a given square. Every value is held as an exact fraction, so a vertex at −49/12 is reported as −49/12 rather than as a decimal that will not re-expand to the expression you entered. It is a study and checking aid: the working is printed because the method, not the answer, is what is being examined, and an answer copied without it is worth nothing in that setting.
Published the completing-the-square calculator with three modes: rewriting into vertex form, solving by the method, and finding the constant that completes a given square.
The vertex form is not asserted — the engine multiplies its own answer back out and prints the comparison with the expression that was entered.
Carries the full derivation of the quadratic formula from the method, which the Quadratic Formula Calculator links to rather than repeating.
Add this calculator to your site
Responsive embed — and private: nothing your visitors type leaves their browser.