The formula for calculating compound interest is:
A = P(1 + r/n)^(nt)
Where:
A = the final amount (including principal and interest)
P = the principal amount (initial investment or loan amount)
r = annual interest rate (in decimal form)
n = number of times interest is compounded per year
t = number of years