Compound interest is calculated using the formula: A = P (1 + r/n)^(nt) Where:
A is the amount of money accumulated after n years, including interest. P is the principal amount (the initial sum of money). r is the annual interest rate (decimal). n is the number of times that interest is compounded per year. t is the time the money is invested for, in years.