Skip to main content

Completing the Square Calculator

Convert ax² + bx + c = 0 to vertex form a(x − h)² + k and solve for x by completing the square, with the vertex point and a full step-by-step derivation.

Input

Coefficient of x². Must not be zero.

Coefficient of x.

Constant term.

Output

Step-by-Step Solution
Was this helpful?

Guides

The Completing the Square Calculator converts any equation of the form ax² + bx + c = 0 into vertex form a(x − h)² + k, and solves for x by completing the square rather than jumping straight to the quadratic formula. Enter the three coefficients — a, b, and c — and it returns the vertex form, the vertex point (h, k), the roots, and a full step-by-step derivation showing exactly how each is reached.

It's built for algebra students learning the completing-the-square method itself (not just the answer), teachers preparing worked examples, and anyone who needs a parabola's vertex form without doing the algebra by hand.

How to use it

  1. Enter the coefficient a (the number multiplying x²). It must not be zero.
  2. Enter the coefficient b (the number multiplying x).
  3. Enter the coefficient c (the constant term).
  4. Read Vertex Form and Vertex (h, k) for the converted equation, Roots for the solution, and Step-by-Step Solution for the full derivation.

Results update automatically as you type. For example, entering a = 1, b = 6, c = 5 (for x² + 6x + 5 = 0) returns vertex form y = (x + 3)² - 4, vertex (-3, -4), and roots x₁ = -1, x₂ = -5.

What is completing the square?

Completing the square rewrites ax² + bx + c by factoring a out of the x² and x terms, then adding and subtracting the square of half the x-coefficient so the expression inside the parentheses becomes a perfect square trinomial:

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

That final line is vertex form — for the parabola y = ax² + bx + c, the point (h, k) is its vertex (the minimum if a > 0, the maximum if a < 0).

How does it solve for x?

Setting the vertex form to zero and isolating the squared term:

a(x − h)² + k = 0  →  (x − h)² = −k/a
  • If −k/a > 0, there are two distinct real roots: x = h ± √(−k/a).
  • If −k/a = 0, there's one repeated real root: x = h.
  • If −k/a < 0, there are two complex conjugate roots: x = h ± i√(k/a).

These are exactly the same roots the quadratic formula produces for the same a, b, c — completing the square is a different route to the same answer, and is in fact how the quadratic formula itself is derived. For solving via the discriminant directly, see the Quadratic Formula Solver.

Why can't a be zero?

If a = 0, the x² term disappears and the equation reduces to bx + c = 0 — a linear equation with no vertex to complete the square toward. The calculator flags a = 0 as invalid input rather than silently switching to linear-equation logic.

How are complex roots formatted?

Complex roots are shown in standard a + bi notation, for example -0.5 + 0.866025i and its conjugate -0.5 - 0.866025i — the real part is the vertex's h, and the imaginary part comes from √(k/a).

Privacy

This calculator runs entirely in your browser. Your coefficients are never uploaded, logged, or stored — the computation happens locally on your device.

Related tools

For solving the same equation via the discriminant instead, see the Quadratic Formula Solver.

completing the squarevertex formquadratic equationvertexparabolaalgebramathsolver

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/completing-the-square-calculator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "coeffA": "1",
    "coeffB": "6",
    "coeffC": "5"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `completing-the-square-calculator` tool (Completing the Square Calculator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/completing-the-square-calculator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Completing the Square Calculator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per callFrom 5 credits

Also available with

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.