If you just want to get started with working with EC2 and learning, Amazon provides EC2 in a free tier. It offers a t2.micro instance type to run for up to 750 hours per month. You can use the Amazon free tier for 12 months from the date of opening a new account. These 750 hours can be utilized either by one instance for 30 days 24 x 7 or running 10 instances for 15 hours as you need.
When using instance types other than the free tier, charges apply on a per hour basis and charges vary based on instance type, region, and payment option. A small instance type, with a smaller number of vCPUs and less memory, costs less compared to an instance type having more vCPUs and memory.
Amazon charges EC2 instances on a per hour basis and actual EC2 pricing depends on instance type, size, and payment model. There are four ways to pay for Amazon EC2 instances, as follows...