AWS Fargate vs EC2 Cost Calculator
Compare Fargate (vCPU-hours + memory GB-hours) vs EC2 (instances x $/hour) using average running capacity and hours/day x days/month, then see baseline vs peak differences. This is compute-only.
Shared assumptions
Hours/day
Days/month
Use 30.4 for an average month.
Monthly hours: 730
Use average running tasks/instances over the month. If you schedule down environments, reduce hours/day or days/month.
Fargate inputs
Running tasks (average)
Avg $18.01 per task-month.
vCPU per task
Memory (GB) per task
Price ($ / vCPU-hour)
Price ($ / GB-hour)
Compute-only: vCPU-hours + GB-hours. Add load balancers, logs, and data transfer separately.
EC2 inputs
Instances (average)
Avg $131.33 per instance-month.
Price ($ / instance-hour)
Use a blended $/hour if you mix on-demand, Savings Plans, and Reserved Instances.
Comparison (compute-only)
Fargate monthly compute total
$108.06
EC2 monthly compute total
$393.98
Cheaper (compute-only)
Fargate
Difference (Fargate - EC2)
-$285.92 (7,257% vs EC2)
Fargate cost per task
$18.01
EC2 cost per instance
$131.33
Breakdown (sanity checks)
Fargate vCPU-hours
2,189
Fargate GB-hours
4,378
EC2 billable hours (per instance)
730
Scenario presets
Reset
How to get your inputs
- Fargate: use average running tasks and task size from ECS metrics and definitions.
- EC2: use average instance count and a blended $/hour if you mix commitments.
- Schedule: apply the same hours/day and days/month to both sides.
- Scope: this is compute-only; add logs, transfer, and load balancers separately.
Result interpretation
- If Fargate wins, verify EC2 packing efficiency and idle capacity assumptions.
- If EC2 wins, confirm you can sustain steady utilization and use commitments effectively.
Common mistakes
- Comparing peak Fargate usage to average EC2 usage (or vice versa).
- Ignoring EC2 packing efficiency and idle capacity.
Scenario planning
| Scenario | Fargate tasks | EC2 instances | Notes |
|---|---|---|---|
| Baseline | Average | Average | Normal traffic |
| Peak | High | High | Launch or incident |
Validate after changes
- Compare EC2 instance-hours and Fargate vCPU/GB hours from billing.
- Use a real month of metrics to calibrate the averages.
Next steps
Advertisement
Example scenario
- 6 tasks at 0.5 vCPU and 1 GB running 24 hours/day for 30 days vs 3 instances at $0.18/hr.
- If EC2 is underutilized, Fargate can be cheaper; if EC2 is packed efficiently with commitments, EC2 often wins.
- Peak 180% scenario validates scaling bursts.
Included
- Fargate compute estimate (vCPU-hours + GB-hours) from average running tasks and hours/day x days/month.
- EC2 compute estimate (instance-hours) from average instances and hours/day x days/month.
- Side-by-side monthly totals and differences.
- Baseline vs peak scenario table for capacity spikes.
Not included
- EBS storage, data transfer/NAT, load balancers, and other networking costs.
- Logs/metrics ingestion and retention costs.
- Tiering, discounts, and rounding rules unless you reflect them in inputs.
How we calculate
- Fargate: tasks x vCPU x (hours/day x days/month) x $/vCPU-hour + tasks x memory(GB) x (hours/day x days/month) x $/GB-hour.
- EC2: instances x (hours/day x days/month) x $/instance-hour (use a blended effective rate if you mix commitments).
- Compare the compute-only totals, then add other line items in your overall model.
FAQ
Is this a full total cost of ownership (TCO) model?
No. This compares compute-only costs. In real workloads, load balancers, logs, NAT/egress, and storage can be meaningful.
What should I use for average tasks/instances?
Use the monthly average running capacity, not peak. If you only know peak, estimate an average from traffic shape and validate later with metrics.
How do commitments change the EC2 comparison?
If you use Savings Plans/Reserved Instances, your effective EC2 $/hour can be lower. Use a blended rate that matches your expected coverage.
Related tools
Related guides
S3 pricing: a practical model for storage, requests, egress, and replication
A practical S3 pricing guide: what to include (GB-month, requests, egress, replication) and how to estimate the key inputs without copying price tables.
CDN cost comparison: how to compare pricing across providers
A practical framework to compare CDN pricing across providers: normalize bandwidth, requests, regions, cache fill, and contract terms before choosing the lowest total cost.
Cloud cost estimation checklist: build a model Google (and finance) will trust
A practical checklist to estimate cloud cost without missing major line items: requests, compute, storage, logs/metrics, and network transfer. Includes a worksheet template, validation steps, and the most common double-counting traps.
Copy storage pricing: what you pay for when data moves
A practical guide to pricing storage copy operations (cross-region copy, replication, backups) across S3-like object storage: transfer, requests, and extra storage.
Google Kubernetes Engine (GKE) pricing: nodes, networking, storage, and observability
GKE cost is not just nodes: include node pools, autoscaling, requests/limits (bin packing), load balancing/egress, storage, and logs/metrics. Includes a worked estimate template, pitfalls, and validation steps to keep clusters right-sized.
S3 CRR vs SRR cost: what changes (transfer, storage, requests)
A practical cost comparison of S3 cross-region replication (CRR) vs same-region replication (SRR). Compare transfer/feature fees, extra replica storage, and request costs - with calculators.
Advertisement
Disclaimer
Educational use only. Not legal, financial, or professional advice. Results are estimates based on the inputs and assumptions shown on this page. Verify pricing and limits with your providers and documentation.
Last updated: 2026-01-28