Here is the formula to calculate interest on credit card: 

(Number of days are counted from the date of transaction made x Entire outstanding amount x rate of interest per month x 12 month)/365.

Let’s help you better understand how this formula works: When you receive the credit card bill/statement, you should pay the complete bill amount by the end of the credit free period to avoid paying interest charges on the outstanding amount. To pay your credit card bill, you normally get a credit-free period of 20 days from the bill/statement issue date.

If you pay only the monthly 'minimum due amount', which is usually about 5% of the entire amount of the bill, to the lender/issuer, you'll have to repay the outstanding amount over a period of time. This process is usually referred to as an open-end credit facility. But this credit facility comes at a price, as interest is levied (at a particular percentage) on the whole outstanding amount until you complete the entire payment of your credit card bill.

Credit cards offer a pre-approved credit facility. It is an open-end credit, wherein there's a grace period or free credit period on the utilised amount (the credit purchase made through credit card) for 20-50 days, based upon the type of the credit card. Post which, if the outstanding amount isn't paid fully or is completed by paying the 'Minimum Due Amount' then interest at the rate of 3-4 percent per month is levied on the entire outstanding amount. Hence, with open-end credit facility, you will have to pay the outstanding amount alongside the interest levied thereon on any later date.