ECS on EC2 vs ECS on Fargate Cost Calculator

Compare ECS on EC2 (instances x $/hour) vs ECS on Fargate (vCPU-hours + GB-hours) using average running capacity and hours/day x days/month. This is compute-only; add load balancers, logs, and data transfer for a full ECS model.

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.
  • EC2: use average instance count and a blended $/hour if you use commitments.
  • Schedule: apply the same hours/day and days/month to both sides.
  • Scope: compute-only; add load balancers, logs, and transfer separately.

Result interpretation

  • If Fargate wins only at peak, consider mixed capacity: EC2 baseline + Fargate burst.
  • If EC2 wins, confirm you can keep instances utilized and commitments aligned.

Common mistakes

  • Comparing peak tasks to average instances (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 in billing.
  • Use a real month of metrics to calibrate averages.

Next steps

Advertisement

Example scenario

  • ECS service: average 6 tasks at 0.5 vCPU and 1 GB running 24 hours/day for 30 days vs 3 EC2 instances at $0.18/hr.
  • ECS on EC2 often wins when instances are packed and covered by commitments; Fargate can win when idle capacity dominates.

Included

  • Compute-only comparison: EC2 instance-hours vs Fargate vCPU-hours + GB-hours.
  • Side-by-side monthly totals and differences.

Not included

  • Load balancers (ALB/NLB), NAT/egress, and cross-AZ transfer.
  • Logs/metrics ingestion and retention.
  • EBS storage and snapshots (often relevant for ECS on EC2).

How we calculate

  • Fargate compute = 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 compute = instances x (hours/day x days/month) x $/instance-hour.
  • Compare compute-only totals, then add networking + logs + load balancers for full ECS TCO.

FAQ

Why is this labeled compute-only?
For ECS workloads, ALBs/NLBs, NAT/egress, and logs can be major line items. This calculator isolates compute so you can compare the baseline first.
How do I choose average tasks and average instances?
Use monthly averages, not peak. If you only know peak, estimate an average from traffic shape and validate later with monitoring.
Should I use a blended EC2 $/hour?
Yes if you use Savings Plans/Reserved Instances. A blended effective rate makes comparisons more realistic.

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-21