The choice between 15-year and 30-year fixed-rate mortgages is the most common. But sometimes you’ll see loans for 20, 25 or 35 years. Deals for 40 years appear from time to time, as well. In fact, the Obama Administration’s Making Homes Affordable program for homeowners facing foreclosure offers the option of extending loan terms to 40 years to bring down monthly payments.

The choice between short or long-term involves a simple tradeoff. A longer term reduces the monthly payment on a given loan amount, but it slows the build-up of equity in the home and increases the amount of interest paid if you have the mortgage for the full term.

The BankingMyWay.com Mortgage Loan Calculator shows how changing the loan term affects the results. To keep it simple, we’ll assume the same 5 percent loan rate regardless of the term, though shorter terms usually come with slightly lower rates.

With a 15-year term, you’d pay $791 a month for every $100,000 borrowed, and you’d pay $42,343 in interest over 15 years.

Change the term to 30 years and the monthly payment falls to $537, but total interest more than doubles to $93,256.

The calculator doesn’t go to 40 years, since super-long loans have not been common as of recent, but one of these would charge $484 a month and $131,454 in total interest over four decades.

After 10 years, remaining principal would be $41,905 on the 15-year loan, $81,342 on the 30-year loan and $89,824 on the 40-year loan.

At first glance, it seems you would be nearly $40,000 wealthier if you’d chosen the 15-year deal over the 30-year one, since your remaining debt would be that much lower. But, of course, you’d have paid $254 more per month on the 15-year deal, or nearly $31,000 more over the 10 years.