This article was originally published on Aug. 2, 2014, and updated on April 12, 2018.

The size of your monthly Social Security check when you retire will depend largely on how much you earned and how much you paid in Social Security tax during your working years.

It's not as simple as getting your money back, however. The IRS uses special formulas and rules to determine how much you receive in benefits. The maximum amount that you can receive per month if you retire at full retirement age in 2018 is $2,788, but your actual benefits will vary depending on several factors. The size of your monthly Social Security check when you retire will depend largely on how much you earned and how much you paid in Social Security tax during your working years.

Because of the way your benefits are determined, you can't assume that the more you earn, the more you will receive in benefits. Here's how it works.

A Social Security card and calculator on top of a financial statement.

Image source: Getty Images.

What factors affect Social Security benefits?

The biggest factor in how much you will receive in Social Security benefits is how much you earned while you were working. For Social Security purposes, what matters is the average amount you earned during your highest-earning 35 years before age 62, adjusted for cost-of-living increases.

The age at which you start taking benefits also affects how much you receive per month once you start. The longer you wait to start taking benefits, up to age 70, the higher your monthly benefits will be.

If you have earned income in the same year you receive benefits and you either have not reached full retirement age or reached full retirement age that year, then your Social Security benefits may be reduced.

Your benefits may also be affected by different types of earnings, and a pension received from a job in which you did not pay Social Security taxes will reduce your benefit.

What factors do not affect Social Security benefits?

Working longer doesn't necessarily mean you get more Social Security benefits. Only your 35 highest-earning years (adjusting for inflation) count, so continuing to work won't boost your benefits unless it increases your average income for the highest-earnings years.

And working fewer hours or for less pay as you near retirement won't hurt your Social Security benefits. Some people mistakenly assume that Social Security benefits are based on the last years worked. Fortunately, you can work as long as you want, and your Social Security benefits are still based on your 35 highest-earning years.

Do you qualify for Social Security benefits?

Not everyone who pays into the Social Security system qualifies to receive retirement benefits. To receive Social Security benefits on your record, you must have at least 40 credits. You generally earn four credits per year that you work. In 2018, you'll receive one credit for each $1,320 you earn, up to four credits per year.

If you don't qualify for benefits under your own record, you may be able to claim benefits under the record of your spouse or former spouse.

Step by step: How are Social Security benefits calculated?

If you qualify for Social Security benefits, you can arrive at a reasonable estimate for Social Security benefits by completing five easy steps, which I'll describe below. You can understand (and, if you haven't yet retired, help adjust) your Social Security benefits by thinking through your retirement age, your earnings, and your post-retirement plan for earning additional income (say, from a part-time job).

1. Total earnings: The SSA determines the total amount you earned in the 35 years during which you made the most money, up to a maximum amount per year. The limit is adjusted for inflation -- in 1951, the limit was $3,600. In 2018, it's $128,400.

If you worked fewer than 35 years, the missing years are counted as zero. For example, if you worked a total of 20 years, the SSA would add up your income from all 20 years you worked (adjusting for inflation) and then factor in 15 years of zero pay.

2. Average indexed monthly earnings: The resulting sum from Step 1 is divided by 420 months (35 years) and rounded down to the nearest dollar to find your average indexed monthly earnings (AIME).

3. Benefit at full retirement age (the age at which you can take full benefits): Your benefit is based on a three-tiered percentage of your AIME. Confusingly, though, the formula is based on the year when you first become eligible for Social Security. For those who first become eligible for Social Security in 2018, the benefit is calculated as follows:

(90% of your first $895 of AIME) + (32% of AIME above $895 and through $5,397) + (15% of AIME above $5,397)

The sum is your estimated monthly retirement benefit at your full retirement age.

Example:
If your AIME is $5,500, then your benefit is calculated as follows:

   90% x $895 = $805.50

+ 32% x ($5,397 - $895) = $1,440.64

+ 15% x ($5,500 - $5,397) = $15.45

Total = $2,261.59, which the SSA rounds to the next-lower dime, making a total monthly benefit of $2,261.50.

Full retirement age ranges from 65 to 67 and depends on the year in which you were born. If you were born between 1943 and 1954, then your full retirement age is 66.

4. Benefit if you retire early: If you want to retire early and take Social Security benefits before full retirement age, then your monthly benefit is reduced. If your full retirement age is 66 and you want to retire at age 62, for example, then multiply the result from Step 3 by 75%.

5. Reductions for earned income while receiving benefits: If you are under your full retirement age and working, you can still receive early Social Security benefits. However, for every $2 you earn above the annual limit, your benefits are reduced by $1. This annual limit in 2018 is $17,040, assuming you're under your full retirement age for the entire year.

In the year you reach full retirement age, before the month in which you reach that age you can earn up to a certain limit before the SSA deducts $1 for every $3 you earn. In 2018, that limit is $45,360.

After you reach your full retirement age, you can work as much as you want without worrying about your Social Security benefits.

Social Security benefits can be an important part of your retirement plan. Knowing how your benefits are calculated can help you understand how much you can expect to receive -- and help you maximize your benefits for retirement.