Computing Social Security Income

Last updated: May 25, 2023

I’ve been wanting to code up a tool to compute social security income for quite some time now, and I finally made some significant progress on that front!

To build this tool, I had to gather all the relevant steps and calculations from across various ssa.gov and third-party sites – which was not trivial.

So, the objective of this post is to have every calculation and table needed to compute standard social security income, which the Social Security Administration (SSA) refers to as retirement insurance benefits (RIB), in a single page. 

Maybe for the first time in the history of humanity? Probably not. But if it does exist somewhere, I couldn’t find it. Perhaps the closest was this fool.com article, but it left out plenty of important details for actually doing the computation. 

But if you know of another page like this, let me know! Especially if that source provides definitive precision values for each computation step – not easy to find!

Note that I’m sticking to standard social security income here – nothing fancy like spousal benefits, disability benefits, etc. We’ll save those for a future post.

Alrighty, let’s go! 

Determine if Minimum Credits Obtained

To kick things off, first you have to determine if you’re even eligible for social security income, also known as being “fully insured”. 

To be eligible, you need to have 40 credits. After that, you’re golden.

These credits are sometimes referred to as a “quarter of coverage” (QC), because “before 1978, an individual generally was credited with a quarter of coverage for each quarter in which wages of $50 or more were paid”. But after 1978, they switched to using total annual earnings instead of this funky quarterly system. So the QC term is just a holdover term from a by-gone era.

So how do you earn a credit?

Well in 1978, “the law provided that a quarter of coverage be credited for each $250 of an individual’s total wages and self-employment income for calendar year 1978 (up to a maximum of 4 quarters of coverage for the year).”

But it’s not 1978 anymore! Thus, “the amount of earnings needed for a quarter of coverage changes automatically each year with changes in the national average wage index.”

So, you can earn a maximum of four credits a year, and how many credits you earn depends on your earned income that year and the cost of the credits that year (which increases with inflation over time). 

Cost of Credits

Below is a table from ssa.gov providing the cost of a credit for each year from 1978 to 2023.

YearEarnings ($)YearEarnings ($)YearEarnings ($)
1978250199870020181,320
1979260199974020191,360
1980290200078020201,410
1981310200183020211,470
1982340200287020221,510
1983370200389020231,640
19843902004900
19854102005920
19864402006970
198746020071,000
198847020081,050
198950020091,090
199052020101,120
199154020111,120
199257020121,130
199359020131,160
199462020141,200
199563020151,220
199664020161,260
199767020171,300

You could also compute these table values using the 1978 value and the national average wage index, but it’s easy enough to just pull the values from this (relatively small) table. 

Your Earnings History

The easiest way to get your earnings history is to create an account at the social security administration site, where it will provide a table of all your earned income for your entire career.

The SSA site will also tell you if you’ve hit 40 credits or not yet – very convenient! 

The SSA tool also provides some limited capabilities for estimating your future RIB for different scenarios, if you haven’t already started. But of course I want to do much deeper analysis (especially with regards to FIRE scenarios), which is why I’m going through all the effort to build this tool. 

Determine Taxable Income

Now if you’re getting your earnings history from the SSA site, it’s already providing you with your taxable income for social security purposes. Easy.

But if you’re getting those values from your own records, and you’ve earned an above average income at any point in your career, you’ll need to determine if you were over the maximum taxable income for any year. 

If so, you’ll need to change your income to that maximum value, also referred to as the “contribution and benefit base” (CBB), for all the subsequent calculations. That’s because that max value was the amount of income you paid social security taxes for that year.

The max taxable income for each year from 1937 to 2023 is provided in the table below, available on ssa.gov:

YearMax Taxable Income ($)YearMax Taxable Income ($)YearMax Taxable Income ($)
1937-503,000198642,000200694,200
1951-543,600198743,800200797,500
1955-584,200198845,0002008102,000
1959-654,800198948,0002009106,800
1966-676,600199051,3002010106,800
1968-717,800199153,4002011106,800
19729,000199255,5002012110,100
197310,800199357,6002013113,700
197413,200199460,6002014117,000
197514,100199561,2002015118,500
197615,300199662,7002016118,500
197716,500199765,4002017127,200
197817,700199868,4002018128,400
197922,900199972,6002019132,900
198025,900200076,2002020137,700
198129,700200180,4002021142,800
198232,400200284,9002022147,000
198335,700200387,0002023160,200
198437,800200487,900
198539,600200590,000

Adjust Income For Inflation

Next up we need to adjust your historical earnings for inflation.

The SSA uses something called the Average Wage Index (AWI) to do this inflation adjustment. 

First, compute the year you turned 60. Easy. 

Then pick out the AWI for the year you turned 60 (sometimes referred to as your “AWI base”) using the table below, available on ssa.gov:

YearAWI ($)YearAWI ($)YearAWI ($)
19512,799.1619769,226.48200132,921.92
19522,973.3219779,779.44200233,252.09
19533,139.44197810,556.03200334,064.95
19543,155.64197911,479.46200435,648.55
19553,301.44198012,513.46200536,952.94
19563,532.36198113,773.10200638,651.41
19573,641.72198214,531.34200740,405.48
19583,673.80198315,239.24200841,334.97
19593,855.80198416,135.07200940,711.61
19604,007.12198516,822.51201041,673.83
19614,086.76198617,321.82201142,979.61
19624,291.40198718,426.51201244,321.67
19634,396.64198819,334.04201344,888.16
19644,576.32198920,099.55201446,481.52
19654,658.72199021,027.98201548,098.63
19664,938.36199121,811.60201648,642.15
19675,213.44199222,935.42201750,321.89
19685,571.76199323,132.67201852,145.80
19695,893.76199423,753.53201954,099.99
19706,186.24199524,705.66202055,628.60
19716,497.08199625,913.90202160,575.07
19727,133.80199727,426.00
19737,580.16199828,861.44
19748,030.76199930,469.84
19758,630.92200032,154.82

Note: if you turned 60 after 2021, then here in 2023 you’re not yet 62, the earliest you can receive RIB. Computing future estimates of RIB I’ll be discussing in a future post. 

For each year of earnings before you turned 60, do the following:

  • Divide your “Age 60” AWI value by the AWI value for that previous year. The SSA also refers to this ratio as an “index factor”. Round this value to the 7th digit place after the decimal, because that is the precision reported by this ssa.gov tool that generates factors. I’m not sure if that’s 100% correct, since I could not find anything definitive about how many decimals to retain (which is overlooked far too often), but hopefully it’s good enough. 
  • Multiply this ratio/factor by your earnings for that year, to get your inflation-adjusted earnings. Round this result to the nearest cent.

Note: for the year you turned 60 and all subsequent years, the factor is always 1. Now you might initially think that’s a terrible rip-off: you’re not getting your earnings from your 60’s adjusted for inflation! WTF! But don’t worry – you’ll be getting Cost Of Living Adjustments (COLA) in a subsequent step.

Compute Average Indexed Monthly Earnings (AIME)

Now that we have all your inflation-adjusted earnings, it’s time to compute your Average Indexed Monthly Earnings (AIME).

Fortunately this step is pretty easy. Just add up the inflation-adjusted earnings of the 35 years with the highest values, and divide by 420 (the number of months in 35 years). 

Note that this will include plenty of zeros if you FIRE and never earn another dime. 

Truncate the resulting AIME value down to the lower dollar amount

Compute Primary Insurance Amount (PIA)

Next up is computing the Primary Insurance Amount (PIA), which is probably the term you’ll hear the second-most when discussing social security payments (after the main payment itself). 

First, compute the year you turned 62. Easy. 

Again note that if you’re not turning 62 this year or earlier, you’re not yet eligible to receive RIB. Computing future estimates of RIB I’ll be discussing in a future post. 

Next you’ll find the two “bend point” values for the year you turned 62 (even if you’re not starting RIB at age 62). Use the table below, available on ssa.gov:

YearBend Point 1 ($)Bend Point 2 ($)YearBend Point 1 ($)Bend Point 2 ($)
19791801,08520025923,567
19801941,17120036063,653
19812111,27420046123,689
19822301,38820056273,779
19832541,52820066563,955
19842671,61220076804,100
19852801,69120087114,288
19862971,79020097444,483
19873101,86620107614,586
19883191,92220117494,517
19893392,04420127674,624
19903562,14520137914,768
19913702,23020148164,917
19923872,33320158264,980
19934012,42020168565,157
19944222,54520178855,336
19954262,56720188955,397
19964372,63520199265,583
19974552,74120209605,785
19984772,87520219966,002
19995053,04320221,0246,172
20005313,20220231,1156,721
20015613,381

Note: these bend points are all just the 1979 bend points of $180 and $1,085 mapped forward in time using the AWI.

Now we can compute your PIA, using these bend points and your AIME. 

If your AIME is less than (or equal to) the first bend point:

PIA = 0.9 * AIME

If your AIME is between the first bend point and the second bend point (or equal to either bend point):

PIA = 0.9 * Bend Point 1 + 0.32 * (AIME – Bend Point 1)

If your AIME is greater than the second bend point:

PIA = 0.9 * Bend Point 1 + 0.32 * (Bend Point 2 – Bend Point 1) + 0.15 * (AIME – Bend Point 2)

Finally, truncate the PIA down to the lower dime

Cost of Living Adjustments (COLA)

Remember how I said not to panic about inflation earlier? Well now we’ll finally do the Cost of Living Adjustments (COLA)!

First, compute the year you turned 62. Easy. 

Next we’ll apply COLA to your PIA, from the year you turned 62 to the current year. 

For each of those years, pull the COLA value from the table below, available on ssa.gov:

YearCOLA (%)YearCOLA (%)YearCOLA (%)
1975819952.620150
19766.419962.920160.3
19775.919972.120172
19786.519981.320182.8
19799.91999 a2.520191.6
198014.320003.520201.3
198111.220012.620215.9
19827.420021.420228.7
19833.520032.1
19843.520042.7
19853.120054.1
19861.320063.3
19874.220072.3
1988420085.8
19894.720090
19905.420100
19913.720113.6
1992320121.7
19932.620131.5
19942.820141.7

For each one of those years from age 62 to the current year, do the following:

  1. Multiply the PIA (which includes any COLA adjustments from previous years) by the COLA for that year: New PIA = Previous Year PIA * (1 + COLA/100)
  1. Truncate the new PIA down the next lower dime. Note: this truncation must be done for each year, and should not be done simply after all COLA are applied.

Determine Full Retirement Age (FRA)

Now we need to determine your Full Retirement Age (FRA), also sometimes called the Normal Retirement Age (NRA). 

If you decide to start your social security income at this age, your RIB will match your PIA. Pretty straightforward.

Your FRA depends on what year you were born. See the table below, available on ssa.gov:

Birth YearFull Retirement Age
1937 and prior65
193865 and 2 months
193965 and 4 months
194065 and 6 months
194165 and 8 months
194265 and 10 months
1943-5466
195566 and 2 months
195666 and 4 months
195766 and 6 months
195866 and 8 months
195966 and 10 months
1960 and later67

There’s also a quirky little exception for people born on January 1 described on that page. Weird. 

Early / Delayed Retirement Adjustment

But what if you don’t want to start your social security income (RIB) at exactly your FRA?

Fortunately the SSA lays out pretty clearly how your RIB is decreased or increased.

If you want to start RIB 36 months (3 years) or less before your FRA:

RIB = PIA * (1 – (5/9) * 0.01 * Number of Months Early)

If you want to start RIB more than 36 months before your FRA (maximum is 60 months if your FRA is 67, since earliest age you can start RIB is 62):

RIB = PIA * (1 – 0.2 – (5/12) * 0.01 * (Number of Months Early – 36))

If you want to start RIB after your FRA (maximum is 36 months if your FRA is 67, since latest age you can start RIB is 70):

RIB = PIA * (1 + (2/3) * 0.01 * Number of Months Later)

Note: the equation above for starting RIB after your FRA assumes you were born in 1943 or later. If not, divide the delayed retirement credit per year in the table provided by ssa.gov to determine how much each additional month will increase your RIB.

You can also use this overly complicated table provided by the SSA to check the value you got from the above equations. 

Final Truncation

Finally, after all the above math, you just need to truncate the result to the next lower dollar amount. That’s the amount you’ll get from the SSA each month.

Diagrams

Below are a couple of diagrams visualizing the above steps. Initially I tried to put it into a single slide, but you can easily see how crazy that would have been.

Examples and Testing

Of course any time you build a new tool or model, it’s vitally important to test it.

My first two test cases were straight from the SSA site: Case A and Case B.

And fortunately I was able to perfectly match the values provided at every step. And I was able to determine/confirm the required precision needed at each step by comparing my values to those provided in the page. 

I’m very glad they provide these examples. 

There’s a lot more testing I want to do though. There are numerous calculators provided by the SSA and many, many, many, many, many, many, many, many, many, many, many, many, many others that I’d like to compare my tool to. 

I also happen to know some folks that are either taking social security income now or could take it now (but are currently waiting), so I’d like to get their values and confirm I get the same income generated by the SSA. 

Code

In the end it took about 500 lines of Python code to compute just this most standard social security income. Nothing fancy like spousal benefits, disability benefits, etc. 

I’ve placed the code in the EYFI github repo, which you’re welcome to download and run yourself if you’d like to plug in your own values or just play around with different inputs.

You can also run the embedded Python interpreter below. Modify the user inputs section at the top as desired, then hit the Run/Play (sideways triangle) button to generate the plots. To go back to the script to make any changes, hit the Pencil icon. If you want the text larger, hit the hamburger menu button, then scroll to the bottom to see larger font options. In that same menu you can also Full Screen the window, and other actions.

Analysis Questions and Future Work

Now that I have a tool that can compute social security income, and which I can fully automate and control via Python (unlike every other calculator listed above), there are a TON of really interesting questions and analysis I’d like to pursue. And additional capabilities to build as well. 

The biggest questions I’d like to answer are:

  1. When is the optimal time to take social security? Is it really best to wait until age 70 as so many social security advisors and pundits recommend? What about the ROI on the earnings you’ll get if you take social security earlier?
  1. If you have a spouse, how does that change the optimal timing? It looks like spousal benefits are based on PIA, so taking RIB early or late might not have an impact on spousal benefits – but I want to verify.
  1. How are social security benefits impacted by FIRE? And how much more social security can you expect to get if you fall victim to the “one more year” syndrome? What if you start a business after FIRE?
  1. Maybe: what happens if the trust fund reserves are exhausted in 2037 and we only receive 76% of our nominal benefits? How does that impact the decision process?

To answer these questions, I’m also going to need to build the ability to generate future RIB estimates. Hopefully that will be reasonably straightforward, especially if I keep everything in present day dollars (so no inflation factors will be involved).

I’ve also read that the Open Social Security calculator takes into account actuarial values for probability of death each year when delivering a recommendation on when to start social security – I’d love to replicate that if possible, and perhaps explore further questions I have. 

Lots more to do!

It’s funny how social security is one of those topics that people really care about (as they should), and yet is so surprisingly complex that most people quickly shut down when faced with trying to figure it all out. Hopefully this post providing every step gives you a better sense of the overall calculation, and demystifies it at least a little.

If you have any particular burning social security questions, let me know!

Leave a Comment

Your email address will not be published. Required fields are marked *