Interest rates are the price paid or earned when you borrow money or invest in a savings account, bond or other financial instrument. Understanding how they work can help you make better decisions about your finances and investments.

There are two main types of interest: simple and compound. Simple interest is calculated as a percentage of the original principal, while compound interest is calculated using a formula that includes both the initial principal and the accrued interest over time.

The cost or return of a loan, investment or deposit depends on many factors, including the market, the economy and the borrower’s creditworthiness. In general, a higher interest rate means it is more expensive to borrow, and a lower interest rate means it is less expensive to invest.

For example, if you borrow $100 from the bank and pay it back a year later, you will owe them $110: $100 for the principle and $10 for the interest. However, if you want to calculate the same thing over a longer period of time—say, 20 years—you’ll need to divide the number of years by 12 because there are only 12 months in a year.

In the market for loans, deposits and investments, the interest rate is determined by supply and demand, similar to that in the marketplace for goods or services. When there is a surplus of demand for money or credit, lenders raise interest rates in an attempt to attract more borrowers. Likewise, when demand for money or credit falls, interest rates fall.