This is a little windows program that calculates your mortgage payment schedule. It can be used to help answer questions such as:
If I increase my monthly payment by $100, how much do I save in interest payment over the lifetime of the loan? And how much sooner will my loan be paid off?
If I do a lump sum principal reduction payment of $10k, how much do I save in interest payment over the lifetime of the loan? And how much sooner will my loan be paid off?
How much am I “throwing away” each month to Interest and Escrow? And (with some additional research), is that amount less than what I would be paying to rent a similarly sized apartment in the same area?
If I am doing worse than I would be if I was just paying rent, then when (what year and month) will I cross the line, and be doing better?
What happens to my payment schedule if I refinance, and lower my interest rate by .5%?
Note that the python script was made into an standalone .exe using pyinstaller. For whatever reason, running this seems to trigger virus checkers. If you don’t trust the .exe (or if you want to use this on a non-windows machine), I’ve included the source code below, so you can run the program yourself off the commandline.
def CalcLoan():
fLoanAmountTotal = float(ent_LoanAmt.get())
fLoanAmountCurr = fLoanAmountTotal
fInterestRate = float(ent_InterestRate.get())
fMonthlyInterestRate = (fInterestRate / 12.0)
fMonthlyPrincipalAndInterest = float(ent_MonthlyPrincipleAndInterest.get())
fMonthlyEscrow = float(ent_MonthlyEscrow.get())
fMonthlyPayment = (fMonthlyPrincipalAndInterest + fMonthlyEscrow)
txt_Output.delete("1.0", tk.END)
txt_Output.insert(tk.END,"LoanAmount: {:.2f}".format(fLoanAmountTotal))
txt_Output.insert(tk.END,"\nInterest Rate: {:f}".format(fInterestRate))
txt_Output.insert(tk.END,"\nMonthly Payment: {:.2f}".format(fMonthlyPayment))
# determine the how much interest and principal is owed this month
fMonthlyInterest = (fMonthlyInterestRate * fLoanAmountCurr)
fMonthlyPrincipal = (fMonthlyPayment - fMonthlyInterest) - fMonthlyEscrow
fTotalInterestPaid = 0
iMonthsElapsed = 0
while fLoanAmountCurr > 0:
txt_Output.insert(tk.END,
"\nyr: {:d}| mo: {:d}| curr loan: {:.2f} | principal part: {:.2f} | interest part: {:.2f} | interest+escrow part {:.2f} | total interest paid {:.2f}".format(
int(iMonthsElapsed/12) + 1,
int(iMonthsElapsed%12) + 1,
fLoanAmountCurr,
fMonthlyPrincipal,
fMonthlyInterest,
fMonthlyInterest +
fMonthlyEscrow,
fTotalInterestPaid)
);
# keep track of how much interest paid so far
fTotalInterestPaid += fMonthlyInterest
# update the current loan amt
fLoanAmountCurr -= fMonthlyPrincipal
# now that the curr loan amt has changed recalculate how much interest and principal is owed
fMonthlyInterest = (fMonthlyInterestRate * fLoanAmountCurr)
fMonthlyPrincipal = (fMonthlyPayment - fMonthlyInterest) - fMonthlyEscrow
iMonthsElapsed += 1
window = tk.Tk()
window.title("MarkyD's Mortgage Payment Schedule Analyzer")
frm_entry = tk.Frame(master=window)
lbl_LoanAmt = tk.Label(text="Mortgage Amount")
ent_LoanAmt = tk.Entry()
ent_LoanAmt.insert(0, "621000.00")
lbl_LoanAmt.pack()
ent_LoanAmt.pack()
lbl_InterestRate = tk.Label(text="Yearly Interest Rate")
ent_InterestRate = tk.Entry()
ent_InterestRate.insert(0, "0.02875")
lbl_InterestRate.pack()
ent_InterestRate.pack()
lbl_MonthlyPrincipleAndInterest = tk.Label(text="Monthly Principal and Interest Payment")
ent_MonthlyPrincipleAndInterest = tk.Entry()
ent_MonthlyPrincipleAndInterest.insert(0, "2576.49")
lbl_MonthlyPrincipleAndInterest.pack()
ent_MonthlyPrincipleAndInterest.pack()
lbl_MonthlyEscrow = tk.Label(text="Monthly Escrow Payment")
ent_MonthlyEscrow = tk.Entry()
ent_MonthlyEscrow.insert(0, "842.47")
lbl_MonthlyEscrow.pack()
ent_MonthlyEscrow.pack()
btn_Calculate = tk.Button(
text="Calculate!",
width=15,
height=2,
command = CalcLoan
)
btn_Calculate.pack()
txt_Output = tk.Text(width = 175, height = 25)
txt_Output.pack()
window.mainloop()