Mortgage Formulas
Revised November 26, 2008, Reviewed July 24, 2009
Many readers, for reasons of their own, request the algebraic formulas used to calculate the monthly payment and loan balance on amortized mortgages. Here they are:
The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].
Monthly Payment and Loan Balance
Many readers, for reasons of their own, request the algebraic formulas used to calculate the monthly payment and loan balance on amortized mortgages. Here they are:
The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005].
P = L[c(1 + c)^{n}]/[(1 + c)^{n}  1] 
B = L[(1 + c)^{n}  (1 + c)^{p}]/[(1 + c)^{n}  1] 
Annual Percentage Rate (APR)
Other readers ask about the formula used to calculate the APR. The APR is what economists call an "internal rate of return" (IRR), or the discount rate that equates a future stream of dollars with the present value of that stream. In the case of a home mortgage, the formula is
L  F = P_{1}/(1 + i) + P_{2}/(1 + i)^{2} +… (P_{n} + B_{n})/(1 + i)^{n} 

i = IRR
L = Loan amount
F = Points and all other lender fees
P = Monthly payment
n = Month when the balance is paid in full
B_{n }= Balance in month n
The APR is a special case of the IRR, because it assumes that the loan runs to term. In the equation, this means that n is equal to the term, and Bn is zero.
If there is a monthly mortgage insurance premium, that premium must be included in P for as long as the balance exceeds 78% of the original property value. If there is an upfront premium, it is included in F. If the upfront premium is financed, P should be calculated based on the larger loan amount, but L should not include the premium.
Note that on ARMs, the payments used to calculate the APR are those that would occur under the assumption that the index rate does not change over the life of the loan.
On a cashout refinance, the APR ignores the existing mortgage that is paid off, which makes it a poor guide to the decision (see The APR on a CashOut Refinance). The better guide is a "netcash APR", in which the balance of the existing loan (including interest accrued to the day of payoff) is subtracted from the left side of the equation, and the "Ps" represent the difference in payment between the old and new mortgage.
Future Values
Many of my calculators measure financial results in terms of "future values"  the borrower's net wealth at the end of a specified period.
The future value of a single sum today is:
FV_{n} = S(1+c)^{n} 
 FV_{n} is the value of the single sum after n periods
S is the amount of the single sum now
c is the applicable interest rate
n is the length of the period
FV_{n} = P[(1+c)^{n}  1]/c 