Let's say you're going to borrow $100,000 in a 30-year mortgage. You have two loans to pick from. One is at a 12% interest rate with no fees, and the other is 10% but has $5,000 in upfront fees. The Truth in Lending Act (Regulation Z) requires the lender to state a value called APR (Annual Percentage Rate), which will allow you to take these two loans and compare them - apples to apples, so to speak.
There are two factors that can cause the APR to deviate from the stated interest rate. One is fees, as mentioned in our example above. We will explore this later. The other, is the calculation that we call "Interest Year." This one is a bit simpler. Interest Year is simply the formula for determining how a daily rate of interest is calculated. For example, if our 12% loan was calculated as 1% per month, then that calculation would cause no deviation from the stated rate, and the APR would remain at 12%. However, sometimes a loan contract will specify (although this is rare for 30-year mortgages, it is much more common on short term loans) that the daily rate is derived by dividing the annual rate by 360. If the resulting number is applied every day (365 times in a regular year and 366 times in a leap year) then the interest yield is $365.25/360 x the stated interest rate. If this were applied to both of the above loans (without yet taking any fees into account) our 12% loan would have an APR of 12.175% and our 10% loan would have an APR of 10.14583%
Now, to simplify the discussion of how fees affect the APR, we will assume an interest year with a 1:1 yield (360/360 or 365/365 for example). Any fees that are income to the lender must be taken into account, but pass through fees that are paid to third parties and do not result in income to the lender (like an appraisal or document fee) do not have to be taken into account. Our 12% interest loan has no fees, so the APR will remain at 12%. For our 10% interest loan, we must figure out the interest rate that would hypothetically result in an additional $5,000 in interest over the life of the loan.
We begin by determining the payment for a 10% interest loan of $100,000 over 360 monthly payments: $877.57/month.
Now, although this is an oversimplification, we will be within the tolerance defined by Regulation Z if we determine our whole finance charge over the life of the loan by taking $877.57 x 360 = $315,925.20 (total principal plus interest to be repaid) and now subtract the original principal $315,925.20 - $100,000 = $215,925.20 (finance charge). Now, if we add our $5,000 in fees to that finance charge plus principal and divide by the number of payments, we will get an amount that will tell us what our payment would have been if the fees had been divided up over all the payments: $315,925.20 + $5,000 = $320,925.20. $320,925.20 / 360 = $891.49
Finally to determine APR we simply have to find the interest rate that would yield us a payment of $891.49 on a 360 month loan for $100,000 principal. Unfortunately, the equation that takes term, rate, and principal and gives back payment amount is not mathematically reversible without taking the integral of an iterative function. This results in an equation which is used in practice, but which does not in any way enhance our understanding of what is really happening. The iterative function is basically a trial and error process of effectively guessing at the rate and narrowing down the guess for interest rate until we arrive at a payment of $891.49. This we can show:
GIVEN: Term = 360 months. Principal = $100,000 Interest Rate Payment
So, our 10% loan with a $5,000 fee has an APR of 10.1879%, meaning that assuming that the loan is not paid off very quickly after origination, it is still a much better deal than the loan with no fees at 12%.
Now, finally, let's combine these two factors, the fees, and the interest year. Let's assume our 12% loan is using a 360/360 interest year, so its APR is 12%. There are no factors that cause the APR of this loan to deviate from the rate. But let's assume that our 10% loan with the fee is also calculated on an Actual/360 basis. If we multiply the above derived APR of 10.1879 by $365.25/360 we get a final APR on that loan of 10.33647%. This is still better than 12%. Now we are able to do our side-by-side comparison and see which one is the better deal.