# Mortgage calculator

Mortgage calculators are automated tools that enable users to determine the financial implications of changes in one or more variables in a mortgage financing arrangement. Mortgage calculators are used by consumers to determine monthly repayments, and by mortgage providers to determine the financial suitability of a home loan applicant. Mortgage calculators are frequently on for-profit websites, though the Consumer Financial Protection Bureau has launched its own public mortgage calculator.$^{:1267,1281–83}$
The major variables in a mortgage calculation include loan principal, balance, periodic compound interest rate, number of payments per year, total number of payments and the regular payment amount. More complex calculators can take into account other costs associated with a mortgage, such as local and state taxes, and insurance.
Mortgage calculation capabilities can be found on financial handheld calculators such as the HP-12C or Texas Instruments TI BA II Plus. There are also multiple free online free mortgage calculators, and software programs offering financial and mortgage calculations.

## Uses

When purchasing a new home, most buyers choose to finance a portion of the purchase price via the use of a mortgage. Prior to the wide availability of mortgage calculators, those wishing to understand the financial implications of changes to the five main variables in a mortgage transaction were forced to use compound interest rate tables. These tables generally required a working understanding of compound interest mathematics for proper use. In contrast, mortgage calculators make answers to questions regarding the impact of changes in mortgage variables available to everyone.
Mortgage calculators can be used to answer such questions as:
If one borrows $250,000 at a 7% annual interest rate and pays the loan back over thirty years, with $3,000 annual property tax payment, $1,500 annual property insurance cost and 0.5% annual private mortgage insurance payment, what will the monthly payment be? The answer is $2,142.42.
A potential borrower can use an online mortgage calculator to see how much property he or she can afford. A lender will compare the person's total monthly income and total monthly debt load. A mortgage calculator can help to add up all income sources and compare this to all monthly debt payments. It can also factor in a potential mortgage payment and other associated housing costs (property taxes, homeownership dues, etc.). One can test different loan sizes and interest rates. Generally speaking, lenders do not like to see all of a borrower's debt payments (including property expenses) exceed around 40% of total monthly pretax income. Some mortgage lenders are known to allow as high as 55%.

## Monthly payment formula

The fixed monthly payment for a fixed rate mortgage is the amount paid by the borrower every month that ensures that the loan is paid off in full with interest at the end of its term. The monthly payment formula is based on the annuity formula. The monthly payment c depends upon:
* r - the monthly interest rate. Since the quoted yearly percentage rate is not a compounded rate, the monthly percentage rate is simply the yearly percentage rate divided by 12. For example, if the yearly percentage rate was 6% (i.e. 0.06), then r would be $0.06/12$ or 0.5% (i.e. 0.005).
* N - the number of monthly payments, called the loan's term, and
* P - the amount borrowed, known as the loan's principal.
In the standardized calculations used in the United States, c is given by the formula:
$c={\begin{cases}{\frac {rP}{1-(1+r)^{-N}}}={\frac {rP(1+r)^{N}}{(1+r)^{N}-1}},&r\neq 0;\\{\frac {P}{N}},&r=0.\end{cases}}$
For example, for a home loan of $200,000 with a fixed yearly interest rate of 6.5% for 30 years, the principal is $P=200000$, the monthly interest rate is $r=0.065/12$, the number of monthly payments is $N=30\cdot 12=360$, the fixed monthly payment equals $1,264.14. This formula is provided using the financial function PMT in a spreadsheet such as Excel. In the example, the monthly payment is obtained by entering either of these formulas:
* = -PMT(6.5 / 100 / 12, 30 * 12, 200000)
* = ((6.5 / 100 / 12) * 200000) / (1 - ((1 + (6.5 / 100 / 12)) ^ (-30 * 12)))
* = 1264.14
The following derivation of this formula illustrates how fixed-rate mortgage loans work. The amount owed on the loan at the end of every month equals the amount owed from the previous month, plus the interest on this amount, minus the fixed amount paid every month. This fact results in the debt schedule:
| Amount owed ... | Formula |
| at initiation | $P$ |
| after 1 month | $(1+r)P-c$ |
| after 2 months | $(1+r)((1+r)P-c)-c=(1+r)^{2}P-(1+(1+r))c$ |
| after N months | $(1+r)^{N}P-(1+(1+r)+(1+r)^{2}+\cdots +(1+r)^{N-1})c$ |
The polynomial $p_{N}(x)=1+x+x^{2}+\cdots +x^{N-1}$ appearing before the fixed monthly payment c (with $x=1+r$) is a geometric series, which has a simple closed-form expression obtained from observing that $xp_{N}(x)-p_{N}(x)=x^{N}-1$ because all but the first and last terms in this difference cancel each other out. Therefore, solving for $p_{N}(x)$ yields the much simpler closed-form expression
$p_{N}(x)=1+x+x^{2}+\cdots +x^{N-1}={\frac {x^{N}-1}{x-1}}$
Applying this formula to the amount owed at the end of the Nth month gives (using $p_{N}$ to succinctly denote the function value $p_{N}(x)$ at argument value $x=(1+r)$):
${\begin{aligned}&=(1+r)^{N}P-p_{N}c\\&=(1+r)^{N}P-{\frac {(1+r)^{N}-1}{(1+r)-1}}c\\&=(1+r)^{N}P-{\frac {(1+r)^{N}-1}{r}}c.\end{aligned}}$
The amount of the monthly payment at the end of month N that is applied to principal paydown equals the amount c of payment minus the amount of interest currently paid on the pre-existing unpaid principal. The latter amount, the interest component of the current payment, is the interest rate r times the amount unpaid at the end of month N–1. Since in the early years of the mortgage the unpaid principal is still large, so are the interest payments on it; so the portion of the monthly payment going toward paying down the principal is very small and equity in the property accumulates very slowly (in the absence of changes in the market value of the property). But in the later years of the mortgage, when the principal has already been substantially paid down and not much monthly interest needs to be paid, most of the monthly payment goes toward repayment of the principal, and the remaining principal declines rapidly.
The borrower's equity in the property equals the current market value of the property minus the amount owed according to the above formula.
With a fixed rate mortgage, the borrower agrees to pay off the loan completely at the end of the loan's term, so the amount owed at month N must be zero. For this to happen, the monthly payment c can be obtained from the previous equation to obtain:
${\begin{aligned}c&={\frac {r(1+r)^{N}}{(1+r)^{N}-1}}P\\&={\frac {r}{1-(1+r)^{-N}}}P\end{aligned}}$
which is the formula originally provided. This derivation illustrates three key components of fixed-rate loans: (1) the fixed monthly payment depends upon the amount borrowed, the interest rate, and the length of time over which the loan is repaid; (2) the amount owed every month equals the amount owed from the previous month plus interest on that amount, minus the fixed monthly payment; (3) the fixed monthly payment is chosen so that the loan is paid off in full with interest at the end of its term and no more money is owed.

## Adjustable interest rates

While adjustable-rate mortgages have been around for decades, from 2002 through 2005 adjustable-rate mortgages became more complicated as did the calculations involved. Lending became much more creative which complicated the calculations. Subprime lending and creative loans such as the "pick a payment", "pay option", and "hybrid" loans brought on a new era of mortgage calculations. The more creative adjustable mortgages meant some changes in the calculations to specifically handle these complicated loans. To calculate the annual percentage rates (APR) many more variables needed to be added, including: the starting interest rate; the length of time at that rate; the recast; the payment change; the index; the margins; the periodic interest change cap; the payment cap; lifetime cap; the negative amortization cap; and others. Many lenders created their own software programs, and World Savings even had contracted special calculators to be made by Calculated Industries specifically for their "pick a payment" program. However, by the late 2000s the Great Recession brought an end to many of the creative "pick-a-payment" type of loans which left many borrowers with higher loan balances over time, and owing more than their houses were worth. This also helped reduce the more complicated calculations that went along with these mortgages.

## Total interest paid formula

The total amount of interest $I$ that will be paid over the lifetime of the loan is the difference of the total payment amount ($cN$) and the loan principal ($P$):
$I=cN-P$
where $c$ is the fixed monthly payment, $N$ is the number of payments that will be made, and $P$ is the initial principal balance on the loan.
The cumulative interest paid at the end of any period N can be calculated by:
$(Pr-c){\frac {((1+r)^{N}-1)}{r}}+cN$

## Outside the U.S.

In the United Kingdom, the FCA - Financial Conduct Authority (formerly the FSA - Financial Services Authority) regulates loans secured on residential property. It does not prescribe any specific calculation method. However, it does prescribe that, for comparative purposes, lenders must display an Annual Percentage Rate as prominently as they display other rates.
In Spain, the regulatory authority (Banco de España) has issued and enforced some good practices, such as clearly advertising the Annual Percentage Rate and stating how and when payments change in variable rate mortgages.