Suppose you have $1000 and you put it in a bank at 3% interest. A year later you have $1030. How do we know this? We take the interest rate, 3%, and add it to 1, giving us 1.03. Multiply $1000 * 1.03 and you get $1030.
When investing, we run this same problem backwards. A 1 year bond will perhaps pay you $1000 in one year. You buy the bond for $970.87. What's the interest rate? That is, if you put $970.87 in a bank for a year, and at the end of the year you had $1000, what interest rate would they have paid you. This is easy to work out with a calculator. If the interest rate is i, then the math is:
970.87 * (1+i) = 1000.
1+i = 1000 / 970.87 = 1.03.
i = 3%.
This is how bonds are sold. You buy the bond at a discount from the face value, and it's generally up to you to determine the interest rate. If this were all there were to interest, it wouldn't be worth a page. But, there's a bit more. . .
Suppose you buy a 91 day T-Bill from the government. It has a face value of $10,000, and you paid $9,918.61. What is your interest rate? We get the 91 day rate from the formula above, 1+i = 10000/9918.61 = 1.0082. That's the interest rate for 91 days. Now we want to know the interest rate for a year. 91 days * 4 = 364 days, which is close enough to a year for me. The yearly interest rate will then be 1.00824 = 1.0332, so the yearly interest rate is 3.32%. There is also a 182 day t-bill. Suppose you bought a $10,000 T-bill for $9,827.10. The interest rate for 182 days is 1+i = 10000 / 9827.10 = 1.0176. The 364 day interest rate is 1.01762 = 1.0355, so the yearly interest rate is 3.55%.
The government uses slightly different math to calculate their interest rates. I don't know where they learned their math, but it certainly wasn't at any school I ever attended. It's truly arcane. Accordingly, their numbers differ from mine in the 3rd decimal place. I don't care, I stand by mine. You can learn about their method of madness at the NY Federal Reserve Bank.
These T-bills are most often called 90 and 180 day T-bills. Why are they actually 91 and 182 days? The answer is that 91 days is exactly 13 weeks, so the government pays you on the same day of the week that you bought it. Also, 91*4 = 364 which is almost a year. 90*4 = 360 which is almost a week short of a year.
During the Great Depression, there were a lot of banks failing. Banks failing puts the entire economy at great risk - when banks fail, people lose their deposits and the value of money itself comes into question. To help the banks, the government passed laws putting a cap on the interest rates that banks could pay on deposits. The idea was that if the bank could charge any interest they wanted on loans but was legally only able to pay a small amount of interest on deposits, then the banks would make more money and quit failing. Of course no one can control a market place for long, and pretty quickly banks came up with creative ways to get around this poorly conceived law. Curiously, this law is long gone, but the weird clever tricks played by the banks still remain with us. APR is a left over from this strange depression era environment.
In the depression, the government set a cap on yearly interest rate. We'll pretend this cap rate was 3%. What the banks figured out was that they could divide the 3% number by 12 to get a monthly interest rate - in this case, 3% / 12 = .25%. So, the bank would pay .25% per month instead of 3% per year. The difference between these is that in the monthly interest case, you get paid a little interest at the end of each month, and then next month you earn interest on your money plus the interest. When you earn interest on the interest payments, it's called compound interest. If you put $1000 in a bank account at 3% paid yearly, at the end of the year you will have $1030. If the interest is paid monthly, you'll have $1000 * (1.0025)12. which is $1030.42. The 42 cents represents the interest paid on the interest. The bank could not advertise that their interest rate was higher than 3%, so a new term was invented: APR, the "Annual Percentage Rate."
Eventually, this was taken to the extreme. Banks would advertise that the interest was paid monthly, then weekly, then daily. The finer the time between interest payments, the (slightly) more interest you earn. 3% paid yearly on $1000 is $30. 3% paid monthly is $30.42. 3% paid daily is $30.45. Back then that 3 cents difference between monthly and daily would buy you a day old loaf of bread, this was "real" money.
We can figure out what this process does in the limiting case. What we're calculating here is interest. If the yearly interest rate is i, then the interest paid yearly gives you a new balance of 1+i. If the interest is paid monthly, then it's (1 + i/12)12. If the interest is paid daily it's (1 + i/365)365. In these days of computers, we can imagine paying the interest hourly, each minute, each second, this could get out of hand. The general formula for making n payments in a year is (1 + i/n)n. As n goes to infinity, this series becomes ei. If n is infinite, we say the interest is compounded continuously. 3% compounded continuously is e.03 which is 3.4545%.