# What is the PMT equation?

I need to create a JavaScript form that does the same calculation as this =PMT() function. mortgage = 220000 rate= 4.75% term = 30 The example formula I have is =PMT(4.75%/12,3

I need to create a JavaScript form that does the same calculation as this =PMT() function. mortgage = 220000 rate= 4.75% term = 30

The example formula I have is =PMT(4.75%/12,30*12,220000*-1)

What would be the equation for this function? I tried to look up this function but it doesn't explain it very well.

The equation you want is: P = (Pv*R) / [1 - (1 + R)^(-n)]

where

**P**= Monthly Payment**Pv**= Present Value (starting value of the loan)**APR**= Annual Percentage Rate**R**= Periodic Interest Rate = APR/number of interest periods per year**n**= Total number of interest periods (interest periods per year * number of years)

Using the variables above, the Excel =PMT() function is **=PMT(R,n,Pv)**

So, for your example where:

- rate (APR) = 4.75% (making
**R**=4.75%/12 or 0.0475/12) - mortgage (
**Pv**) = 220000 - term (# of years) = 30 (
**n**=30*12 with monthly payments)

The equation becomes: P = ((220000 * (0.0475/12)) / (1 - ((1 + (0.0475/12))^(-1 * 30 * 12))))

Or, with the original equation shown directly below it for comparison: P = ((220000 * (0.0475/12)) / (1 - ((1 + (0.0475/12))^(-1 * 30 * 12)))) P = ( Pv * R ) / (1 - ( 1 + R )^( -n )