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.

Maintained by CloudCostKit Editorial Team. Last updated: 2026-01-21. Editorial policy and methodology.

Best next steps

Use this calculator for the first estimate, then validate the answer with the closest guide or companion tool.

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

ECS on EC2 vs ECS on Fargate is not the same as generic EC2 vs Fargate

This page is narrower than a generic runtime comparison because ECS changes the tradeoff. On EC2, you are not only buying instances. You are also buying the right to pack multiple services onto hosts and to absorb some cluster overhead yourself. On Fargate, you pay more directly per task, but you remove much of that host-management burden.

  • ECS on EC2: density and commitment coverage can win if hosts stay busy.
  • ECS on Fargate: cleaner task-level billing can win when headroom and host waste dominate.
  • Decision trap: host overhead, daemon workloads, and spare capacity are often forgotten on the EC2 side.

Where ECS platform comparisons usually go wrong

  • Peak task counts are compared to average EC2 host count, or the reverse.
  • EC2 packing assumes perfect density without leaving room for deployments, rebalancing, or noisy neighbors.
  • Cluster overhead on EC2, such as daemon tasks and spare headroom, is ignored.
  • Networking, ALB, and observability lines are mixed in unevenly across the two sides.

What to test before making the ECS platform decision

  • Check whether your services are steady enough to keep EC2 hosts meaningfully utilized across the month.
  • Check whether deployment overlap, autoscaling headroom, and cluster operations reduce the host density you think you have.
  • Use Fargate when per-service isolation and task-level elasticity matter more than host economics.
  • Use the same service envelope on both sides before you compare totals.

Baseline vs host-density stress scenarios

Scenario Fargate tasks EC2 instances Notes
Baseline Average Average Normal traffic
Peak High High Launch or incident

How to review the first month after the ECS choice

  • Compare EC2 instance-hours or Fargate task-hours to the same month of ECS service history, not to design assumptions.
  • If EC2 underperforms, check real host density and idle headroom before declaring the platform economics wrong.

Next steps

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 Guide: Compare Pricing, Per-GB Rates, and Provider Trade-Offs
Compare CDN pricing across providers with a practical framework for bandwidth, requests, per-GB rates, regional mix, and origin egress. Built for CDN cost comparison and provider-decision workflows.
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 Comparison: Transfer, Storage, and Request Fees
Practical S3 CRR vs SRR cost comparison with transfer fees, replica storage, and request costs. Includes calculator-ready inputs.

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. Reviewed against CloudCostKit methodology and current provider documentation. See the Editorial Policy .