Sum of the first n square numbers calculator
Calculate 1² + 2² + … + n² using the standard square-sum identity. Enter n to calculate the sum and review the method.
Related calculators
These tools cover neighboring sequence questions.
How to use the Sum of the first n square numbers calculator
Calculate 1² + 2² + … + n² using the standard square-sum identity. The input is a whole-number term count or endpoint, and the method avoids adding each term individually.
Input and result
Enter n as a nonnegative whole number. The output is a dimensionless sum of integer values; there are no measurement units.
Formula
1² + 2² + … + n² = n(n + 1)(2n + 1) / 6
Worked example
For n = 20, the sum is 20×21×41/6 = 2,870.
Assumptions and limits
This is a sum of the first n integer squares, not the sum of squares of an arbitrary data list. Very large n can exceed JavaScript number precision. The displayed result is rounded for readability; large integer results can exceed the exact precision available in a browser number.
Frequently asked questions
Frequently asked questions
Is this the same as a sum of squares calculator?
This page sums the specific sequence 1² through n². A data-list sum of squares accepts arbitrary observations.
Are the first and last squares included?
Yes, both 1² and n² are included when n is at least 1.
What if n is zero?
The empty sum is zero.
How do I use the Sum of the first n square numbers calculator?
Enter n as a nonnegative whole number. The output is a dimensionless sum of integer values; there are no measurement units.
What is a worked example of Sum of the first n square numbers?
For n = 20, the sum is 20×21×41/6 = 2,870.
See the calculation methodology and privacy policy.