Audited 25 May 2026·Last updated 27 Jul 2026·5 citations·Tier 1·0 uses

Completing the Square Calculator

Convert any quadratic to vertex form. Find h, k, and the vertex with step-by-step algebra. Free online math tool.

Completing the Square Calculator

Leading coefficient; must be non-zero
Linear coefficient
Constant term
Vertex y-coordinate
-4
Vertical shift; maximum or minimum value
Vertex x-coordinate
3
Vertex X
3
Vertex Y
-4

Background.

Completing the square is the algebraic process of rewriting a quadratic expression from standard form ax² + bx + c into vertex form a(x − h)² + k. This transformation reveals the vertex of the parabola, the axis of symmetry, and whether the quadratic opens upward or downward. A calculator that automates this process is indispensable for students graphing parabolas, engineers optimizing quadratic cost functions, and physicists analyzing projectile trajectories. The vertex form immediately identifies the maximum or minimum value of the quadratic without requiring calculus or root-finding algorithms.

High school algebra students and introductory calculus learners are the primary search audience for this tool. In the United States, the Common Core State Standards for Mathematics require students to complete the square to derive the quadratic formula and to identify key features of parabolas from their equations. College algebra and precalculus courses extend this skill to finding circles, ellipses, and hyperbolas in standard position by completing the square in multiple variables. Physics students encounter the method when converting the kinematic equation for vertical position, y = y₀ + v₀t − ½gt², into a form that reveals the time and height of maximum ascent.

The historical origins of completing the square trace back to Al-Khwarizmi's Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala (circa 820 CE), where geometric figures were literally cut and rearranged to form perfect squares. The modern symbolic treatment emerged during the sixteenth century with the development of algebraic notation by François Viète and later René Descartes. Today, completing the square is taught as a foundational skill before the quadratic formula because the formula itself is derived by applying the method to the general equation ax² + bx + c = 0. Understanding the derivation deepens student comprehension of why the discriminant b² − 4ac governs the nature of the roots.

In optimization and operations research, completing the square provides a direct path to the extremum of a quadratic objective function. A production cost model such as C(q) = 2q² − 24q + 100 can be rewritten as 2(q − 6)² + 28, revealing immediately that the minimum cost is 28 when the quantity q equals 6. This is faster than computing derivatives for users who have not studied calculus, and it reinforces the connection between algebraic structure and geometric meaning. The calculator serves this audience by delivering h and k instantly, along with the vertex coordinates that define the optimal operating point. In portfolio theory, the variance of a two-asset portfolio is a quadratic function of the weight allocated to each asset, and completing the square identifies the minimum-variance portfolio weight without requiring numerical optimization software.

Signal processing and control theory also rely on completing the square, albeit in more advanced forms. In state-space control design, the algebraic Riccati equation is solved by completing the square in matrix variables, producing the linear-quadratic regulator that stabilizes aircraft and robotic systems. In probability theory, completing the square in the exponent converts general Gaussian densities into standard normal form, a step essential for computing cumulative probabilities and Bayesian posterior distributions. While the calculator handles only the scalar case, the conceptual foundation is identical: isolating a perfect square reveals the structure of the solution and simplifies integration over infinite domains.

Computer graphics and computational geometry use completing the square to find the center and radius of a circle from its general equation x² + y² + Dx + Ey + F = 0. Grouping x terms and y terms separately and completing the square in each variable converts the equation to standard form, revealing the center (−D/2, −E/2) and radius √(D²/4 + E²/4 − F). This is the same algebraic technique the calculator performs on a single variable, extended to two dimensions. Game engines and CAD software execute millions of these conversions per second when rendering curves and detecting collisions.

What is completing the square calculator?

Completing the square is an algebraic technique that rewrites a quadratic polynomial ax² + bx + c as a perfect square trinomial plus a constant correction term. The goal is to identify a value h such that ax² + bx can be expressed as a(x − h)² minus some compensating amount. When the correction is combined with the original constant c, the result is the vertex form a(x − h)² + k. The parameter h represents the x-coordinate of the parabola's vertex, and k represents the y-coordinate. The method applies exclusively to quadratic expressions, meaning the coefficient a must be non-zero. If a = 0, the expression is linear and has no vertex in the sense of a parabola. The sign of a determines whether the vertex is a minimum (a > 0) or a maximum (a < 0). The range of validity is all real coefficients, and the output coordinates h and k are always real numbers because they involve only addition, subtraction, multiplication, and division of real inputs. Geometrically, the vertex form reveals the horizontal and vertical translations needed to map the basic parabola y = x² onto the given quadratic through a very simple rigid geometric transformation.

How to use this calculator.

  1. Enter the coefficient a, the leading coefficient of the quadratic term.
  2. Enter the coefficient b, the linear coefficient.
  3. Enter the constant term c.
  4. Verify that a is non-zero; the calculator will reject a = 0.
  5. Review the h output, which is the x-coordinate of the vertex.
  6. Review the k output, which is the y-coordinate and the maximum or minimum value.
  7. Use the vertex coordinates to sketch the parabola or write the equation in vertex form.

The formula.

h = −b ⁄ 2a, k = c − b² ⁄ 4a

The derivation begins with the standard quadratic expression ax² + bx + c. Factor a out of the first two terms: a(x² + (b/a)x) + c. Inside the parentheses, take half of the linear coefficient and square it: (b/(2a))² = b²/(4a²). Add and subtract this quantity inside the parentheses to create a perfect square trinomial: a[ x² + (b/a)x + b²/(4a²) − b²/(4a²) ] + c. The first three terms inside the brackets form (x + b/(2a))². Distributing the subtraction yields: a(x + b/(2a))² − a·b²/(4a²) + c = a(x + b/(2a))² − b²/(4a) + c. Rewriting the linear term as −(−b/(2a)) gives the canonical vertex form: a(x − h)² + k, where h = −b/(2a) and k = c − b²/(4a). An alternative expression for k combines the terms over a common denominator: k = (4ac − b²)/(4a). This form makes explicit the relationship between the vertex y-coordinate and the discriminant b² − 4ac. When the discriminant is zero, k = c − b²/(4a) = 0 if and only if the quadratic is a perfect square and the vertex lies on the x-axis. The formulas for h and k are linear and rational functions of the coefficients, respectively. Dimensional analysis confirms consistency: if x has units of metres, then b/a has units of metres, so h has units of metres. The term b²/(4a) has units of metres squared divided by metres, yielding metres, which matches the units of c and therefore k. This dimensional homogeneity is necessary for the equation to be physically meaningful in applied contexts such as projectile motion. Geometrically, h represents the horizontal displacement of the parabola's axis of symmetry from the y-axis, and k represents the vertical displacement of the vertex from the x-axis. When a > 0, the parabola opens upward and k is the global minimum; when a < 0, it opens downward and k is the global maximum. The calculator computes these values directly from the coefficients without requiring the user to perform the multi-step algebraic manipulation manually.

A worked example.

Example

Consider the quadratic expression x² − 8x + 12. To complete the square, the calculator first identifies half of the linear coefficient: −8/2 = −4. It then squares this value: (−4)² = 16. The expression is rewritten by adding and subtracting 16: x² − 8x + 16 − 16 + 12 = (x − 4)² − 4. Comparing with vertex form a(x − h)² + k, the calculator extracts h = 4 and k = −4. The vertex of the parabola is at (4, −4). Because a = 1 is positive, this vertex is a minimum. The parabola intersects the x-axis where (x − 4)² = 4, which gives x = 4 ± 2, or x = 2 and x = 6. These roots are symmetric about the axis x = 4, confirming that the vertex lies midway between them. A student could use this result to sketch the parabola in two seconds without solving the quadratic formula or plotting points.

a1
b-8
c12

Frequently asked questions.

What is the difference between standard form and vertex form?
Standard form is ax² + bx + c, which makes the y-intercept (0, c) immediately visible but hides the vertex. Vertex form is a(x − h)² + k, which makes the vertex (h, k) immediately visible but requires expansion to identify the y-intercept. Both forms describe the same parabola, and they are algebraically equivalent. Converting between them is useful in different contexts: standard form is preferred for factoring and applying the quadratic formula, while vertex form is preferred for graphing, optimization, and writing the equation given the vertex and a point. The calculator performs the conversion from standard to vertex form by completing the square.
Why must a be non-zero?
If a = 0, the expression becomes bx + c, which is linear, not quadratic. A line has no vertex in the sense of a turning point; it extends to positive or negative infinity without changing direction. The formula for h involves division by 2a, which would be division by zero if a were zero. The calculator enforces a ≠ 0 to guarantee that the mathematical object being analyzed is indeed a parabola. In applications, a = 0 might represent a degenerate case such as constant velocity in kinematics, but that case is outside the scope of a quadratic vertex calculator.
Can completing the square be used to derive the quadratic formula?
Yes. Starting from ax² + bx + c = 0, divide by a to obtain x² + (b/a)x + c/a = 0. Complete the square on the left side: (x + b/(2a))² − b²/(4a²) + c/a = 0. Move the constant terms to the right: (x + b/(2a))² = (b² − 4ac)/(4a²). Take the square root of both sides: x + b/(2a) = ±√(b² − 4ac)/(2a). Subtract b/(2a) from both sides to obtain x = (−b ± √(b² − 4ac))/(2a). This is the quadratic formula. Every step in the derivation is an instance of completing the square, which is why the two topics are taught consecutively in algebra curricula.
What does the sign of a tell me about the vertex?
The sign of the leading coefficient a determines the concavity of the parabola. When a > 0, the parabola opens upward, and the vertex (h, k) is the lowest point on the graph; k is the minimum value of the quadratic function. When a < 0, the parabola opens downward, and the vertex is the highest point; k is the maximum value. If a is very close to zero, the parabola is extremely wide and flat, but as long as a ≠ 0, a vertex still exists. The magnitude |a| controls the width: larger |a| produces a narrower parabola.
How do I find the axis of symmetry from the output?
The axis of symmetry of the parabola y = ax² + bx + c is the vertical line x = h. Because the calculator outputs h directly, the axis of symmetry is known immediately. Every parabola is symmetric about this vertical line; if (h + d, y) is a point on the graph, then (h − d, y) is also on the graph. This symmetry property is useful for graphing: once one point to the right of the axis is known, the mirror image to the left can be plotted without additional computation. The axis of symmetry also passes through the midpoint of any two x-intercepts.
What if the quadratic has no real roots?
The calculator still returns valid h and k values even when the discriminant b² − 4ac is negative. A negative discriminant means the parabola does not intersect the x-axis, but it still has a vertex. For example, x² + 2x + 5 has discriminant 4 − 20 = −16 and no real roots, yet its vertex is at (−1, 4). The calculator computes h = −2/2 = −1 and k = 5 − 4/4 = 4 regardless of the discriminant sign. Users should therefore not interpret "no real roots" as an error; the vertex is a geometric feature independent of root existence.
Is there a matrix version of completing the square?
Yes. In multivariable calculus and optimization theory, completing the square generalizes to quadratic forms xᵀAx + bᵀx + c, where A is a symmetric matrix. The vertex formula becomes h = −½A⁻¹b, provided A is invertible. This is the foundation of Newton's method in optimization and of the Kalman filter in control theory. The scalar calculator handles the one-dimensional case where A reduces to the single number a, b is a scalar, and the matrix inverse becomes simple division by a. The conceptual structure—isolating a perfect square and correcting with a constant—is identical in both settings.
Can I use this calculator for equations in two variables?
No. This calculator accepts only scalar coefficients a, b, and c for a single-variable quadratic y = ax² + bx + c. Equations in two variables, such as the general conic section Ax² + Bxy + Cy² + Dx + Ey + F = 0, require completing the square in both x and y separately, along with a rotation to eliminate the cross term Bxy if present. That process is beyond the scope of this tool. However, the single-variable technique is a prerequisite: once the cross term is eliminated by rotation, the remaining expression separates into independent quadratics in x and y, each of which can be handled by the same completing-the-square method this calculator implements.
Why does k equal (4ac − b²)/(4a)?
Both expressions for k are algebraically equivalent. Starting from k = c − b²/(4a), multiply c by 4a/4a to obtain (4ac)/(4a) − b²/(4a) = (4ac − b²)/(4a). This form is useful because the numerator 4ac − b² is the negative of the discriminant. When the discriminant is zero, k simplifies to c − b²/(4a) = 0 if the quadratic is a perfect square trinomial. The denominator 4a ensures that k has the same units as c, preserving dimensional consistency. The calculator can compute either expression, but the c − b²/(4a) form is typically more numerically stable when a is large.

References& sources.

  1. [1]Stewart, J. (2015). Calculus: Early Transcendentals, 8th ed. Cengage Learning. ISBN 978-1285741550.
  2. [2]Sullivan, M. (2018). Algebra & Trigonometry, 10th ed. Pearson. ISBN 978-0134685985.
  3. [3]NCTM (2014). "Principles to Actions: Ensuring Mathematical Success for All." National Council of Teachers of Mathematics.
  4. [4]Al-Khwarizmi, M. (c. 820). Al-Kitab al-mukhtasar fi hisab al-jabr wal-muqabala. (English translation: The Algebra of Mohammed ben Musa, Rosen, F., 1831).
  5. [5]Axler, S. (2015). Linear Algebra Done Right, 3rd ed. Springer. ISBN 978-3319110790.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 313 calculators remain free
  • No billing is enabled
Coming soon