VB Tutor VB2022 VB2019 VB6 VB Sample Code About Us
Amortization Calculator

Amortization Calculator

Calculate loan payments and generate amortization schedules


Loan amortization is the process of scheduling out a fixed-rate loan into equal payments. A portion of each installment covers interest and the remaining portion goes toward the loan principal. With each payment, you'll pay less in interest and more toward your principal.

This calculator helps you understand how your loan payments are structured over time. Enter your loan details below to generate a complete amortization schedule.

Loan Calculator

Monthly Payment: $0.00
Total Payments: $0.00
Total Interest: $0.00
Payoff Time: 0 years

Amortization Schedule

Payment # Payment Date Payment Amount Principal Interest Total Interest Balance
Enter loan details and click Calculate to see the amortization schedule

Loan Amortization Concepts

Loan amortization involves several key concepts:

Interest Rate

The cost of borrowing the principal loan amount, expressed as a percentage.

Loan Term

The duration over which the loan must be repaid, typically in years.

Principal

The original sum of money borrowed in a loan.

Amortization Schedule

A table detailing each periodic payment on an amortizing loan.

The formula to calculate the periodic payment amount is:

PMT = P × [r(1+r)^n] / [(1+r)^n - 1]

Where:

Visual Basic Implementation

VB6 Code Example

Here's how to implement an amortization calculator in VB6:

Private Sub Cmd_Calculate_Click()
    Dim P As Double, r As Double, n As Integer
    Dim PVIFA As Double, pmt As Double
    
    ' Get user inputs
    P = Val(Txt_Principal.Text)
    r = Val(Txt_Interest.Text) / 100 / 12 ' Monthly interest rate
    n = Val(Txt_Term.Text) * 12 ' Total number of payments
    
    ' Calculate PVIFA (Present Value Interest Factor of an Annuity)
    PVIFA = (1 - (1 + r) ^ -n) / r
    
    ' Calculate monthly payment
    pmt = P / PVIFA
    
    ' Display results
    Lbl_Payment.Caption = Format(pmt, "Currency")
    
    ' Generate amortization schedule
    GenerateSchedule P, r, n, pmt
End Sub

Private Sub GenerateSchedule(ByVal P As Double, ByVal r As Double, _
                        ByVal n As Integer, ByVal pmt As Double)
    Dim i As Integer
    Dim balance As Double, interest As Double, principal As Double
    
    ' Clear previous data
    List_Schedule.Clear
    
    ' Add headers
    List_Schedule.AddItem "Payment #" & vbTab & "Payment" & vbTab & "Interest" & vbTab & "Principal" & vbTab & "Balance"
    
    balance = P
    
    For i = 1 To n
        interest = balance * r
        principal = pmt - interest
        balance = balance - principal
        
        ' Add to list
        List_Schedule.AddItem i & vbTab & Format(pmt, "Currency") & _
            vbTab & Format(interest, "Currency") & _
            vbTab & Format(principal, "Currency") & _
            vbTab & Format(balance, "Currency")
    Next i
End Sub

VB.NET Code Example

Modern implementation in VB.NET with OOP approach:

Public Class AmortizationCalculator
    Public Property LoanAmount As Double
    Public Property AnnualInterestRate As Double
    Public Property LoanTermYears As Integer
    Public Property PaymentsPerYear As Integer = 12

    Public ReadOnly Property PeriodicInterestRate As Double
        Get
            Return AnnualInterestRate / 100 / PaymentsPerYear
        End Get
    End Property

    Public ReadOnly Property TotalPayments As Integer
        Get
            Return LoanTermYears * PaymentsPerYear
        End Get
    End Property

    Public Function CalculatePayment() As Double
        Dim rate = PeriodicInterestRate
        Dim factor = (1 + rate) ^ TotalPayments
        Return LoanAmount * rate * factor / (factor - 1)
    End Function

    Public Function GenerateSchedule() As List(Of PaymentDetail)
        Dim schedule = New List(Of PaymentDetail)()
        Dim payment = CalculatePayment()
        Dim balance = LoanAmount
        Dim totalInterest = 0.0

        For period = 1 To TotalPayments
            Dim interest = balance * PeriodicInterestRate
            Dim principal = payment - interest
            totalInterest += interest
            balance -= principal

            Dim detail = New PaymentDetail With {
                .Period = period,
                .PaymentAmount = payment,
                .Principal = principal,
                .Interest = interest,
                .TotalInterest = totalInterest,
                .Balance = balance
            }

            schedule.Add(detail)
        Next

        Return schedule
    End Function
End Class

Public Class PaymentDetail
    Public Property Period As Integer
    Public Property PaymentAmount As Double
    Public Property Principal As Double
    Public Property Interest As Double
    Public Property TotalInterest As Double
    Public Property Balance As Double
End Class