Skip to main content
CalcMax

Completing the Square Calculator

Range: -1,000,000 – 1,000,000

Range: -1,000,000 – 1,000,000

Range: -1,000,000 – 1,000,000

Result

(x + 3)² - 4

Completed-square form

Vertex x
-3.000000
Vertex y
-4.000000

A completing the square calculator rewrites a quadratic expression into vertex form: ax² + bx + c becomes a(x − h)² + k, with the vertex of the parabola sitting at (h, k). It does not solve the equation — the roots are a different page — it changes the shape of the expression, and that change is what makes the vertex, and the direction the parabola opens, readable at a glance. Values that come out as fractions are printed as fractions rather than decimals, so the arithmetic stays exact: x² + x is written (x + 1/2)² − 1/4 and not (x + 0.5)² − 0.25.

Quadratics and their completed-square forms

abcCompleted-square form
165(x + 3)² - 4
1-43(x - 2)² - 1
121(x + 1)²
10-9x² - 9
2412(x + 1)² - 1
3613(x + 1)² - 2
110(x + 1/2)² - 1/4
5-1035(x - 1)² - 2

Each row takes the three coefficients of ax² + bx + c and gives the same expression rewritten. The rows are chosen to cover the printing rules rather than to be arbitrary: the second pulls a positive vertex out of a negative b, the third is a perfect square whose trailing constant has dropped out entirely, the fourth has no bracket at all because its vertex lies on the y-axis, and the fifth prints a leading coefficient of 2 in front. The seventh is the fraction case, where half of an odd coefficient stays exact as 1/2 instead of turning into 0.5. Every number in the first three columns is a whole number and the fourth column is notation built from symbols, so the table is identical in all ten languages the site serves; a table of decimal coefficients would have to be localized, since 1.5 is written 1,5 in several of them.

Formula

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

a
The leading coefficient, which may not be zero: with a equal to zero there is no squared term, the expression is a straight line rather than a quadratic, and there is no square to complete. The sign of a decides which way the parabola opens — upward when a is positive, downward when it is negative — and its magnitude decides how narrow the curve is.
b
The coefficient of the linear term. It is the one that sets the horizontal position of the vertex: h is −b divided by twice a, so a positive b pushes the vertex to the left and a negative b pushes it right. Its square also enters k, which is why a large b with a small a moves the vertex a long way vertically.
c
The constant term. It shifts the whole parabola up or down and does not move the vertex sideways at all — c appears only in k, never in h. It stays a required input rather than being treated as zero when omitted, because leaving it out would make the k in the printed form wrong while nothing on the page showed that anything had been assumed.
h
The x-coordinate of the vertex, equal to −b ÷ 2a. It is the value of x that makes the squared term vanish, which is what the word vertex means here: the lowest point of the curve when a is positive and the highest when a is negative. In the printed form its sign is folded into the bracket, so a vertex at −3 is written (x + 3)² rather than (x − (−3))².
k
The y-coordinate of the vertex, equal to c − b² ÷ 4a. It is the value the whole expression takes at x equal to h, so it is the minimum of the quadratic when a is positive and its maximum when a is negative. When k works out to zero the printed form drops the constant entirely — a perfect square is written (x + 3)², not (x + 3)² + 0.

Worked examples

  1. Completing the square for x² + 6x + 5

    1. Halve the coefficient of x: 6 ÷ 2 = 3, so the bracket is (x + 3)
    2. Square that: (x + 3)² = x² + 6x + 9, which is 4 more than the expression given
    3. Subtract the excess: (x + 3)² − 4
    4. The vertex is at (−3, −4), and the leading coefficient is positive so the parabola opens upward

    The standard worked example, and the one where the arithmetic can be checked by expanding. The bracket is chosen so that its square reproduces the first two terms exactly; whatever that square overshoots by is subtracted again, and the result is the same expression in a different shape. From this form the vertex is read off with no calculation at all.

  2. A form that comes out in fractions

    1. Halve 1 to get the bracket: (x + 1/2)
    2. Squaring it gives x² + x + 1/4, a quarter more than x² + x
    3. Subtract the quarter: (x + 1/2)² − 1/4
    4. The vertex is at (−1/2, −1/4), which the two number columns report as −0.5 and −0.25

    Where the fraction printing earns its place. Half of an odd coefficient is a fraction, and it stays one through the whole calculation, so the printed form is exact while 0.5 and 0.25 are merely two of its decimal spellings. The two numeric columns necessarily use decimals, since they are numbers rather than notation — and each column is worth reading for the other's sake here.

  3. A perfect square

    1. Halve 6 for the bracket: (x + 3)
    2. Squaring gives x² + 6x + 9, which is exactly the expression
    3. Nothing is left over, so the constant term drops out of the printed form
    4. The vertex sits on the x-axis, at (−3, 0)

    The case that shows why the constant is omitted rather than printed as + 0. When the expression is already a perfect square the vertex touches the x-axis, and the finished form has two terms instead of three. That the tail has disappeared is itself the information: it says the quadratic has a repeated root, which is the fact the roots page would report as a single answer.

Limitations

The leading coefficient may not be zero. With a equal to zero the expression is linear, its graph is a straight line, and the idea of completing a square does not apply — the page refuses the input rather than dividing by zero on the way to h. All three coefficients are limited to a magnitude of one million, since the vertex coordinates grow with the square of b, and beyond that range the k column would run into the hundreds of billions and stop being a number a reader can use. Values in the printed form are shown as fractions when the denominator divides evenly and is no larger than one thousand, and as six decimals otherwise; the two named columns always use decimals, because they hold numbers rather than notation. This page does not solve the quadratic. It reports the expression in its vertex form and the coordinates of the vertex, and the roots — where the parabola crosses the x-axis — are computed on the quadratic formula page this one links to. Nor does it print whether the parabola opens upward or downward: that is decided by the sign of the leading coefficient, and the sign is visible in the first field you typed rather than in any of the three results.

Frequently asked questions

What does completing the square do?
It rewrites a quadratic expression into vertex form, a(x − h)² + k, where the vertex of the parabola can be read straight off the expression instead of being calculated. The procedure is to take half the coefficient of x, square the resulting bracket, and subtract whatever that square added. Nothing about the expression changes in value — only in shape.
Why are the numbers printed as fractions?
Because half of an odd coefficient is a fraction, and a fraction stays exact through the rest of the work. Writing 1/2 as 0.5 looks harmless until the next step multiplies it, at which point the decimal has to be rounded and the answer drifts. The printed form uses a fraction whenever the denominator divides evenly and is at most one thousand, and falls back on six decimals only when it cannot.
How do I know whether the parabola opens up or down?
From the sign of the leading coefficient a: positive opens upward, negative opens downward. This page does not print that conclusion, because the sign of a does not appear in any of its three results — it is visible in the first field you entered, and the shape of the vertex form reflects it. When a is positive the vertex is the minimum of the quadratic, and when a is negative it is the maximum.
Does this page solve the quadratic?
No. It reports the expression in vertex form and the coordinates of the vertex. Solving means finding the values of x where the expression equals zero, which are the points where the parabola crosses the x-axis, and that is what the quadratic formula page linked below does. The two pages take the same three coefficients and return different things: one returns an expression, the other returns roots.
Why is the constant term sometimes missing from the answer?
Because it worked out to zero. When the quadratic is already a perfect square the vertex sits on the x-axis, and the printed form drops the trailing constant rather than writing + 0 — the square of x + 3 is written (x + 3)², not (x + 3)² + 0. The missing tail is meaningful: it tells you the quadratic has a repeated root at exactly that value of x.
Why can't the leading coefficient be zero?
Because then there is no squared term, so the expression is a straight line and there is nothing to complete. Dividing by 2a to find the vertex would also be dividing by zero, and the vertex of a line is not a well-defined point in the same sense. The page refuses the input and names it, rather than producing a nonsensical form.

References

Related calculators