Completing the Square Calculator

Rewrite a quadratic in vertex form and read off its vertex and axis of symmetry.

Math and PercentUpdated 2026-11-193 min read
Completing the Square Calculator
The coefficient of x squared. It cannot be zero.
The coefficient of x.
The constant term.
Vertex form
...
Vertex x coordinate...
Vertex y coordinate...
Vertex...
Axis of symmetry...

What it does

Completing the square rewrites a quadratic so that x appears only once. Starting from a x squared plus b x plus c, the result is a times (x minus h) squared plus k. That form makes the turning point of the parabola visible without graphing.

The tool takes the three coefficients and returns the vertex form, the coordinates h and k, the vertex itself, and the axis of symmetry. The default quadratic is 2 x squared minus 12 x plus 16.

The algebra works by adding and subtracting the square of half the x coefficient. For a leading coefficient other than one, you first factor a out of the two x terms, complete the square inside the bracket, then simplify the leftover constant.

The vertex coordinates follow directly. The x coordinate h is minus b over two a, and the y coordinate k is c minus b squared over four a. These are the same values you get from the vertex formula, so the two methods agree.

This form is also the first step in deriving the quadratic formula and in evaluating integrals that contain a quadratic under a root. Keeping it as an exact expression avoids the rounding that comes from reading a graph.

How to use

  1. Enter the coefficient a of the squared term.
  2. Enter the coefficient b of the linear term.
  3. Enter the constant term c.
  4. Read the vertex form as the main result.
  5. Check h and k to see the vertex coordinates separately.
  6. Use the axis line to locate the mirror line of the parabola.

Formula

a x squared plus b x plus c = a (x minus h) squared plus k, where h = -b / (2a) and k = c - b squared / (4a)
a, b, c
The coefficients of the quadratic, with a not equal to zero.
h
The x coordinate of the vertex, equal to minus b over two a.
k
The y coordinate of the vertex, equal to c minus b squared over four a.

Expanding a times (x minus h) squared plus k gives a x squared minus 2 a h x plus a h squared plus k. Matching that with the original coefficients produces h equals minus b over two a and k equals c minus b squared over four a. If a is positive the vertex is a minimum, and if a is negative it is a maximum.

Worked example

Example: 2 x squared minus 12 x plus 16

The page opens with a = 2, b = -12, and c = 16.

  1. Factor 2 out of the two x terms to get 2 times (x squared minus 6x) plus 16.
  2. Half of minus 6 is minus 3, and its square is 9.
  3. Add and subtract 9 inside the bracket, then rewrite as 2 times ((x minus 3) squared minus 9) plus 16.
  4. Distribute the 2 to get 2 times (x minus 3) squared minus 18 plus 16.
  5. Combine the constants to get 2 times (x minus 3) squared minus 2.
  6. The vertex is at 3, minus 2 and the axis of symmetry is x = 3.
  7. The tool reports vertex form 2(x - 3)^2 - 2 with h = 3 and k = -2.

Reference table

Vertex forms for sample quadratics
Coefficients a, b, cVertex formVertexAxis
2, -12, 162(x - 3)^2 - 2(3, -2)x = 3
1, 6, 71(x + 3)^2 - 2(-3, -2)x = -3
1, -4, 11(x - 2)^2 - 3(2, -3)x = 2
1, -6, 51(x - 3)^2 - 4(3, -4)x = 3

Limits

  • The leading coefficient a cannot be zero.
  • Coefficients are limited to the range minus 1,000,000 to 1,000,000.
  • Results are shown with up to four decimal places, while the algebra keeps full precision.
  • The tool rewrites one quadratic at a time.

Common mistakes

  • Forgetting to factor a out before completing the square when a is not one.
  • Adding the square term without subtracting it, which changes the expression.
  • Reading the vertex x coordinate as positive h when the form shows x plus h.
  • Dropping the sign of k when the constant is negative.
  • Assuming every quadratic has two real roots to find by this method.

Try it yourself

Quick checks. Answers sit tucked under each question.

Write x squared plus 6x plus 7 in vertex form.

1(x + 3)^2 - 2, with vertex (-3, -2).

What is the vertex of x squared minus 4x plus 1?

(2, -3), because h is 2 and k is minus 3.

Axis of symmetry for 2 x squared minus 12 x plus 16?

x = 3, the same as the x coordinate of the vertex.

Questions

Why complete the square?

It reveals the vertex and axis directly and turns the quadratic into a form that is easier to solve or integrate.

What if the leading coefficient is not one?

Factor it out of the x terms first, complete the square inside, then multiply back and simplify the constant.

How do I find the vertex another way?

Use h equals minus b over two a, then substitute that x value into the quadratic to get k.

Is the vertex a maximum or a minimum?

It is a minimum when a is positive and a maximum when a is negative.

Can h be negative?

Yes. When b and a have the same sign, minus b over two a is negative and the form shows x plus a positive number.

Does this help solve quadratic equations?

Yes. Setting the vertex form equal to zero gives x minus h equals plus or minus the square root of minus k over a.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.