BLOG.CSHARPHELPER.COM: Roughly compare the savings a normal bank account would give versus a 401(k) (a US tax thing) in C#
Roughly compare the savings a normal bank account would give versus a 401(k) (a US tax thing) in C#
Important Note: I am not a tax or investment professional. I don't even pretend to understand this stuff. This is a very simple tool for playing with numbers (it doesn't even compound continuously) and I don't vouch for its correctness. It should in no way be taken for investment advice. What, are you crazy???
That said...
A 401(k) retirement plan lets you save money tax deferred. As I understand it, that means you don't pay tax on that money before you put it into the plan and any interest the money accrues is not taxed. When you remove money from the plan, you pay taxes on it, although you may be paying at a lower tax rate because you may be earning less. There are also penalties if you withdraw money before retirement age (which will probably be around 140 by the time I retire).
Enter the annual contribution you would make to the plan, your income tax rate, the annual interest rate you expect to earn, and the number of years you want to examine. When you click Go, the following code executes.
The program uses the following code to compare normal and 401(k) results.
The code gets your inputs. It then loops through the years calculating balances for a normal bank account and for a 401(k).
For the bank account, the code calculates your interest for the previous year, adds that to your contribution, subtracts taxes from both, and adds the result to the account balance.
For the 401(k), the calculation is the same except the program does not subtract taxes.
Comments