A Simple Formula on How to Invest for Retirement as a Self-Employed Freelance Coder

No matter where you live, relying on the government to take care for your retirement is a stupid gamble—with your future at stakes.

Nobody can see even 10 years into the future. And your government cannot guarantee to you that they will fund your retirement—you don’t even know how your government will look like in a few decades.

Therefore, it is vital to hedge your bets. While you can (and maybe should) participate in the official retirement program of your home country, you should also use other ways to prepare for retirement.

In general, there is one “free lunch” in the investment world—and this is diversification. Let’s consider a top-down approach to diversification. What are the general ways to ensure that your retirement is funded properly?

#1 Official Retirement Plan. Use the official retirement program in your home country. In the US, it’s 401(k) or IRAs (feel free to browse this article).

#2 Housing. At some point during your life, you may want to buy a place where you can live. I don’t consider this an asset (it’s really a constant expense–a liability). However, it gives you a lot of protection in retirement and reduces your dependency on third parties like landlords. It also increases your credit score so if you are experiencing hard times, you can easily take on more debt. The biggest plus of owning your own house, however, is to keep your expenses constant or even reduce them over time. While landlords will gradually increase the rent to account for inflation (between 2-5% per year), your down-payments and interest payments will stay constant. This reduces the burden for housing year after year. However, watch out that your downpayment plus interest does not exceed the amount you pay for rent. By doing this, you get one piece of real estate “for free” throughout your life. (The flip side is that you have to lower your standard of living a bit.)

#3 Stock Market. Don’t ignore this one. It’s likely to be the most important vehicle towards your financial independence in your old age. Companies will always be there to produce the goods we all consume daily. Many people avoid the stock market because of this or that reason. Some find it too complex, others have ethical issues (if you are one of those, read my article about sustainable investing), others don’t like the risk (they should worry about the risk of NOT participating on the “producer” side of the global economy). No matter what, you have to overcome your doubts and start investing a constant amount (10% of your paycheck is fine) into stocks.

But don’t even attempt picking stocks—the average return of stock pickers is mathematically proven to be below the average return of the passive investors who just buy all stocks in the market. LET ME REPEAT: IT’S MATHEMATICALLY PROVEN TO BE BETTER TO BUY INDEX FUNDS! (Proof: passive investors earn market returns, active investors play a zero-sum game around market returns which induces additional costs for trading.)

So if you earn $3000 per month, simply invest $300 into the broad market throughout your life. And do it in addition to point #1 (official retirement account). If you’d started doing just that in 1972, you’d end up with $686,000 forty years later. Inflation-adjusted. This is enough to fund your whole retirement. You can play around with the numbers at this excellent online tool.

#4: [BONUS point] Passive Income. There are many ways of earning passive income on the side. If you want to diversify even further and make your retirement a safe bet, consider building your own side business earning (more or less) passive income. You can then even spend a few hours every week during your retirement (you’ll love having a bit of work) to keep the passive income flowing. If you are interested in this option, check out this article on my blog.


If you are doing those points, you won’t have any issue with your retirement. Just enjoy your life, care about your family and friends, and work on increasing your coding productivity to earn more money (and put more money into your saving accounts).

Leave a Comment