Rent vs buy calculator
Most rent-versus-buy comparisons are wrong in the same way: they compare a mortgage payment with a rent and stop there. That ignores the deposit. Money tied up in a deposit is money not invested, and money not spent on a mortgage is money a renter can invest. This runs both sides properly and answers one question: after however many years you plan to stay, which leaves you with more?
Method. Buying: the deposit and buying costs are paid on day one; the mortgage amortises at the rate and term given; maintenance, insurance and tax are percentages of the property value each year and rise with it; at the end the property is sold at the grown value less selling costs and less the outstanding balance. Renting: rent rises each year, and the deposit plus buying costs are invested from day one at the return given. Each month, whichever side is paying less invests the difference. The answer is the net wealth each side holds at the end. Not modelled: tax on investment returns, mortgage rate changes after a fixed period, moving costs, the value of security or of being able to move, and anything specific to your jurisdiction. Arithmetic on your own numbers, not financial advice.